WinCC 7.0 Scripting
WinCC 7.0 Scripting
1 2 3 4
SIMATIC HMI WinCC V7.0 SP1 MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
System Manual
11/2008
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation for the specific task, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems.
Trademarks
All names identified by are registered trademarks of the SiemensAG. The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this publication is reviewed regularly and any necessary corrections are included in subsequent editions.
08/2009
Table of contents
1 VBS for Creating Procedures and Actions.................................................................................................13 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.10 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.10.6 1.10.7 1.10.7.1 1.10.7.2 1.10.7.3 1.10.7.4 1.10.7.5 1.10.7.6 1.10.8 1.11 Resources...................................................................................................................................13 VBS for Creating Procedures and Actions..................................................................................13 Using Visual Basic Script in WinCC............................................................................................14 Modules and Procedures.............................................................................................................18 Actions.........................................................................................................................................21 Multiple Use of Procedures and Actions......................................................................................23 Use of CrossReference...............................................................................................................25 Using Global Tags in VBS...........................................................................................................27 VBScript Editors..........................................................................................................................28 VBScript Editors..........................................................................................................................28 Global Script Editor......................................................................................................................30 Working in an Editing Window.....................................................................................................32 Working with the Toolbars...........................................................................................................36 Deleting Actions or Procedures...................................................................................................38 Creating and Editing Procedures.................................................................................................39 Creating and Editing Procedures.................................................................................................39 Creating a New Procedure..........................................................................................................42 How to Write Procedure Codes...................................................................................................45 Using Standard and Project Procedures.....................................................................................47 Adding Module-related Information.............................................................................................49 Protecting a Module with a Password.........................................................................................51 Saving a Procedure.....................................................................................................................52 Renaming a Procedure or Module...............................................................................................54 Creating and Editing Actions.......................................................................................................55 Creating and Editing Actions.......................................................................................................55 Creating a New Action.................................................................................................................59 How to Edit Actions.....................................................................................................................61 How to add information to the action...........................................................................................64 Protecting an Action with a Password.........................................................................................66 Saving Actions.............................................................................................................................67 Triggers.......................................................................................................................................69 Triggers.......................................................................................................................................69 Animation trigger.........................................................................................................................73 How to add a trigger of the type "Timer"......................................................................................74 How to add a trigger of the type "Tag".........................................................................................76 How to change a trigger..............................................................................................................78 How to delete a trigger................................................................................................................79 How to Rename an Action...........................................................................................................81 Activating Global Actions in Runtime...........................................................................................82
Table of contents
1.12 Diagnostics..................................................................................................................................83 1.12.1 Diagnostics..................................................................................................................................83 1.12.2 GSC Diagnostics.........................................................................................................................84 1.12.2.1 GSC Diagnostics.........................................................................................................................84 1.12.2.2 Inserting the GSC Diagnostics Window into a Picture.................................................................85 1.12.2.3 GSC Diagnostics Attributes.........................................................................................................86 1.12.2.4 GSC Diagnostics Toolbar............................................................................................................86 1.12.3 GSC Runtime..............................................................................................................................87 1.12.3.1 GSC Runtime..............................................................................................................................87 1.12.3.2 Inserting the GSC Runtime Window into a Picture......................................................................88 1.12.3.3 GSC Runtime Attributes..............................................................................................................89 1.12.4 Testing with the Debugger...........................................................................................................90 1.12.4.1 Testing with the Debugger...........................................................................................................90 1.12.4.2 How to Activate the Debugger.....................................................................................................91 1.12.4.3 Principles of Debugging...............................................................................................................93 1.12.4.4 Components of the Microsoft Script Debuggers..........................................................................95 1.12.4.5 Structure of VBScript Files..........................................................................................................97 1.12.4.6 Action and Procedure Names in the Debugger...........................................................................99 1.12.4.7 Selecting a Script for Editing.....................................................................................................100 1.12.4.8 Processing Scripts Step-by-Step...............................................................................................102 1.12.4.9 Setting Breakpoints...................................................................................................................103 1.12.4.10Deleting Breakpoints.................................................................................................................104 1.12.4.11How to Set Bookmarks in Scripts..............................................................................................105 1.12.4.12How to Determine and Modify Tag and Property Values..........................................................106 1.12.4.13Executing Script Commands.....................................................................................................107 1.13 Printing VBScripts......................................................................................................................108 1.14 VBS Reference..........................................................................................................................109 1.14.1 VBS Reference..........................................................................................................................109 1.14.2 Objects and Lists.......................................................................................................................113 1.14.2.1 Objects and Lists.......................................................................................................................113 1.14.2.2 Alarm object...............................................................................................................................115 1.14.2.3 Alarms object (list).....................................................................................................................116 1.14.2.4 AlarmLogs Object......................................................................................................................118 1.14.2.5 DataItem Object.........................................................................................................................119 1.14.2.6 DataLogs Object........................................................................................................................121 1.14.2.7 DataSet-Objekt (List).................................................................................................................122 1.14.2.8 HMIRuntime Object...................................................................................................................125 1.14.2.9 Item Object................................................................................................................................126 1.14.2.10Layer Object..............................................................................................................................127 1.14.2.11Layers Object (Listing)...............................................................................................................129 1.14.2.12Logging Object..........................................................................................................................130 1.14.2.13ProcessValue Object.................................................................................................................131 1.14.2.14ProcessValues Object (List)......................................................................................................132 1.14.2.15Project Object............................................................................................................................133 1.14.2.16ScreenItem Object.....................................................................................................................134 1.14.2.17ScreenItems Object (List)..........................................................................................................138 1.14.2.18Screen Object............................................................................................................................140 1.14.2.19Screens Object (List).................................................................................................................143 1.14.2.20SmartTags Object......................................................................................................................145 1.14.2.21Tag Object.................................................................................................................................146 1.14.2.22Tags Object (List)......................................................................................................................149
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Table of contents
1.14.2.23TagSet Object (List)...................................................................................................................151 1.14.3 Object Types of the ScreenItem Object.....................................................................................152 1.14.3.1 Object Types of the ScreenItem Object.....................................................................................152 1.14.3.2 Standard objects........................................................................................................................154 1.14.3.3 Smart objects.............................................................................................................................182 1.14.3.4 Windows objects........................................................................................................................214 1.14.3.5 Tube objects..............................................................................................................................226 1.14.3.6 Controls.....................................................................................................................................230 1.14.3.7 Customized object.....................................................................................................................273 1.14.3.8 Group.........................................................................................................................................274 1.14.4 Properties..................................................................................................................................276 1.14.4.1 Properties..................................................................................................................................276 1.14.4.2 A................................................................................................................................................276 1.14.4.3 B................................................................................................................................................295 1.14.4.4 C................................................................................................................................................320 1.14.4.5 D................................................................................................................................................350 1.14.4.6 E................................................................................................................................................359 1.14.4.7 F................................................................................................................................................368 1.14.4.8 G................................................................................................................................................386 1.14.4.9 H................................................................................................................................................390 1.14.4.10I..................................................................................................................................................399 1.14.4.11L.................................................................................................................................................405 1.14.4.12M................................................................................................................................................435 1.14.4.13N................................................................................................................................................452 1.14.4.14O................................................................................................................................................455 1.14.4.15P................................................................................................................................................470 1.14.4.16Q................................................................................................................................................487 1.14.4.17R................................................................................................................................................488 1.14.4.18S................................................................................................................................................497 1.14.4.19T................................................................................................................................................530 1.14.4.20U................................................................................................................................................601 1.14.4.21V................................................................................................................................................610 1.14.4.22W...............................................................................................................................................625 1.14.4.23X - Z...........................................................................................................................................630 1.14.5 Methods.....................................................................................................................................638 1.14.5.1 Methods.....................................................................................................................................638 1.14.5.2 Methods A to E..........................................................................................................................639 1.14.5.3 Get methods..............................................................................................................................648 1.14.5.4 Methods H to M.........................................................................................................................686 1.14.5.5 Methods N to R..........................................................................................................................694 1.14.5.6 Methods S to T..........................................................................................................................712 1.14.5.7 Methods U to Z..........................................................................................................................725 1.14.6 Appendix....................................................................................................................................732 1.14.6.1 Error Messages from Database Area........................................................................................732 1.15 1.15.1 1.15.2 1.15.2.1 1.15.2.2 1.15.2.3 1.15.2.4 1.15.2.5 Examples of VBScript................................................................................................................734 Examples of VBScript................................................................................................................734 Examples in WinCC...................................................................................................................734 Examples in WinCC...................................................................................................................734 Example: Accessing objects in Graphics Designer...................................................................735 Example: Defining the color of objects......................................................................................736 Example: How to Configure Language Changes......................................................................736 Example: Deactivating Runtime................................................................................................737
Table of contents
1.15.2.6 Example: Configuring change picture globally..........................................................................737 1.15.2.7 Example: Configuring Change Picture Via Property..................................................................738 1.15.2.8 Example: Configuring diagnostics output via Trace..................................................................738 1.15.2.9 Example: Writing tag values......................................................................................................739 1.15.2.10Example: How to Read Tag Values...........................................................................................741 1.15.2.11Example: Writing Object Properties...........................................................................................743 1.15.2.12Example: How to Start an Action on the Server (Logging Object).............................................746 1.15.2.13Dynamization of Controls..........................................................................................................748 1.15.3 General Examples.....................................................................................................................755 1.15.3.1 General examples for VBScript.................................................................................................755 1.15.3.2 Example: Configuring a Database Connection with VBS..........................................................756 1.15.3.3 Example: Using the MS Automation interface...........................................................................758 1.15.3.4 Example: Starting an external application.................................................................................760 1.16 1.16.1 1.16.2 2 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 Basic Principles of VBScript......................................................................................................760 Basic Principles of VBScript......................................................................................................760 VBScript Basics.........................................................................................................................761 Resources.................................................................................................................................763 Creating Functions and Actions with ANSI-C............................................................................763 Creating Functions and Actions.................................................................................................763 Characteristics of Project Functions..........................................................................................766 Characteristics of Standard Functions.......................................................................................767 Characteristics of Internal Functions.........................................................................................768 Characteristics of Local Actions................................................................................................769 Characteristics of Global Actions...............................................................................................770 How to Add Global Script Runtime to a Project's Startup List...................................................771 Use of Global C-Tags................................................................................................................772 Use of DLLs in Functions and Actions.......................................................................................774
2.11 The Global Script Editor............................................................................................................775 2.11.1 The Global Script Editor............................................................................................................775 2.11.2 Working in the Edit Window.......................................................................................................778 2.11.2.1 Working in the Edit Window.......................................................................................................778 2.11.2.2 Editing Functions with the Keyboard.........................................................................................780 2.11.2.3 Editing Functions with the Mouse..............................................................................................780 2.11.3 Working with the Toolbars.........................................................................................................781 2.11.4 How to Set Different Views........................................................................................................783 2.11.5 How to Set the Font Style..........................................................................................................784 2.11.6 How to Use "Save As..."............................................................................................................784 2.11.7 How to Delete Actions or Project and Standard Functions........................................................785 2.11.8 How to Generate a New Header...............................................................................................786 2.11.9 How to Compile All Functions....................................................................................................786 2.11.10 How to Search in Files...............................................................................................................787 2.11.11 Printing Functions and Actions..................................................................................................788 2.11.11.1Printing Functions and Actions..................................................................................................788 2.11.11.2How to Set the Print Parameters...............................................................................................788
Table of contents
2.11.11.3How to Open Page View...........................................................................................................789 2.11.11.4How to Print the Project Documentation....................................................................................789 2.12 2.12.1 2.12.2 2.12.3 2.12.4 2.12.5 2.12.6 2.12.7 2.12.8 2.12.9 2.12.10 2.13 2.13.1 2.13.2 2.13.3 2.13.4 2.13.5 2.13.6 2.13.7 2.13.8 2.13.8.1 2.13.8.2 2.13.8.3 2.13.8.4 2.13.8.5 2.13.9 2.13.10 2.13.11 2.13.12 2.13.13 2.14 2.14.1 2.14.2 2.14.2.1 2.14.2.2 2.14.2.3 2.14.2.4 2.14.3 2.14.3.1 2.14.3.2 2.14.3.3 2.14.3.4 2.15 3 3 3.1 Creating and Editing Functions.................................................................................................790 Creating and Editing Functions.................................................................................................790 How to Create a New Function..................................................................................................793 How to Write Function Code......................................................................................................794 How to Use Internal Functions..................................................................................................795 How to Use Standard and Project Functions.............................................................................796 Inserting Additional Function-Related Information.....................................................................797 How to Protect a Function Against Unauthorized Access.........................................................798 How to Compile and Save a Function.......................................................................................799 How to Rename a Function.......................................................................................................800 How to Use Functions from Other Sources...............................................................................801 Creating and Editing Actions.....................................................................................................802 How To Create and Edit Actions...............................................................................................802 WinCC Coding Rule..................................................................................................................805 How to Create a New Action.....................................................................................................806 How to Edit Actions...................................................................................................................807 Inserting Additional Action-Related Information........................................................................807 How to Protect an Action Against Unauthorized Access...........................................................809 How to Compile and Save an Action.........................................................................................810 Triggers.....................................................................................................................................811 Triggers.....................................................................................................................................811 How to Add a New Trigger of the "Timer" Type.........................................................................814 How to Add a New Trigger of the "Tag" Type............................................................................815 How to Change a Trigger..........................................................................................................817 How to Delete a Trigger.............................................................................................................818 How to Assign Authorizations....................................................................................................820 How to Export an Action............................................................................................................821 How to Import an Action............................................................................................................821 How to Rename an Action.........................................................................................................822 How to Use Actions From Other Sources..................................................................................823 Runtime Behavior of Actions.....................................................................................................824 Runtime Behavior of Actions.....................................................................................................824 GSC Runtime............................................................................................................................825 GSC Runtime............................................................................................................................825 How to Place GSC Runtime in a Process Picture.....................................................................828 Attributes of GSC Runtime........................................................................................................829 How to Edit Actions...................................................................................................................829 GSC Diagnose...........................................................................................................................830 GSC Diagnose...........................................................................................................................830 How to Place GSC Diagnose in a Process Picture?.................................................................831 Attributes of GSC Diagnose......................................................................................................832 The Toolbar of GSC Diagnose..................................................................................................832 ANSI-C function descriptions.....................................................................................................833 Resources.................................................................................................................................835 lpszPictureName.......................................................................................................................835
Table of contents
3.2 3.2.1 3.2.2 3.2.2.1 3.2.2.2 3.2.2.3 3.2.2.4 3.2.3 3.2.3.1 3.2.3.2 3.2.3.3 3.2.3.4 3.2.3.5 3.2.3.6 3.2.3.7 3.2.4 3.2.4.1 3.2.4.2 3.2.4.3 3.2.4.4 3.2.5 3.2.5.1 3.2.5.2 3.2.5.3 3.2.5.4 3.2.5.5 3.2.5.6 3.2.5.7 3.2.5.8 3.2.6 3.2.6.1 3.2.6.2 3.2.7 3.2.7.1 3.2.7.2 3.2.7.3 3.3 3.3.1 3.3.2 3.3.2.1 3.3.2.2 3.3.3 3.3.3.1 3.3.3.2 3.3.3.3 3.3.3.4 3.3.3.5 3.3.3.6 3.3.3.7 3.3.3.8 3.3.4
Standard functions.....................................................................................................................835 Standard functions - short description.......................................................................................835 Alarm.........................................................................................................................................836 AcknowledgeMessage...............................................................................................................836 AXC_SetFilter............................................................................................................................837 GCreateMyOperationMsg..........................................................................................................838 GMsgFunction...........................................................................................................................840 Graphics....................................................................................................................................841 Graphics - short description.......................................................................................................841 GetLinkedVariable.....................................................................................................................842 GetLocalPicture.........................................................................................................................842 GetParentPicture.......................................................................................................................843 GetParentPictureWindow..........................................................................................................844 OpenPicture...............................................................................................................................845 Registry2...................................................................................................................................846 Report........................................................................................................................................847 Report - short description..........................................................................................................847 RPTJobPreview.........................................................................................................................847 RPTJobPrint..............................................................................................................................848 RptShowError............................................................................................................................849 WinCC.......................................................................................................................................850 WinCC - short description..........................................................................................................850 GetHWDiag...............................................................................................................................850 GetHWDiagLevel.......................................................................................................................851 GetKopFupAwl..........................................................................................................................853 GetKopFupAwlLevel..................................................................................................................854 OnDeactivateExecute................................................................................................................855 OnErrorExecute.........................................................................................................................855 OnTime......................................................................................................................................857 Windows....................................................................................................................................857 Windows - short description......................................................................................................857 ProgramExecute........................................................................................................................858 Obsolete functions.....................................................................................................................858 Alarm.........................................................................................................................................858 Report........................................................................................................................................884 TagLog......................................................................................................................................885 Internal functions.......................................................................................................................919 Internal functions - short description..........................................................................................919 allocate......................................................................................................................................920 SysFree.....................................................................................................................................920 SysMalloc..................................................................................................................................920 c_bib..........................................................................................................................................921 c_bib - short description.............................................................................................................921 ctype..........................................................................................................................................921 math...........................................................................................................................................930 memory......................................................................................................................................946 stdio...........................................................................................................................................950 stdlib..........................................................................................................................................971 string..........................................................................................................................................986 time............................................................................................................................................997 graphics...................................................................................................................................1004
Table of contents
3.3.4.1 3.3.4.2 3.3.4.3 3.3.5 3.3.5.1 3.3.5.2 3.3.5.3 3.3.6 3.3.6.1 3.3.6.2 3.3.6.3 3.3.6.4 3.3.6.5 3.3.6.6 3.4 3.4.1 3.4.1.1 3.4.1.2 3.4.1.3 3.4.1.4 3.4.1.5 3.4.1.6 3.4.1.7 3.4.2 3.4.2.1 3.4.2.2 3.4.2.3 3.4.2.4 3.4.2.5 3.4.2.6 3.4.2.7 3.4.2.8 3.4.2.9 3.4.2.10 3.4.2.11 3.4.2.12 3.4.2.13 3.4.2.14 3.4.2.15 3.4.2.16 3.4.3 3.4.3.1 3.4.3.2 3.4.3.3 3.4.3.4 3.4.3.5 3.4.3.6 3.4.3.7 3.4.3.8 3.4.3.9 3.4.3.10
Graphics - short description.....................................................................................................1004 get............................................................................................................................................1004 set............................................................................................................................................1168 tag............................................................................................................................................1354 tag - short description..............................................................................................................1354 get............................................................................................................................................1355 set............................................................................................................................................1417 WinCC.....................................................................................................................................1464 WinCC - short description........................................................................................................1464 system.....................................................................................................................................1464 FillDiagnoseInTags..................................................................................................................1468 GetServerTagPrefix.................................................................................................................1469 TraceText................................................................................................................................1469 TraceTime...............................................................................................................................1470 Appendix..................................................................................................................................1471 Examples.................................................................................................................................1471 Examles - A to G.....................................................................................................................1471 Examples - GetAlarmHigh to GetPropChar.............................................................................1474 Examples - GetRangeMax to GetWidth..................................................................................1489 Examples - H to S....................................................................................................................1509 Examples - SetAlarmHigh to SetPropChar..............................................................................1511 Examples - SetRangeMax to SetWidth...................................................................................1521 Examples - T to Z....................................................................................................................1530 Lists.........................................................................................................................................1535 Bar direction............................................................................................................................1535 Bar Scaling..............................................................................................................................1535 Flash frequencies....................................................................................................................1536 I/O field, output format.............................................................................................................1536 I/O field, data type of the field content.....................................................................................1537 I/O field, field type....................................................................................................................1537 Element alignment in check boxes and radio boxes...............................................................1538 Color chart...............................................................................................................................1538 Format descriptors...................................................................................................................1538 Fill pattern................................................................................................................................1539 Line styles................................................................................................................................1541 Line end style..........................................................................................................................1541 List types.................................................................................................................................1541 Language ID............................................................................................................................1542 Text alignment.........................................................................................................................1543 Tag statuses............................................................................................................................1543 Structure definitions.................................................................................................................1544 Structure definition CCAPErrorExecute...................................................................................1544 Structure definition CCAPTime................................................................................................1545 Structure definition CMN_ERROR...........................................................................................1546 Structure definition DM_TYPEREF..........................................................................................1547 Structure definition DM_VAR_UPDATE_STRUCT..................................................................1548 Structure definition DM_VAR_UPDATE_STRUCTEX.............................................................1549 Structure definition DM_VARKEY............................................................................................1550 Structure definition LINKINFO.................................................................................................1551 Structure definition MSG_FILTER_STRUCT...........................................................................1552 Structure definition MSG_RTDATA_STRUCT.........................................................................1556
Table of contents
VBA for Automated Configuration..........................................................................................................1559 4 4.1 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.3 4.3.1 4.3.2 4.3.2.1 4.3.2.2 4.3.2.3 4.3.2.4 4.3.3 4.3.3.1 4.3.3.2 4.3.3.3 4.3.3.4 4.3.4 4.3.4.1 4.3.4.2 4.3.4.3 4.3.4.4 4.3.5 4.3.5.1 4.3.5.2 4.3.5.3 4.3.5.4 4.3.6 4.3.7 4.3.7.1 4.3.7.2 4.4 4.4.1 4.4.2 4.4.3 4.4.4 4.4.5 4.4.5.1 4.4.5.2 4.4.6 4.4.6.1 4.4.6.2 4.4.6.3 4.4.7 4.4.7.1 Resources...............................................................................................................................1559 Automated Configuring............................................................................................................1559 Introduction: Using VBA in WinCC..........................................................................................1560 Introduction: Using VBA in WinCC..........................................................................................1560 Differentiation: Using VBA.......................................................................................................1561 Organizing VBA Code in a WinCC Project..............................................................................1562 How to export and import VBA code.......................................................................................1565 Executing VBA Macros in Graphics Designer.........................................................................1566 VBA in the Graphics Designer.................................................................................................1567 VBA in the Graphics Designer.................................................................................................1567 Adapting the Graphics Designer with VBA..............................................................................1569 Adapting the Graphics Designer with VBA..............................................................................1569 Language-Dependent Configuration with VBA........................................................................1570 Creating Customized Menus and Toolbars.............................................................................1572 Accessing the component library with VBA.............................................................................1593 Editing Pictures with VBA........................................................................................................1601 Editing Pictures with VBA........................................................................................................1601 How to Create Picture-Specific Menus and Toolbars..............................................................1602 Editing Layers with VBA..........................................................................................................1603 Editing a Copy of a Picture with VBA......................................................................................1605 Editing Objects with VBA.........................................................................................................1606 Editing Objects with VBA.........................................................................................................1606 Default objects, Smart objects, Windows objects and Tube objects.......................................1609 Group Objects.........................................................................................................................1618 Customized Objects................................................................................................................1626 Creating Dynamics with VBA...................................................................................................1631 Creating Dynamics with VBA...................................................................................................1631 Configuring Dynamics in the Properties of Pictures and Objects............................................1632 Configuring Event-Driven Actions with VBA............................................................................1644 Editing Triggers.......................................................................................................................1652 Event Handling........................................................................................................................1655 Accessing External Applications with VBA..............................................................................1658 Accessing External Applications with VBA..............................................................................1658 Example: Accessing MS Excel with VBA................................................................................1659 The object model of the Graphics Designer............................................................................1664 VBA Reference........................................................................................................................1664 VBA Reference: ActionDynamic..............................................................................................1667 VBA Reference: HMIObjects...................................................................................................1669 VBA Reference: Languages....................................................................................................1671 Events......................................................................................................................................1671 A-D..........................................................................................................................................1671 F-Z...........................................................................................................................................1688 Methods...................................................................................................................................1704 A-C..........................................................................................................................................1704 D-M..........................................................................................................................................1744 O-Z..........................................................................................................................................1780 Objects and Lists.....................................................................................................................1805 0-9, A-C...................................................................................................................................1805
10
Table of contents
4.4.7.2 4.4.7.3 4.4.7.4 4.4.8 4.4.8.1 4.4.8.2 4.4.8.3 4.4.8.4 4.4.8.5 4.4.8.6 4.4.8.7 4.4.8.8 4.4.8.9 4.4.8.10 4.4.8.11 4.4.8.12 4.4.8.13 4.4.8.14 4.4.8.15 4.4.8.16 4.4.8.17 4.4.8.18 4.5 4.5.1 4.5.2 4.5.3 4.5.4 4.5.4.1 4.5.4.2 4.6 4.6.1 4.6.2 4.6.2.1 4.6.2.2 4.6.2.3 4.6.2.4 4.6.2.5 4.6.2.6 4.6.2.7 4.6.3 4.6.3.1 4.6.3.2 4.6.3.3 4.6.3.4 4.6.3.5 4.6.3.6 4.6.3.7 4.6.3.8 4.6.3.9 4.6.3.10 4.6.3.11
D-I............................................................................................................................................1841 L-Q...........................................................................................................................................1889 R-Z...........................................................................................................................................1939 Properties................................................................................................................................1995 A..............................................................................................................................................1995 B..............................................................................................................................................2016 C..............................................................................................................................................2053 D..............................................................................................................................................2089 E..............................................................................................................................................2096 F..............................................................................................................................................2104 G-H..........................................................................................................................................2134 I - K..........................................................................................................................................2144 L...............................................................................................................................................2157 M..............................................................................................................................................2206 N-O..........................................................................................................................................2228 P-Q..........................................................................................................................................2241 R..............................................................................................................................................2268 S..............................................................................................................................................2276 T..............................................................................................................................................2299 U..............................................................................................................................................2324 V..............................................................................................................................................2331 W - Z........................................................................................................................................2406 AddIns.....................................................................................................................................2414 AddIns.....................................................................................................................................2414 Linking Add Ins........................................................................................................................2415 Loading an Addin in the Graphics Designer............................................................................2417 Example: Creating Add Ins......................................................................................................2418 Example: Creating Add Ins......................................................................................................2418 Example: Creating an Add In with Visual Basic 6.0.................................................................2419 VBA in Other WinCC Editors...................................................................................................2424 VBA in Other WinCC Editors...................................................................................................2424 VBA in Tag Management........................................................................................................2426 VBA in Tag Management........................................................................................................2426 CloseTag Function..................................................................................................................2429 CommitTag Function...............................................................................................................2430 CreateTag Function.................................................................................................................2432 DeleteTag Function.................................................................................................................2434 GetTag Function......................................................................................................................2435 ListTag function.......................................................................................................................2436 VBA im Tag Logging................................................................................................................2438 VBA in Tag Logging.................................................................................................................2438 CloseTlgArchive-Funktion.......................................................................................................2442 CloseTlgTag Function.............................................................................................................2443 CommitTlgArchive Function....................................................................................................2445 CommitTlgTag Function..........................................................................................................2446 CreateTlgArchive Function......................................................................................................2448 CreateTlgTag Function............................................................................................................2451 DeleteTlgArchive Function......................................................................................................2455 DeleteTlgTag Function............................................................................................................2457 GetTlgArchive Function...........................................................................................................2458 GetTlgTag Function.................................................................................................................2459
11
Table of contents
4.6.3.12 4.6.3.13 4.6.4 4.6.4.1 4.6.4.2 4.6.4.3 4.6.4.4 4.6.4.5 4.6.4.6 4.6.4.7 4.6.4.8 4.6.4.9 4.6.5 4.6.5.1 4.6.5.2 4.6.5.3 4.6.5.4 4.6.5.5 4.6.5.6 4.6.5.7
ListTlgArchive Function...........................................................................................................2461 ListTlgTag Function.................................................................................................................2463 VBA in the Text Library............................................................................................................2465 VBA in the Text Library............................................................................................................2465 CreateTextLanguage Function................................................................................................2466 CreateText Function................................................................................................................2467 DeleteText Function................................................................................................................2468 DeleteTextLanguage Function................................................................................................2470 GetText Function.....................................................................................................................2471 GetTextID Function.................................................................................................................2473 ListText Function.....................................................................................................................2475 ModifyText Function................................................................................................................2476 VBA in Alarm Logging.............................................................................................................2478 VBA in Alarm Logging.............................................................................................................2478 CloseSingleAlarm Function.....................................................................................................2481 CommitSingleAlarm Function..................................................................................................2482 CreateSingleAlarm Function....................................................................................................2483 DeleteSingleAlarm Function....................................................................................................2487 GetSingleAlarm Function.........................................................................................................2488 ListSingleAlarm Function.........................................................................................................2489
Index.......................................................................................................................................................2493
12
WinCC provides the possibility of dynamizing the Runtime environment using the Visual Basic Script. It is possible to use VBS to program global actions and procedures as well as dynamizing graphic objects and triggering actions in Runtime. This chapter will show you How to work with VBScript editors How to create and edit procedures How to create and edit actions How to activate VBScripts in Runtime How to execute diagnostics on scripts in Runtime The object model of graphic Runtime system Detailed examples on using VBScript
13
VBS for Creating Procedures and Actions 1.2 Using Visual Basic Script in WinCC
1.2
Introduction
In addition to the C script, WinCC also provides the VBScript program language as a programming interface in order to make the WinCC Runtime environment dynamic.
Application Options
VBScript (VBS) provides access to tags and objects of the graphical Runtime system at Runtime and can execute picture-independent functions: Tags: Tag values can be read and written in order, for example, to specify tag values for the PLC by clicking the mouse when positioned on a button. Objects: Object properties can be made dynamic using actions and actions can be triggered by events influencing objects. Picture-independent Actions: Picture-independent actions can be triggered cyclically or according to tag values, e.g. for the daily transfer of values into an Excel table.
14
VBS for Creating Procedures and Actions 1.2 Using Visual Basic Script in WinCC
VBS can be used at the following points in WinCC: In the Global Script Editor: This is used to configure picture-independent actions and procedures. The procedures can be used in picture-dependent and picture-independent actions. Several procedures are compiled in a topic-related module. In Graphics Designer: Picture-dependent actions can be configured with which the properties of graphic objects can be made dynamic or caused to respond to events in Runtime. In user-defined menus and toolbars: Here you configure procedures called in Runtime using the menu and toolbars. Note Updating Changed Configuration in Runtime A changed VB script that is connected with "Menus and toolbars" is only updated after Runtime is restarted. If you change the properties of "Menus and toolbars" in Runtime, the changes are only applied in the following cases: After a picture change, if the configuration change does not affect the basic picture. When you load another configuration file and reload the modified configuration file.
Application Scenarios
VBS can be used in Runtime, for example: to configure setpoint value specification for tags for the operation of a graphic object in order to define a value for the PLC by clicking a mouse, for example. to configure switching the Runtime language for the operation of a graphic object. to configure the change of color, e.g. cyclically (flashing) or to display statuses (motor on). Apart from the specific WinCC applications, the general functionality of VBS can also be used to customize the Windows environment, e.g.: to transfer data to another application (e.g. Excel). to start external applications from WinCC. to create files and folders. The automation objects in your environment are available with which to customize the Windows environment.
15
VBS for Creating Procedures and Actions 1.2 Using Visual Basic Script in WinCC
Note All the objects supplied with the Windows Script Host (WSH) from Microsoft can be integrated in the environment using the standard VBS method CreateObject. However, there is no direct access to the WSH object itself using VBS from WinCC. There is no guarantee nor WinCC support for the VBS functionality with regard to its adaptation to the Windows environment.
16
VBS for Creating Procedures and Actions 1.2 Using Visual Basic Script in WinCC
17
VBS for Creating Procedures and Actions 1.3 Modules and Procedures
1.3
Introduction
Procedures are used to make code, created only once, available at several points in a project. Instead of entering the code several times, simply call in the corresponding procedure. The code is clearer and easier to maintain.
Related procedures should be stored in modules. When a certain procedure is retrieved via an action in Runtime, the module that contains that procedure is loaded. Observe the following when structuring the modules and procedures: The more modules that must be loaded when a picture is called in, the worse the performance in Runtime. The larger a module, the more procedures are contained and, thus, the longer the loading time for the module. Organize the modules sensibly, e.g. a module with procedures for a specific system part/ picture. Another type of structuring of procedures in modules is the functional structuring, e.g. a module containing mathematical functions. Use this structure, for example, for modules which should be used globally for projects. The following example illustrates a module containing mathematical functions derived from the standard functions:
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
18
VBS for Creating Procedures and Actions 1.3 Modules and Procedures
Procedure Features
The procedures in WinCC have the following properties: They are created and modified by the user. They can be protected against modification and viewing by means of a password. They do not have a trigger. They are stored in a module. WinCC does not provide predefined procedures, but does provide code templates and Intellisense, for example, to simplify programming. Procedures differ according to module assignment in: Standard procedures apply globally to projects located on the computer on which they were created. Project procedures can only be used within the project in which they were created.
19
VBS for Creating Procedures and Actions 1.3 Modules and Procedures
Module Features
A module is a file in which one or procedures is stored. The modules in WinCC have the following properties: They can be protected against modification and viewing by means of a password. The have the file extension *.bmo. Modules differ according to the validity of their procedures in: Standard Modules: Contain procedures which are globally available to the project. Standard modules are stored in the WinCC file system under: <WinCC-Installationsverzeichnis> \ApLib\ScriptLibStd\<Modulname>.bmo Project Modules: Contain project-specific procedures. Project modules are stored in the WinCC file system under: <Projektverzeichnis>\ScriptLib\<Modulname>.bmo. Since the project modules are stored in the project directory, they are copied when the WinCC project is copied. Note If WinCC must be reinstalled and the standard procedures and modules need to be used again, save the module files prior to the reinstallation in a different directory and copy them in the relevant WinCC directory after the reinstallation has been completed. Otherwise, the standard modules in the WinCC installation directory are deleted during the installation routine.
See also
Creating and Editing Procedures (Page39) VBScript Editors (Page28) Basic Principles of VBScript (Page760) Actions (Page21) Using Visual Basic Script in WinCC (Page14)
20
1.4
Actions
Introduction
An action is always started by a trigger. An action, for example, is triggered in Runtime when an object is operated by a mouse click, a certain time has occurred or a tag has been modified.
Action Features
Actions are defined once in Global Script and then available independent of the picture. Global Script actions are only valid in the project in which they were defined. Actions linked to a graphic object are only valid in the picture in which they were defined. Note VBS does not currently allow the creation of computer-specific actions. The following applies for clients in a multi-user system: All global actions configured on a server are also executed on a client when a project is opened. The following applies to clients in a distributed system: If actions should be used on a client computer, copy all the action files in the corresponding project directory on the client. Actions have the following properties: Actions are created and modified by the user. Actions in Global Script can be protected against modification and viewing by means of a password. Actions have at least one trigger. Actions in Global Script have the file extension *.bac. Global Script actions are stored in the WinCC file system under: <Projektverzeichnis> \ScriptAct\Aktionsname.bac
Action Trigger
Triggers are required to execute actions in Runtime. A trigger is linked to an action thus forming the triggering event which calls the action. Actions without triggers will not be carried out. The following trigger types are available in WinCC: Timer: Acyclic or cyclic trigger, e.g. for calling a picture or every hour. Tags: Change of value Event: Modification of object properties (e.g. change of color) or event on an object (e.g. mouse click).
21
In Global Script
Picture-independent actions from Global Script are executed in Runtime in succession after being triggered. If an action is triggered while another action is in progress, the second action is retained in a queue until it can be executed. Note Please note that synchronization between actions in Global Script and in Graphics Designer may only be executed by the DataSet object or by internal WinCC tags. There is no common data area between the actions in Graphics Designer and in Global Script.
22
VBS for Creating Procedures and Actions 1.5 Multiple Use of Procedures and Actions
See also
Creating and Editing Actions (Page55) Basic Principles of VBScript (Page760) Modules and Procedures (Page18) Using Visual Basic Script in WinCC (Page14)
1.5
Introduction
An action configured with VBS in WinCC is always valid for the project in which it was defined. Procedures have the following areas of application: Standard procedures apply globally to projects located on the computer on which they were created. Project procedures can only be used in the project in which they were created. If a project is copied, the project procedures (modules) are copied together with the project.
23
VBS for Creating Procedures and Actions 1.5 Multiple Use of Procedures and Actions
Storing Procedures
If procedures need to be copied in other project directories in order to be able to use then in other projects or different computers, observe the storage path of the procedures in the WinCC file system: Standard procedures: <WinCC-Installationsverzeichnis>\ApLib\ScriptLibStd \Modulname.bmo Project procedures: <Projektverzeichnis>\ScriptLib\Modulname.bmo Note Since procedures are always stored in modules, always copy the module (*.bmo) in which the procedure is contained. The copied procedures/modules are visible after updating the Global Script navigation window (context menu command "Update") or restarting the editor.
Storing Actions
If actions need to be copied in other project directories in order to be able to use then in other projects or different computers, observe the storage path of the actions in the WinCC file system: <Projektverzeichnis>\ScriptAct\Aktionsname.bac Each action is stored in a separate file. When an action is copied, all the triggers related to it are also copied. Note Only actions created in Global Script are stored in the WinCC file system. Actions which are programmed in Graphics Designer are always stored with the current picture and cannot be transferred individually. If a Graphics Designer picture is copied into another project directory, the actions stored with the picture are also copied. The copied actions are visible after updating the Global Script navigation window (context menu command "Update") or restarting the editor.
24
See also
Modules and Procedures (Page18) Renaming a Procedure or Module (Page54) Saving a Procedure (Page52) Protecting a Module with a Password (Page51) Adding Module-related Information (Page49) Using Standard and Project Procedures (Page47) How to Write Procedure Codes (Page45) Creating a New Procedure (Page42) Creating and Editing Procedures (Page39)
1.6
Use of CrossReference
25
26
VBS for Creating Procedures and Actions 1.7 Using Global Tags in VBS
See also
VBS Reference (Page109) VBScript Editors (Page28) Basic Principles of VBScript (Page760) Actions (Page21) Modules and Procedures (Page18) Using Visual Basic Script in WinCC (Page14)
1.7
Introduction
Global tags can be defined in the Global Script Editor which can then be used in all actions and procedures.
27
See also
Basic Principles of VBScript (Page760) Structure of VBScript Files (Page97) Creating and Editing Actions (Page55) Creating and Editing Procedures (Page39) VBScript Editors (Page28) Use of CrossReference (Page25) Actions (Page21) Modules and Procedures (Page18)
1.8
1.8.1
VBScript Editors
VBScript Editors
Introduction
VBScripts can be programmed at two points in WinCC: In Global Script Global Script is the central editor for VBS programming. Call it in via WinCC Explorer.
28
Further Information
Further information on "Dynamization" is available in the WinCC documentation.
See also
Global Script Editor (Page30)
29
1.8.2
Introduction
Global procedures and actions are created and edited in the Global Script editor. Global Script provides a similar range of functions to that of the C script editor in WinCC. Note A detailed description of the action editor for the creation of picture-based actions and procedures in Graphics Designer is provided under the WinCC help topic "Dynamics".
Global Script is also automatically started when a module or action is opened by means of a double click in WinCC Explorer.
30
31
See also
Deleting Actions or Procedures (Page38) Working with the Toolbars (Page36) Working in an Editing Window (Page32)
1.8.3
Introduction
Procedures and actions are edited in the editing window.
32
33
The color coding in the editing window can be customized by means of the editor settings. Select the "Tools" > "Options" menu commands and the "Script Editor Options" dialog to define the settings. In order to organize the codes clearly, they can be structured by indentations. The "Script Editor Options" dialog can also be used to define the tabulator distance and Automatic Indent while writing.
34
Code Templates
In the Code templates tab in the Navigation window of the Editor, you will find a selection of frequently used instructions, e.g. for loops and conditional instructions. The templates can be inserted in the procedure codes by means of drag&drop. If you insert a code template into your code, it is important to note that, for example, conditions in the templates are identified by "_XYZ_". You must replace these placeholders with the appropriate information.
Selection Dialogs
If WinCC tags or objects are used in the code, the following selection dialogs are available for use: Opens a tag selection dialog returns the selected tag name as the return value. Opens a tag selection dialog and returns the tag name with an associated reference. Opens a picture/object browser in which a picture/object can be selected whose name is then used for the return value. Opens a picture selection dialog for pictures and returns the picture name, with the server prefix if necessary.
Bookmarks
Bookmarks can be set in the code via the icons in the toolbar in order to find certain parts in the codes more easily. Sets a bookmark in the line where the cursor is currently located. Deletes all bookmarks in the active editing window. Jumps ahead to the next bookmark in the code. Jumps back to the last bookmark in the code.
See also
Structure of VBScript Files (Page97) Global Script Editor (Page30)
35
1.8.4
Purpose
In their default position, the toolbars are located below the menu bar, at the top of the VBS editor. The buttons arranged on the toolbars enable quick, easy access to the functions provided in Global Script and the action editor in Graphics Designer. Global Script/Graphics Designer provide the following toolbars:
"Standard" Toolbar
Button Function Creates a new project module (Global Script only) Creates a new standard module (Global Script only) Creates a new global action (Global Script only) Opens an existing action or existing module (Global Script only) Saves the content of the active editing window. This function is only available, when an editing window is open. After saving the display in the navigation window is refreshed. (Global Script only) Cuts the selected text and copies it to the clipboard. This function is only available, when text is selected. Copies the selected text to the clipboard. This function is only available, when text is selected. Pastes the contents of the clipboard at the location of the cursor. This function is only available, when the clipboard is not empty. Prints the contents of the active editing window as project documentation. This function is only available, when an editing window is open. Key combination <ALT+F1> <ALT+F2> <ALT+F3> <CTRL+O> <CTRL+S>
<CTRL+P>
36
<CTRL+Y>
37
Opens a picture/object browser in which a picture/ <CTRL+Q> object can be selected whose name is then used for the return value. Opens a picture selection dialog for pictures and returns the picture name, with the server prefix if necessary. <CTRL+B>
See also
Global Script Editor (Page30)
1.8.5
Introduction
If an action, procedure or a module is deleted in a script editor, the code and corresponding file are deleted in the project directory. Be careful only to delete procedures which are no longer used in other procedures or actions. If an action attempts to call in a procedure which no longer exists, the action is stopped in Runtime at the fault point. A non-existing reference in the code is not detected by the syntax check. Note Procedures can only be deleted within a module by deleting the code, not in the editor's navigation window.
Procedure
1. Open Global Script. 2. Select the action or module to be deleted in the navigation window.
38
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
3. Select the "Delete" command from the context menu. 4. To delete a procedure: Open the relevant module and delete the corresponding code in the editing window.
See also
Actions (Page21) Modules and Procedures (Page18) Global Script Editor (Page30)
1.9
1.9.1
Introduction
Projects and standard procedures can be programmed in WinCC using VBS: Project procedures can only be retrieved in the current project. Since procedures are stored in the project directory, they are automatically copied when a project is copied. Standard procedures can be called in by all computers linked to a project. When a project is copied onto another computer, the standard procedures must be copied into the corresponding directory on the target computer manually. The copied procedures are directly available for use in Runtime. The become visible in the editor when the view is updated. Apart from the procedures programmed by yourself, general VBS functions can also be used (e.g. Abs, Array,... Year). These general VBS functions can be invoked in the code using the "Function List" command from the context menu. In addition, WinCC provides the most popular instructions as code templates (e.g. If...Then, When...While). The code templates can be moved from the navigation window's Code Templates tab control directly into your code via drag&drop. If you insert a code template into your code, it is important to note that, for example, conditions in the templates are identified by "_XYZ_". You must replace these placeholders with the appropriate information.
Using Procedures
Procedures are used for the central creation and maintenance of codes which are to be implemented at several point in the configuration. Codes are written and saved in a procedure and the procedure is called in with the current parameters in actions or other procedures instead of repeatedly entering the same code. Procedures are created for repeated functionalities, e.g.
39
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
Calculations with different starting values (procedure with return value) Checking tag values (procedure with return value) Executing tasks (procedure with return value) This is linked to the following advantages: The code is only programmed once. Modifications are only made at one point, namely in the procedure, not in each action. The action code is shorter and, thus, remains clearer. Related procedures should be stored in modules in WinCC.
Procedures are loaded in Runtime when the calling action is executed. If a procedure (module) used in a picture is modified, the modification is applied the next time the picture is loaded. This means that a picture currently displayed only works with the modified procedure after the picture has been reloaded. If you change a standard procedure into a project procedure, and vice versa, you must save the pictures again which use this procedure.
40
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
Note Procedures can be used in actions in Global Script and Graphics Designer. In order to use a global tag defined in Global Script in an action in Graphics Designer, observe the following: In order that access can be made to the tag, it is necessary to call in the procedure in which the tag is defined. In order to use a global tag in picture-independent actions in Global Script, observe the following: In order that access can be made to the tag, at least one procedure in the module containing the tag must be called in at least one global action.
41
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
See also
Multiple Use of Procedures and Actions (Page23) Renaming a Procedure or Module (Page54) Saving a Procedure (Page52) Protecting a Module with a Password (Page51) Adding Module-related Information (Page49) Using Standard and Project Procedures (Page47) How to Write Procedure Codes (Page45) Creating a New Procedure (Page42) Examples of VBScript (Page734) Modules and Procedures (Page18)
1.9.2
Introduction
Standard projects and procedures can be programmed with Global Script in WinCC. The type of procedure is defined by the assignment to a project or standard module. The procedure to create standard or project procedures is identical. On creating a new procedure, WinCC automatically assigns a standard name "procedure#", in which case # represents a continuos number. If the procedure is edited in the editing window, assign the procedure a corresponding name via which the procedure can be called in an action later. The name appears in the navigation window when the procedure is saved.
42
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
Note Procedure names must be unique within a project. If a procedure with the same name already exists, the module is identified as syntactically incorrect. Module names can be used twice when the modules are stored in different directories. Global procedures (valid for the for entire project) can only be programmed Global Script. Procedures can be called via actions in Graphics Designer and picture-related procedures created in the declaration area of an action. Using a global action in Global Script, it is possible to create procedures directly in the code which are then only applicable for this action. An action must be programmed in order to call in a procedure.
Procedure
The following procedure describes the creation of a new procedure in Global Script: 1. Open Global Script. 2. In the navigation window, select the standard modules or project modules tab control according to whether a standard procedure or project procedure is to be created. 3. Open an existing module or create a new module using the menu commands "File" > "New" > "Project Module" or "File" > "New" > "Standard Module". 4. After having created a new module, the structure of a procedure without return value is already entered in the editing window:
5. Enter the procedure name direct in the code: Sub "Procedure name".
43
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
6. To insert one procedure in an existing module: Select the module in the navigation window and then select the "Insert New Procedure" context menu item. The dialog "New Procedure" is displayed:
7. Enter a procedure name and select whether the procedure should have a return value parameter. The definition of a tag for the return value is then entered in the code (Dim RetVal). 8. Confirm your settings with OK. Note A new procedure can also be entered directly in a module. In the case of procedures without return value, always begin with the instruction "Sub " and <Procedure Name> and conclude with "End Sub". In the case of procedures with return value, always begin with the instruction "Function " and <Procedure Name> and conclude with "End Function". The new procedure is displayed in the navigation window when the module is saved.
See also
Creating and Editing Procedures (Page39) Multiple Use of Procedures and Actions (Page23) Renaming a Procedure or Module (Page54) Saving a Procedure (Page52) Protecting a Module with a Password (Page51) Adding Module-related Information (Page49) Using Standard and Project Procedures (Page47) How to Write Procedure Codes (Page45) Modules and Procedures (Page18)
44
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
1.9.3
Introduction
Procedure codes are written in the Global Script editor window. The code of each procedure can call in other procedures via their procedure names. Procedures can be created with or without return values. Use the return value, e.g. to obtain information that the procedure has been executed successfully (e.g. 0 = fault, 1 = successfully executed). If a procedure (module) used in a picture is modified, the modification is applied the next time the picture is loaded. This means that a picture currently displayed only works with the modified procedure after the picture has been reloaded.
45
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
HMIRuntime object in this list because there is no direct access to the objects of Graphics Designer. Use the "Properties/Methods" context menu command to call in a list of possible properties and methods. The same lists can be called in with the key combination <CTRL + SPACEBAR> but according to the context of the script.
Code Templates
In the Code templates tab in the Navigation window of the Editor, you will find a selection of frequently used instructions, e.g. for loops and conditional instructions. The templates can be inserted in the procedure codes by means of drag&drop. If you insert a code template into your code, it is important to note that, for example, conditions in the templates are identified by "_XYZ_". You must replace these placeholders with the appropriate information.
Selection Dialogs
If WinCC tags or objects are used in the code, the following selection dialogs are available for use: Opens a tag selection dialog returns the selected tag name as the return value. Opens a tag selection dialog and returns the tag name with an associated reference. Opens a picture/object browser in which a picture/object can be selected whose name is then used for the return value. Opens a picture selection dialog for pictures and returns the picture name, with the server prefix if necessary.
Syntax Check
Global Script supports you by providing a syntax check which you can perform after the code has been created. Syntax errors in the code are displayed in the output window of the editor. You can move to the erroneous point in the code directly by double-clicking the error in the output window. Note The syntax check can only detect syntax errors in the code. Programming errors, such as missing references, only become visible in Runtime. You should therefore also always check your scripts in the Runtime environment.
46
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
Changing a Procedure
If a procedure is modified while Runtime is active, the modification becomes effective at the following times: Procedures called from actions or other procedures in pictures become active following a picture change. Procedures in Global Script become active directly after being called again.
Procedure
1. Open Global Script. 2. Open the module containing the procedure to be edited. 3. After double clicking on the procedure in the navigation window, the cursor skips to the beginning of the required procedure. 4. Edit the procedure. If you create a procedure with a return parameter, e.g. to program recurring evaluations or reviews, indicate the return value with "procedurename = RetVal" at the end of the procedure.
See also
How to Write Procedure Codes (Page45) Multiple Use of Procedures and Actions (Page23) Renaming a Procedure or Module (Page54) Saving a Procedure (Page52) Protecting a Module with a Password (Page51) Adding Module-related Information (Page49) Creating a New Procedure (Page42) Modules and Procedures (Page18) Creating and Editing Procedures (Page39)
1.9.4
Introduction
Use the drag&drop function in the navigation window or the context menu to insert a procedure in the current code. Project procedures can only be used within the current project, standard procedures are available for all projects on the computer. Procedures, once created, can be used in other projects or on other computers. To do this, copy the module containing the procedures in the appropriate project or standard directory.
47
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
Procedure
1. Open the procedure or action in which the procedure should be inserted. 2. Use the drag&drop function to move the procedure to be inserted from the navigation window to the correct position in the code. or 3. Place the cursor at the position in the code where you would like to insert teh procedure. 4. Mark the procedure in the navigation window with the mouse. 5. Choose pop-up menu command "Transfer Procedure Retrieval".
See also
Creating and Editing Procedures (Page39) Multiple Use of Procedures and Actions (Page23) Renaming a Procedure or Module (Page54) Saving a Procedure (Page52) Protecting a Module with a Password (Page51) Adding Module-related Information (Page49) How to Write Procedure Codes (Page45) Creating a New Procedure (Page42) Modules and Procedures (Page18)
48
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
1.9.5
Introduction
Related information can be added to each module in order to quickly recognize the functionality of the module or the procedures contained in it when edited at a later date. If several operators are involved in configuring a project, you should provide module-related information for your colleagues. When a new module is created, the creation date is entered in the module-related information automatically and is unchangeable. The Module is also assigned the version number 1.0. The version numbers can be individually assigned when editing a module. When a module is changed and saved, the current date of change is entered automatically and is unchangeable. The following information can be added: "Created by" "Changed by" "Comments" e.g. module functionality/procedures contained It is still possible to define a password for the module. Further information on assigning passwords is provided in "Protecting Modules with a Password".
Procedure
1. Open Global Script. 2. Select the module in which information is to be added in the navigation window.
49
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
3. Click the button "Info/Trigger" in the toolbar or choose the pop-up menu command "Info". The "Properties..." dialog appears.
4. Enter the required information. Note The "Info/Trigger" dialog can also be called if an open procedure is selected in the navigation window. The information stored in this dialog is always valid for the entire module and all the procedures contained in it.
See also
Multiple Use of Procedures and Actions (Page23) Renaming a Procedure or Module (Page54) Saving a Procedure (Page52) Adding Module-related Information (Page49) Using Standard and Project Procedures (Page47) How to Write Procedure Codes (Page45) Creating a New Procedure (Page42) Modules and Procedures (Page18) Creating and Editing Procedures (Page39)
50
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
1.9.6
Introduction
A module can be assigned a password to protect it from unauthorized access. The password is a part of the module-related information. Note If a module is protected by a password, all the procedures contained in it are also protected by the password.
Procedure
1. Open Global Script. 2. Select the module to be assigned a password in the navigation window. 3. Click the button "Info/Trigger" in the toolbar or choose the pop-up menu command "Info". The "Properties..." dialog appears.
4. Activate the check box "Password". The dialog "Enter Password" is displayed. 5. Enter a password and confirm it. 6. Confirm your settings with OK.
Result
If an attempt is made to open the module or a procedure contained in it, a prompt appears requesting the password.
Change Password
To change the password, open in the Properties dialog and click the "Change" button. Then enter the new password. NOTICE If you forget the module password, the module cannot be edited.
51
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
Note The "Info/Trigger" dialog can also be called if an open procedure is selected in the navigation window. The information stored in this dialog is always valid for the entire module and all the procedures contained in it.
See also
Multiple Use of Procedures and Actions (Page23) Renaming a Procedure or Module (Page54) Saving a Procedure (Page52) Adding Module-related Information (Page49) Using Standard and Project Procedures (Page47) How to Write Procedure Codes (Page45) Creating a New Procedure (Page42) Modules and Procedures (Page18) Creating and Editing Procedures (Page39)
1.9.7
Saving a Procedure
Introduction
Individual procedures are never stored but the module in which the procedure has been programmed. Before saving a module, check the code is syntactically correct. When saving a module, the procedures contained are automatically checked and, in the case of syntax errors, a prompt appears as to whether the module should be saved with the errors or not. In this way, for example, modules and procedures can be saved which are not fully programmed. Syntactically incorrect procedures do not run in Runtime. NOTICE If a module contains a syntactically incorrect procedure, the module can no longer be loaded. Procedures can no longer be called from the module.
52
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
Note The syntax check can only detect syntax errors in the code. Programming errors, such as missing references, only become visible in Runtime. Therefore, always check the scripts in the Runtime environment and use a debugger, if necessary, to detect and eliminate errors. Only syntactically correct modules are called in Runtime. A list of all the possible syntax errors is available in the Appendix under " Basic Principles of VBScript".
If a procedure is subjected to a syntax check prior to saving, any errors are displayed in the lower part of the editor window. Double click on an error line to access the error position in the code directly.
Use the "Save As" command to store the module under another name. Note that the new module is only displayed in the navigation window after updating the view.
Requirements
The procedure/module to be saved must be open in the editor window.
Procedure
1. Click the button "Syntax Check" in the toolbar. 2. If syntax errors appear in the output window, double click on the error line and correct the error in the code. Repeat steps 1 and 2 until the code is correct. 3. Save the module by clicking "Save" in the toolbar.
See also
Diagnostics (Page83) Multiple Use of Procedures and Actions (Page23) Saving a Procedure (Page52) Protecting a Module with a Password (Page51) Adding Module-related Information (Page49) Using Standard and Project Procedures (Page47) How to Write Procedure Codes (Page45) Creating a New Procedure (Page42) Modules and Procedures (Page18) Creating and Editing Procedures (Page39)
53
VBS for Creating Procedures and Actions 1.9 Creating and Editing Procedures
1.9.8
Introduction
Procedures and modules are renamed in the following cases: When a standard name (procedure# or Modul#), which was automatically assigned when the new module/new procedure was created, is changed to a self-explanatory name. When a module or procedure is copied in order, for example, to create a new module with similar content from an existing one. Please note that procedure names must be unique within a project. Procedure names which exist twice are issued as errors during the syntax check. Contrary to procedure names, the same name can be applied to modules when the modules are stored in different directories. Note The module name is always identical to the file name in the WinCC file system. If a module name is changed, e.g. in Windows Explorer, the new module name is taken over from Global Script in the navigation window.
Renaming Modules
1. Close the module to be renamed. 2. Select the module in the navigation window and choose the "Rename" option from the context menu. 3. Enter the new name in the navigation window. Module names are always unique at directory level and may not be used more than once.
54
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
See also
Multiple Use of Procedures and Actions (Page23) Saving a Procedure (Page52) Protecting a Module with a Password (Page51) Adding Module-related Information (Page49) Using Standard and Project Procedures (Page47) How to Write Procedure Codes (Page45) Creating a New Procedure (Page42) Modules and Procedures (Page18) Creating and Editing Procedures (Page39)
1.10
1.10.1
Introduction
When using VBS in WinCC, there is no differentiation between local (valid for entire project) and global (valid on all computers) actions, as opposed to C. A configured action is always valid globally. A copied action is available for use in Runtime following a restart or opening and saving the action. The become visible in the editor when the view is updated. VBS actions can be used in to make graphic objects and object properties dynamic in Runtime or to execute picture-independent actions. Note Please note that the object name length of objects made dynamic in Graphics Designer is limited to approx. 200 characters, and each special character used in an object name is converted to five characters in the script files. The special characters are represented by a four-place hexadecimal code behind the preceding X. If the name of an object made dynamic is too long, a corresponding error message appears. Further information is available in this help under "Structure of VBScript Files". NOTICE If you make an object property dynamic with a VBS action via the return value of a script, the value of the object property is written only if it has changed in relation to the last script run. It is not considered if the value had been changed from another location. Therefore it is illegal to change properties which have been made dynamic by VBS action via the return value from another location (e.g., other C scripts or VBS scripts).
55
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
if you do not observe this, wrong values can be the results.
56
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Executing Actions
An action can be assigned several triggers. The action is always executed when one of the triggering events occurs. Observe the following: Actions in Global Script cannot be executed simultaneously. The action triggered last is held in a queue until the action currently being performed is completed. When using Graphics Designer, cyclically and tag-driven actions cannot be triggered simultaneously. If the execution of a tag-driven action hinders the execution of a cyclic action, the cyclic action is executed when the tag-driven action has finished. The cyclic action is held in a queue during the non-execution phase. When the current action is completed, the cyclic action is executed with the normal cycle. In Graphics Designer, event-driven actions cannot be executed simultaneously. The action types mentioned do not prevent each other being executed: The execution of actions in Global Script has no influence on actions in Graphics Designer. In the same way, in Graphics Designer, the execution of cyclically or tag-driven actions has no effect on the execution of event-driven actions. Note Actions in pictures which are still running one minute after the picture has been deselected are terminated by the system. This is recorded in a logfile entry.
Locating Actions
All the actions used in a picture can be displayed by means of the picture properties. To do this mark the picture in WinCC Explorer and select the "Properties" context menu command. After double clicking on an entry, detailed information on the type of dynamics appears. It is also possible to display all the tags and pictures used in actions by means of the WinCC CrossReference. CrossReference can also be used for the to link tag connections of Graphics Designer actions easily. Note Use the standard formulations HMIRuntime.BaseScreenName = "Screenname" and HMIRuntime.Tags("Tagname") when addressing pictures and tags in your code in order to ensure that the pictures and tags are registered by the CrossReference.
57
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Display of Actions
If you save a syntactically incorrect action, it will be displayed in the navigation window with this adjacent symbol.
58
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
If you save a syntactically correct action without trigger, it will be displayed in the Global Script navigation window with this adjacent symbol. If you save a syntactically correct action with trigger, it will be displayed in the Global Script navigation window with this adjacent symbol. Note Actions can only be saved in the Graphics Designer if they have the correct syntax. If an action with errors should still be retained and exited, however, enter the comments.
See also
Structure of VBScript Files (Page97) Action and Procedure Names in the Debugger (Page99) How to Rename an Action (Page81) Saving Actions (Page67) Protecting an Action with a Password (Page66) How to add information to the action (Page64) How to Edit Actions (Page61) Creating a New Action (Page59) Triggers (Page69) Actions (Page21)
1.10.2
Introduction
When a new action is created, the editor automatically suggests a file name (Action#.bac), which can be changed. Actions can be configured in Global Script and Graphics Designer.
59
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Global Script is used to configure actions which can be executed, picture-independently, in Runtime. Open Global Script via WinCC Explorer. Graphics Designer is used to configure a new action, related to the properties of a graphic object, by clicking on the right mouse button in the "Dynamic" column of the Properties tab control and selecting VBS Action. An action, related to an event, is created in the same ways using the Events tab control. In both cases, the Action Editor of the Graphics Designer opens. Note The precise procedure for linking actions with graphic objects is described under the WinCC help topic "Dynamics".
Procedure
1. Open Global Script. 2. Activating the Actions Tab Control in the Navigation Window. 3. Click the adjacent button in the tool bar or choose the menu command "File" > "New" > "Action". A new action is opened in the editor window. The action appears in the navigation window after it has been saved.
Note When creating a new action, the "Option explicit" instruction is automatically entered in the declaration area and cannot be deleted. The instruction is necessary as it prevents errors caused by the incorrect notation of tags without declaration. The instruction requires that tags are always defined in your code with the "Dim" instruction. Do not use the "Option explicit" instruction in the code because it may cause Runtime errors.
See also
How to Rename an Action (Page81) Saving Actions (Page67) Protecting an Action with a Password (Page66) How to add information to the action (Page64) How to Edit Actions (Page61) Triggers (Page69) Creating and Editing Actions (Page55) Actions (Page21)
60
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
1.10.3
Introduction
An action is edited in the same way as a procedure in the editor window of the editor or in the Graphics Designer action editor. In order that an action can be executed in Runtime, it requires a trigger. Actions which are triggered by an event in Graphics Designer do not require the assignment of a trigger. If an action is modified while Runtime is active, the change is applied when the picture is reloaded (in the case of actions in Graphics Designer) or the next time the action is called (in the case of actions in Global Script). Note A change in the code in Runtime cannot be applied when another action is being carried out at the same time. A procedure call can be inserted in the action by dragging the procedure from the editor's navigation window and dropping in the corresponding position of the code in the editor window. C scripts cannot be called in VBS actions.
61
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Note Always make sure that the procedures in the declaration area have correct syntax, i.e. with "Sub" - "End Sub". Do not create directly executable codes in the declaration area as this can cause Runtime errors. If global tags are used in the declaration area of actions Graphics Designer, note that the event-driven and cyclic/tag-driven actions are processed separately in Runtime. There is no synchronization of global tags between the two Runtime systems in Runtime. If synchronization of tags is required, configure these using the DataSet object or internal WinCC tags. When making definitions in the declaration area, pay attention to the structure of the Script files, as described under "Structure of VBScript files".
62
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
HMIRuntime object in this list because there is no direct access to the objects of Graphics Designer. Use the "Properties/Methods" context menu command to call in a list of possible properties and methods. The same lists can be called in with the key combination <CTRL + SPACEBAR> but according to the context of the script.
Code Templates
In the Code templates tab in the Navigation window of the Editor, you will find a selection of frequently used instructions, e.g. for loops and conditional instructions. The templates can be inserted in the procedure codes by means of drag&drop. If you insert a code template into your code, it is important to note that, for example, conditions in the templates are identified by "_XYZ_". You must replace these placeholders with the appropriate information.
Selection Dialogs
If WinCC tags or objects are used in the code, the following selection dialogs are available for use: Opens a tag selection dialog returns the selected tag name as the return value. Opens a tag selection dialog and returns the tag name with an associated reference. Opens a picture/object browser in which a picture/object can be selected whose name is then used for the return value. Opens a picture selection dialog for pictures and returns the picture name, with the server prefix if necessary.
Syntax Check
Global Script supports you by providing a syntax check which you can perform after the code has been created. Syntax errors in the code are displayed in the output window of the editor. You can move to the erroneous point in the code directly by double-clicking the error in the output window. Note The syntax check can only detect syntax errors in the code. Programming errors, such as missing references, only become visible in Runtime. Therefore, always check the scripts in the Runtime environment and use a debugger, if necessary, to detect and eliminate errors. The way to test scripts with a debugger is described in this documentation under the topics "Diagnostics" > "Testing with the Debugger".
63
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Procedure
1. Open Global Script. 2. Double click on the action on the Action tab control in the navigation window. 3. Edit the action.
See also
Using Global Tags in VBS (Page27) Testing with the Debugger (Page90) Structure of VBScript Files (Page97) How to Rename an Action (Page81) Saving Actions (Page67) Protecting an Action with a Password (Page66) How to Edit Actions (Page61) Creating a New Action (Page59) Triggers (Page69) Creating and Editing Actions (Page55) Actions (Page21)
1.10.4
Introduction
Related information can be added to every action in Global Script in order that the function of an action can be recognized at a later date when editing. If several operators are involved in configuring a project, you should provide action-related information for your colleagues. When a new action is created, the creation date is entered in the action-related information automatically and is unchangeable. The action is also assigned the version number 1.0. The version numbers can be individually assigned when editing an action. When an action is changed and saved, the current date of change is entered automatically and is unchangeable. The following information can be added: "Created by" "Changed by" "Comments:" e.g. functionality of the action It is also possible to define a password for the action. Further information on assigning passwords is provided in "Protecting Actions with a Password".
64
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Note Additional information can only be made available actions in Global Script, not for actions in Graphics Designer.
Procedure
1. Open Global Script. 2. Open the action for which information should be added. 3. Click the button "Info/Trigger" in the toolbar or choose the pop-up menu command "Info". The "Properties..." dialog appears.
65
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
See also
How to Rename an Action (Page81) Saving Actions (Page67) Protecting an Action with a Password (Page66) How to Edit Actions (Page61) Creating a New Action (Page59) Triggers (Page69) Creating and Editing Actions (Page55) Actions (Page21)
1.10.5
Introduction
An action in Global Script can be protected against unauthorized access by assigning a password to it. The password is a part of the action-related information. Note Only actions in Global Script can be assigned a password, not actions in Graphics Designer.
Procedure
1. Open Global Script. 2. Open the action to be protected by a password.
3. Click the button "Info/Trigger" in the toolbar or choose the pop-up menu command "Info". The "Properties..." dialog appears. 4. Select the "Password" check box. 5. Click the "Change" button. The "Enter Password" window opens. 6. Enter a password and confirm it. 7. Confirm your settings with OK.
Result
If an attempt is made to open the action, the system requests the password is entered.
66
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Change Password
To change the password, open in the Properties dialog and click the "Change" button. Then enter the new password. NOTICE If you forget the action password, the action cannot be edited.
See also
How to Rename an Action (Page81) Saving Actions (Page67) How to add information to the action (Page64) How to Edit Actions (Page61) Creating a New Action (Page59) Triggers (Page69) Creating and Editing Actions (Page55) Actions (Page21)
1.10.6
Saving Actions
Introduction
Before an action can be run in Runtime, it must be saved. Save an action as any other Windows file using the "File" > "Save" commands or the corresponding icon. Note Actions in Graphics Designer are automatically applied on closing the action editor with the picture. Functions can only be saved in the Graphics Designer if they have the correct syntax. If an action with errors should still be retained and exited, however, enter the comments. A list of all the possible syntax errors is available in the Appendix under " Basic Principles of VBScript". In order to save an action under a different name, e.g. to use an action as a basis for another action, use the "Save As" command. Note that, when using "Save As", only the file name is changed and not the action name.
67
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Prior to Saving
Before saving an action, check the code is syntactically correct. The syntax errors in the code are displayed in the output window of Global Script. Double click on an error line to access the error position in the code directly. Note The syntax check can only detect syntax errors in the code. Programming errors, such as missing references, only become visible in Runtime. Therefore, always check the scripts in the Runtime environment and use a debugger, if necessary, to detect and eliminate errors. If actions are saved without running a syntax check beforehand, the editor comments that a syntactically incorrect action will be saved which cannot subsequently be run in Runtime. Syntactically incorrect actions are displayed with the adjacent icon in the navigation window.
Procedure
1. Click the button "Syntax Check" in the toolbar. 2. If errors are displayed in the lower part of the editor window, double click on the error line and correct the error in the code. Repeat steps 1 and 2 until the code is correct. 3. Save the action by clicking "Save" in the toolbar.
See also
Actions (Page21) How to Rename an Action (Page81) Protecting an Action with a Password (Page66) How to add information to the action (Page64) How to Edit Actions (Page61) Creating a New Action (Page59) Triggers (Page69) Creating and Editing Actions (Page55)
68
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
1.10.7
1.10.7.1
Triggers
Triggers
Trigger types
The following trigger types are available:
Acyclic triggers
They consist of the specification of date and time. The action specified by such a trigger is performed once at the date and time specified.
Cyclic triggers
They consist of the specification of a time interval and start time. The following types of cyclic triggers are available: Default cycle. The start of the first time interval coincides with the start of Runtime. The length of the interval is determined by the cycle. Hourly. The start of the interval is specified as minute and second. The length of the interval is an hour. Daily. The start of the interval is specified by the time (hour, minute and second) festgelegt. The length of the interval is a day. Weekly. The start of the interval is specified by the day of the week (Monday, Tuesday, etc.) and the time. The length of the interval is a week.
69
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Monthly. The start of the interval is specified by the day and time. The length of the interval is a month. Annual. The start of the interval is specified by the day, month and time. The length of the interval is a year. Time-controlled triggers are used for actions Global Script and for actions to make graphic objects dynamic.
Tag triggers
They consist of one or more specified tags. The action associated with such a trigger is performed each time a change in the value of one of these tags is detected. How the tag values are queried may be customized for each tag. Select from the following modes: Cyclic query of the tag value: Specify a standard cycle. The tag value is queried at the defined intervals (e.g. every 2 seconds). The action is triggered when the system detects a change of the tag value. Depending on the size of the cycle, it is possible that the tag value is changed but it is not detected by the system. If, for example, a cycle of 5 minutes has been set, the tag value may change several times within the 5 minute period but only the value set when the next query is made is detected. The value changes between the two queries are not registered. Changes in the tag value: Each change in the tag value is detected by the system. The action is executed each time the tag value changes. Tag triggers are used for actions Global Script and for actions to make graphic objects dynamic.
Event-driven
When an action is configured related to an event on a graphic object, the action is triggered when a specific event has occurred, e.g. following a mouse click or the change of the background color due to another action.
Animation cycle
As of WinCC V7.0, the "animation cycle" trigger art is available for the dynamization of objects with VBS. The animation cycle allows you to switch actions on and off in Runtime and to change the time, in which the trigger is executed. You can find additional information in the "" section.
70
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
71
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
If a tag trigger is used, configure the "Upon Change" cycle to start as seldom as possible. This query cycle causes the tag to trigger the action following every change. This causes high system loads.
See also
Actions (Page21) How to delete a trigger (Page79) How to change a trigger (Page78) How to add a trigger of the type "Tag" (Page76) How to add a trigger of the type "Timer" (Page74) Creating and Editing Actions (Page55)
72
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
1.10.7.2
Animation trigger
Animation trigger
As of WinCC V7.0, the "animation cycle" trigger art is available for the dynamization of objects with VBS. The animation cycle allows you to switch actions on and off in Runtime and to change the time, in which the trigger is executed. The following cycles are possible:
Name CycleTime125ms CycleTime250ms CycleTime500ms CycleTime1s CycleTime2s CycleTime5s CycleTime10s CycleTime1min CycleTime5min CycleTime10min CycleTime1h Cycle 125 ms 250 ms 500 ms 1s 2s 5s 10 s 1 min 5 min 10 min 1h Name CycleUser1 CycleUser2 CycleUser3 CycleUser4 CycleUser5 CyclePicture CycleWindow Cycle User cycle 1 User cycle 2 User cycle 3 User cycle 4 User cycle 5 Picture cycle Window Cycle
You use the trigger by writing an action and using the "animation cycle" trigger type. This action can be activated or deactivated in Runtime with the "ActivateDynamic" and "DeactivateDynamic" methods. The methods are described in the VBS reference of the WinCC Information System. The correct syntax of the methods deviates from the description in the VBS reference and is shown in the following two examples. With a VBS action at the determined property "Position X" (left), the rectangle is shifted 5 pixels to the right. Select the "animation cycle" event in the action as the trigger. Enter the following as the VBS action in the "Left" property: item.Left = item.Left + 5 You can switch the action on and off at the property "Position X" with the following VBS actions. The trigger is switched on in Runtime with the "ActivateDynamic" method: Dim obj Set obj = ScreenItems.Item("Rectangle1") obj.ActivateDynamic "Left", "CycleTime1s" The trigger is switched off in Runtime with the "DeactivateDynamic" method: Dim obj Set obj = ScreenItems.Item("Rectangle1") obj.DeactivateDynamic "Left" Note The WinCC tags remain requested even when the trigger is switched off.
73
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
1.10.7.3
Introduction
"Timer" type triggers execute an action at a certain time. "Timer" type triggers can be cyclic or acyclic triggers. Acyclic triggers Trigger an action once at the configured time. Cyclic triggers Trigger an action at regular intervals. The time interval and start time for the time must be triggered. If a standard cycle is selected as the cyclic trigger, the start time is always the start of Runtime. User-specific cycles can also be selected as standard cycles. Note Cyclic triggers guarantee a high updating rate of the system but require high system loads. Choose cyclic triggers only for those actions, where the update is very important. With high system loads, some actions may not be executable. "Timer" type triggers are used to make the properties in Graphics Designer dynamic and execute global actions.
Procedure
1. Open the action. 2. Click the button "Info/Trigger" in the toolbar or choose the pop-up menu command "Info". The "Properties..." dialog appears.
3. Select the "Triggers" tab control. 4. Select the "Timer" trigger and then select the trigger type to be created: cyclic or acyclic. 5. Click on the "Add" button. The "Add Trigger" dialog appears.
74
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
6. If the "acyclic" trigger type has been selected: Enter a relevant trigger name and define the time at which the action should be executed.
7. If the "cyclic" trigger type has been selected: Enter a relevant trigger name and define the start time at which the action should be executed for the first time. Enter a cycle at which the action should be repeated. Click OK to confirm your entries. Note An action can be assigned several triggers. The action is always executed when one of the triggering events occurs.
See also
How to delete a trigger (Page79) How to add a trigger of the type "Tag" (Page76) Triggers (Page69) Creating and Editing Actions (Page55) Actions (Page21)
75
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
1.10.7.4
Introduction
"Tag" type triggers execute an action following the change of a tag value. Any internal or external tag stored in WinCC can be used as a trigger tag. Actions with tag triggers can be executed at the following times: On change of tag: The action is executed each time the tag value changes. Since this setting causes a very high system utilization, the updating rate should be set as low as possible. Query the tag status according to standard cycle (including user cycles): Define a cycle in whose intervals the tag value should be queried. The action is only executed when the tag value has changed when queried. When the query status is a large value, it is possible that the tag value changes but it is not detected by the system. In this case the action will not be performed. If an action is linked with several tags, the action is executed when one of the tag values changes.
Procedure
1. Open the action. 2. Click the button "Info/Trigger" in the toolbar or choose the pop-up menu command "Info". The "Properties..." dialog appears.
3. Select the "Triggers" tab control. 4. Select "Trigger" as the tag. 5. Click on the "Add" button. The "Add Trigger" dialog appears.
76
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
6. Enter the name of the tag to be used as the trigger or click the button beside the "Tag Name" field in order to select a tag from the tag selection dialog.
7. Double click on the "Standard cycle" field to open the selection dialog for the tag update cycle:
77
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
See also
How to delete a trigger (Page79) How to add a trigger of the type "Tag" (Page76) How to add a trigger of the type "Timer" (Page74) Triggers (Page69) Creating and Editing Actions (Page55) Actions (Page21)
1.10.7.5
Introduction
A defined trigger can be modified at any time, even during Runtime.
Procedure
1. Open the action whose triggers should be modified. 2. Click the button "Info/Trigger" in the toolbar or choose the pop-up menu command "Info/Trigger". The "Properties..." dialog appears. Alternatively, call in the dialog without executing the action by double clicking on the trigger in the navigation window.
78
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
4. Select the trigger to be modified and click the "Change" button.
See also
Triggers (Page69) How to delete a trigger (Page79) How to add a trigger of the type "Tag" (Page76) How to add a trigger of the type "Timer" (Page74) Creating and Editing Actions (Page55) Actions (Page21)
1.10.7.6
Introduction
Defined triggers can be deleted at any time. Triggers can also be deleted during Runtime. If a trigger is deleted during Runtime, it takes effect after saving the action.
79
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
Note Actions without trigger are not executed in Runtime. None of the actions which used the deleted trigger are executed any longer.
Procedure
1. Open the Global Script Editor or the Graphics Designer action editor. 2. Open the action. 3. Click the button "Info/Trigger" in the toolbar or choose the pop-up menu command "Info". The "Properties..." dialog appears.
4. Select the "Triggers" tab control. 5. Select the trigger to be deleted and click the "Delete" button.
6. The trigger is deleted immediately. Note Triggers can also be deleted directly in the Global Script navigation window using the "Delete" command in the context menu.
80
VBS for Creating Procedures and Actions 1.10 Creating and Editing Actions
See also
Actions (Page21) How to change a trigger (Page78) How to add a trigger of the type "Tag" (Page76) How to add a trigger of the type "Timer" (Page74) Triggers (Page69) Creating and Editing Actions (Page55)
1.10.8
Introduction
Actions can be renamed in Global Script. When an action is renamed, the action name and file name are changed. The action to be renamed must not be open in the editor window.
Procedure
1. Open Global Script. 2. Select the name of the action to be renamed in the editor's navigation window. 3. Select the "Rename" command from the context menu. 4. Enter a new name for the action with the extension *.bac.
See also
Protecting an Action with a Password (Page66) Saving Actions (Page67) How to add information to the action (Page64) How to Edit Actions (Page61) Creating a New Action (Page59) Triggers (Page69) Creating and Editing Actions (Page55) Actions (Page21)
81
VBS for Creating Procedures and Actions 1.11 Activating Global Actions in Runtime
1.11
Introduction
Scripts defined in Global Script are always executed when the configured trigger occurs. Scripts in the graphical Runtime system are executed when the picture is called in and the configured event or trigger occurs. In order that the picture-independent, Global Script global actions can be executed, the Global Script Editor must be registered in the startup list of the Runtime computer.
Procedure
1. Select the "Properties" command in the computer's context menu WinCC Explorer. The "Computer properties" dialog will open. 2. Click on the "Startup" tab 3. Activate Global Script Runtime.
82
See also
Creating and Editing Actions (Page55) Creating and Editing Procedures (Page39) VBScript Editors (Page28) Using Visual Basic Script in WinCC (Page14)
1.12
1.12.1
Diagnostics
Diagnostics
Introduction
If the scripts are executed and tested in Runtime, the Diagnostics window can be used to display an analysis quickly.
Diagnostics Tools
WinCC provides a range of tools with which to analyze the behavior of actions in Runtime: The GSC Runtime and GSC Diagnostics application windows Use of a debugger
83
Debugger
In order to test the scripts in Runtime, a debugger can be used instead of the Diagnostics window. The utilization of the Microsoft Script Debugger is described in chapter "Testing with the Debugger". The Microsoft Script Debugger is located in the Microsoft Download-Center under the following URL: http://www.microsoft.com/downloads/Search.aspx?displaylang=en (http:// www.microsoft.com/downloads/Search.aspx?displaylang=en) Use the "Search" field to search for "Script Debugger" and select the required download.
See also
Testing with the Debugger (Page90) GSC Runtime (Page87) GSC Diagnostics (Page84) Microsoft Download Center (http://www.microsoft.com/downloads/Search.aspx? displaylang=en)
1.12.2
1.12.2.1
GSC Diagnostics
GSC Diagnostics
Introduction
GSC Diagnostics displays the chronological sequence of calls of the trace methods contained in the actions in the Diagnostics window. This also applies to Trace instructions in procedures which are called in actions. The targeted implementation of Trace instructions, e.g. for the output of tag values, enables the progress of actions and the procedures called in them to be traced.
Application
In order to use GSC Diagnostics, insert a GSC Diagnostics type application window in a process screen. The GSC Diagnostics attributes can be used to control the appearance of the GSC Diagnostics window. In the case of a picture change, the content of the GSC Diagnostics window is deleted. Note Messages are also displayed in the "GSC Diagnostics" window when the debugger is activated.
84
See also
GSC Diagnostics Toolbar (Page86) GSC Diagnostics Attributes (Page86) Inserting the GSC Diagnostics Window into a Picture (Page85)
1.12.2.2
Introduction
In order to use GSC Diagnostics, insert a GSC Diagnostics process screen. The process screen can be an existing picture or a picture which serves customized diagnostics purposes. GSC Diagnostics cannot be inserted directly in the process screen as an application but is inserted as an application in an application window. In this case, the application window is a component part of the process screen.
Requirements
Graphics Designer has been started and the process screen is open.
Procedure
1. Use the "Smart Objects" object palette to insert the "Application Window" in the picture. 2. Select the "Global Script" option from the "Window Contents" dialog and confirm the selection with "OK". 3. Select the "GSC Diagnostics" option from the "Templates" dialog. 4. Confirm the selection with OK in order to insert the Diagnostics window.
See also
GSC Diagnostics Toolbar (Page86) GSC Diagnostics Attributes (Page86) GSC Diagnostics (Page84)
85
1.12.2.3 Overview
GSC Diagnostics has attributes which affect the appearance of the GSC Diagnostics window in Runtime. These relate to the geometric attributes, particularly to the following: Display: This attribute defines whether the window should be visible or hidden. The attribute can be made dynamic with the name Visible. Sizeable: This attribute defines whether the size of the window should be changeable in Runtime. Movable: This attribute defines whether the window should be moveable or not during Runtime. Border: This attribute defines whether the without is provided with a border. If the window has a border, its height and width can be modified in Runtime. Title: This defines whether the window has a title bar. Can be maximized: This attribute defines whether the title bar should contain the button to maximize the window. Can be closed: This attribute defines whether the title bar should contain the button to close the window. Foreground: This attribute defines whether the window should always be in the foreground.
See also
GSC Diagnostics Toolbar (Page86) Inserting the GSC Diagnostics Window into a Picture (Page85) GSC Diagnostics (Page84)
1.12.2.4 Overview
The GSC Diagnostics toolbar enables the output in the diagnostics window to be controlled and to save, print and open window content:
1: Delete the content of the diagnostics window 2: Stop the window being updated 3: Activate the window being updated 4: Opens a text file in the window
86
See also
GSC Diagnostics Attributes (Page86) Inserting the GSC Diagnostics Window into a Picture (Page85) GSC Diagnostics (Page84)
1.12.3
1.12.3.1
GSC Runtime
GSC Runtime
Introduction
GSC Runtime is a window which displays the dynamic behavior of all Global Script actions in Runtime. In addition, GSC Runtime can also be used during Runtime to influence the execution of each individual action and provide access to the Global Script editor.
Actions
C actions and VBS actions are differentiated in the GSC Runtime window: Symbolizes a C action Symbolizes a VBS action
The following information is issued: Action name: The name of the action ID: Action ID. They are used internally by the system. GSC Runtime supplies the corresponding action name together with the Action ID. The link between ID and action name is only valid until Runtime is stopped or, during Runtime, until an action is saved. Status: Provides information on the current status of the action. Refer to the table below for the possible statuses. Activation Interval: The time in the form Hour:Minute:Second, which should elapse between the action being called. Return Value: The return value of the action Started On: Date and time the current action was started Next Start: Date and time the action will be started again Error message: Contains the error text in the case of an error
87
Actions Status
Possible action status: Action was activated. Action was deactivated Action was stopped. Action in progress Error logging on the action! Error executing the action!
Pop-Up Menu
The following functions are available for every action in the pop-up menu: Log off: The relevant action will not be executed again when the current execution has finished. Log on: The relevant action will be executed again when the next trigger event occurs Start: The relevant action will be executed once. Edit: The relevant action will be opened in the Global Script editor for editing. Runtime will remain active. If the edited action is compiled (when necessary) and saved the changes will be applied by the Runtime system immediately. The option of opening the pop-up menu for every action can be controlled by assigning an authorization. In order to use GSC Runtime, insert a GSC Runtime type application window in a process screen. The GSC Runtime attributes can be used to control the appearance of the GSC Runtime window. Note Updating the GSC Runtime window increases the system load. The system load is dependent on how many actions are visible in the window. The system load can be lowered by reducing the height of the window so that fewer lines are visible.
See also
Inserting the GSC Runtime Window into a Picture (Page88) GSC Runtime Attributes (Page89)
1.12.3.2
Introduction
In order to use GSC Runtime, insert a GSC Runtime process screen. The process screen can be an existing picture or a picture which serves customized diagnostics purposes. GSC
88
Requirements
Graphics Designer has been started and the process screen is open.
Procedure
1. Use the "Smart Objects" object palette to insert the "Application Window" in the picture. 2. Select the "Global Script" option from the "Window Contents" dialog and confirm the selection with "OK". 3. Select the "GSC Runtime" option from the "Templates" dialog. 4. Confirm the selection with OK in order to insert the Diagnostics window.
See also
GSC Runtime (Page87) GSC Runtime Attributes (Page89)
1.12.3.3 Overview
GSC Runtime has attributes which affect the appearance of the GSC Runtime window in Runtime. These relate to the geometric attributes, particularly to the following: Display: This attribute defines whether the window should be visible or hidden. The attribute can be made dynamic with the name Visible. Sizeable: This attribute defines whether the size of the window should be changeable in Runtime. Movable: This attribute defines whether the window should be moveable or not during Runtime. Border: This attribute defines whether the without is provided with a border. If the window has a border, its height and width can be modified in Runtime. Title: This defines whether the window has a title bar. Can be maximized: This attribute defines whether the title bar should contain the button to maximize the window. Can be closed: This attribute defines whether the title bar should contain the button to close the window. Foreground: This attribute defines whether the window should always be in the foreground.
89
See also
GSC Runtime (Page87) Inserting the GSC Runtime Window into a Picture (Page88)
1.12.4
1.12.4.1 Overview
A debugger can be used to test the VBScripts in Runtime, e.g.: Microsoft Script Debugger (runs with Windows 2000 and Windows XP) Debugger "InterDev" (contained in scope of installation material supplied with Developer Studio ) Microsoft Script Editor (MSE) Debugger (contained in material supplied with Microsoft Office) The following description relates exclusively to handling the Microsoft Script Debugger.
90
See also
Principles of Debugging (Page93) Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Processing Scripts Step-by-Step (Page102) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) How to Activate the Debugger (Page91) Diagnostics (Page83) Microsoft Download Center (http://www.microsoft.com/downloads/Search.aspx? displaylang=en)
1.12.4.2 Principle
There are several ways of activating the debugger: Automatic activation of the debugger when an error occurs in Runtime. Opening an error box in Runtime via which the debugger can be activated. Starting the debugger from the Start menu and opening a running Runtime scripts.
Requirements
The Microsoft Script Debugger must be installed on the configuration computer.
Procedure
The following procedure describes the first two points, activating the debugger in WinCC. 1. In the computer's pop-up menu in WinCC Explorer, select the command "Properties". The "Computer Properties" dialog appears. 2. Select the "Runtime" tab control.
91
4. Select "Start debugger" when the debugger should be started directly following an error in the Runtime. 5. Select "Display Error Dialog", if you do not want to start the Debugger directly but wish to display an error dialog with information about the error. The debugger can be started from the error box by means of a button. 6. Click OK to confirm your entries.
92
See also
How to Set Bookmarks in Scripts (Page105) Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Processing Scripts Step-by-Step (Page102) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) Principles of Debugging (Page93) Testing with the Debugger (Page90) Diagnostics (Page83)
1.12.4.3
Principles of Debugging
Introduction
The Microsoft Script Debugger can be used to debug the VBScripts. The Microsoft Script Debugger can be used to: View the script source code to be debugged Step-by-step processing of the scripts to be checked Display and modify tag and property values View and monitor the script progress Note Please note that the code displayed in the debugger is write-protected. The code cannot be changed directly in the debugger but only test the necessary changes.
Error types
A distinction is made between the following types of error by the debug:
Syntax errors
Syntax errors occur, for example, when a key word is written incorrectly or a parenthesis is not closed. When a syntax check from WinCC is used, syntax errors can be excluded before testing the scripts in Runtime. In principle, only syntactically correct scripts can be saved in Graphics Designer. The WinCC syntax check also checks:
93
Runtime error
A Runtime error occurs when an attempt is made to execute an invalid/erroneous action, e.g. because a tag has not been defined. In order to intercept Runtime errors, use the "On Error Resume Next" command in the VBScript. The command causes the subsequent command to be executed following a Runtime error. The error code can subsequently be checked using the Err object. In order to deactivate the processing of Runtime errors in the script, use the "On Error Goto 0" command.
Logical errors
The debugger is particularly helpful in clearing up logical errors. A logical error occurs when an unexpected result is received because, for example, a condition was incorrectly checked. To clear logical errors, go through the scripts step-by-step in order to detect the part which does not function properly.
Basic Procedure
When an error has occurred and the debugger is open, the script appears in a window, writeprotected. It is possible to navigate through the script document, set breakpoints, execute the script again in Runtime and to process the script step-by-step. The most important steps for successful debugging of the scripts are described under "Processing Scripts Step-by-Step". The source codes of the scripts cannot be edited directly in the scripts. When an error has been detected, the error can be corrected in the original script in WinCC, e.g. load the picture again and update it in the debugger. Note Tips and tricks for debugging, frequently occurring error codes and other information is available in the Microsoft Script Debugger online help.
94
See also
Testing with the Debugger (Page90) Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Processing Scripts Step-by-Step (Page102) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) How to Activate the Debugger (Page91) Diagnostics (Page83)
1.12.4.4
Introduction
The Microsoft Script Debugger offers several components which assist in debugging:
"Command Window"
The "Command Window" is called in using the "View" > "Command Window" menu commands. While a script is running in Runtime, the "Command Window" of the debugger can be used, for example, to compile and modify values of tags and properties in the script currently running. Changes made in the "Command Window" are effected directly in the running script so that planned changes can be tested immediately. The following actions can be executed in the "Command Window": Enter commands: Commands can be entered and executed directly in VBScript. Change tag values: Tag values can be compiled and modified directly in the "Command Window". This relates to both tags in the current script as well as global tags. Modify properties: It is possible to read and write the properties of all objects in the current script context. The "Command Window" can always be used when a script has reached a breakpoint or a skip has been made from a breakpoint to other commands.
95
See also
Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Processing Scripts Step-by-Step (Page102) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Principles of Debugging (Page93) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
96
1.12.4.5 Principle
In order not to hinder the simultaneous processing of cyclic and event-driven scripts in the graphical Runtime system, the event-driven actions and cyclic/tag-driven actions are strictly separated during processing. In this way, a cyclic action, for example, cannot hinder the execution of an action initiated by clicking a button. To ensure this, the event-driven actions and the cyclic/tag-driven actions are stored in separate script files when saving a picture. If a global picture section has been defined in actions in Graphics Designer, this is copied into both scripts. In the same way, modules which are used in an action are also copied in both script files. If a tag from a module should be used, the corresponding module must be called in. Otherwise, the module is not copied in the script file and an error is generated. Note Since the two script files are handled separately, they have no common data area. Therefore, there is no synchronization of global tags between the two script files. If synchronization is required, implement this using the DataSet object or internal WinCC tags.
97
Note Please note that the actions and procedures of the graphic Runtime system are not displayed with the action name in the script file under which it was saved in WinCC. The name conventions for actions and procedures in the script files sate described in "Action and Procedure Names in the Debugger".
See also
How to Activate the Debugger (Page91) Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Processing Scripts Step-by-Step (Page102) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Components of the Microsoft Script Debuggers (Page95) Principles of Debugging (Page93) Testing with the Debugger (Page90) Diagnostics (Page83)
98
1.12.4.6
Keyboard events
Object events
Events on properties
Picture events
99
See also
Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Processing Scripts Step-by-Step (Page102) Selecting a Script for Editing (Page100) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) Principles of Debugging (Page93) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
1.12.4.7
Introduction
If the Microsoft Script Debugger is called from the Windows Start menu instead of automatic activation using WinCC, scripts which are currently running can be called in for editing in Runtime.
Prerequisite
Runtime is activated, the picture to be debugged is active.
100
What to do
1. Start the debugger from the Windows Start menu ("Start" > "Programs" > "Options" > "Microsoft Script Debugger"). 2. Activate the "View" > "Running Documents" commands from the menu bar. The "Running Documents" window is opened. This window displays all the scripts currently running in WinCC Runtime, separated according to scripts, from Global Script ("Global Script Runtime") and scripts from the graphical Runtime system ("PDLRT").
The example above, "Startbild.pdl" is active and only event-driven scripts are available in the start picture. 3. Double click on the script document in the "Running Documents" window that is to be debugged. The script document is opened "read-only" in the Debugger window.
See also
Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Processing Scripts Step-by-Step (Page102) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) Principles of Debugging (Page93) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
101
1.12.4.8
Introduction
The Microsoft Script Debugger can be used to process the scripts step-by-step in order, for example, to locate logical errors systematically. The effect of each individual script line can be tested in Runtime.
102
See also
Principles of Debugging (Page93) Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
1.12.4.9
Setting Breakpoints
Introduction
Breakpoints can be set in a script to stop at specific points when processing it and to start the debugger. Set a breakpoint in front of a line, for example, which you suspect contains a script error. It is possible to: Set breakpoints at specific lines to locate logical errors in the script step-by-step. Set a breakpoint and call the debugger before the next line in the script is processed. These procedure is used, for example, for events such as "Change picture". When a script file is updated in the debugger, all the breakpoints are lost. If a breakpoint is set in one of the script files "<Bildname>.pdl_trigger" or "<Bildname>.pdl_event", all the trigger-driven or all event-driven procedures are stopped, respectively, in Runtime.
Requirements
Runtime is activated, the picture to be debugged is active.
103
4. Switch to WinCC Runtime and execute the action you wish to debug. The Debugger stops at the first breakpoint it finds in the script. The current line is displayed on a yellow background. The script can then be processed step-by-step.
See also
Deleting Breakpoints (Page104) Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Setting Breakpoints (Page103) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) Principles of Debugging (Page93) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
104
Procedure
1. Position the cursor in the line whose breakpoint is to be deleted. 2. Open the "Debug" menu and select the "Toggle Breakpoint" item or the icon toolbar. The next line will be displayed without a mark. Breakpoints" entry or the icon from the toolbar. from the
3. To delete all the breakpoints in a script, open the "Debug" menu and select the "Clear all
See also
Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Setting Breakpoints (Page103) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) Principles of Debugging (Page93) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
105
See also
Executing Script Commands (Page107) How to Determine and Modify Tag and Property Values (Page106) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) Principles of Debugging (Page93) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
1.12.4.12 How to Determine and Modify Tag and Property Values Introduction
While a script is running in Runtime, the "Command Window" of the debugger can be used, for example, to compile and modify values of tags or properties in the script currently running. It is possible, for example, to reset a process value for a script to zero without having to stop the process. Note If you wish to determine the name of a WinCC object in Runtime, click <CTRL+ALT+SHIFT> and position the mouse over the corresponding object. The picture name and object name then appears in a tooltip.
Requirements
The script runs in Runtime and the debugger is opened.
106
Procedure
1. Set at least one breakpoint in the current script. 2. Switch to WinCC Runtime and trigger an action which causes the script to be executed. The Debugger stops at the first breakpoint. 3. Open the "View" menu and activate the "Command Window" entry. The "Command Window" opens. 4. In order to determine the value of a tag or property, enter a "?" followed by a Space and the name of the tag or property whose value is to be determined, e.g. "?myTag". Press <RETURN> to execute the command. 5. In order to modify the value of a tag/property, assign a value in the VBS syntax.
See also
Principles of Debugging (Page93) Executing Script Commands (Page107) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
107
Requirements
The script runs in Runtime and the debugger is opened.
Procedure
1. Set at least one breakpoint in the current script. 2. Switch to WinCC Runtime and trigger an action which causes the script to be executed. The Debugger stops at the first breakpoint. 3. Open the "View" menu and activate the "Command Window" entry. The "Command Window" opens. 4. Enter the required command and press "ENTER". Note If a faulty command is entered in the Command window, no error message is issued in Runtime. The message "<Script Error> appears in the Command window instead.
See also
How to Determine and Modify Tag and Property Values (Page106) How to Set Bookmarks in Scripts (Page105) Deleting Breakpoints (Page104) Setting Breakpoints (Page103) Selecting a Script for Editing (Page100) Action and Procedure Names in the Debugger (Page99) Structure of VBScript Files (Page97) Components of the Microsoft Script Debuggers (Page95) Principles of Debugging (Page93) How to Activate the Debugger (Page91) Testing with the Debugger (Page90) Diagnostics (Page83)
1.13
Principle
Printing VBScripts
The actions and procedures configured in both Global Script and in Graphics Designer can be documented in WinCC.
108
Procedure
1. Open Global Script or Graphics Designer according to the scripts to be documented. 2. Configure the print job, if necessary, using the "Project Documentation - Setup" command. 3. Use the "View Project Documentation" command to preview the data to be printed. 4. Select the menu commands "File" > "Print Project Documentation" to print the data.
See also
Creating and Editing Actions (Page55) Creating and Editing Procedures (Page39) VBScript Editors (Page28) Using Visual Basic Script in WinCC (Page14)
1.14
1.14.1
VBS Reference
VBS Reference
109
110
Objects
Objects and lists are provided for access to all the objects in the graphic Runtime systems: Graphic objects, pictures, layers and tags.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
111
Properties
The properties of the individual objects can be used to modify specific graphic objects and tags in Runtime , e.g. activating an operating element per mouse click or triggering a color change by modifying a tag value.
Methods
Methods, which are applied to individual objects, can be used to read tag values for further processing or display diagnostics messages in Runtime.
See also
ActiveScreen Property (Page278) Object Types of the ScreenItem Object (Page152) Methods (Page638) Properties (Page276) Objects and Lists (Page113) AlarmLogs Object (Page118) DataItem Object (Page119) DataLogs Object (Page121) DataSet-Objekt (List) (Page122) HMIRuntime Object (Page125) Layer Object (Page127) Layers Object (Listing) (Page129) ScreenItem Object (Page134) ScreenItems Object (List) (Page138) Screen Object (Page140) Screens Object (List) (Page143) Tag Object (Page146) Tags Object (List) (Page149) TagSet Object (List) (Page151) ActiveProject Property (Page278) ActiveScreenItem Property (Page279) Logging Object (Page130) Alarm object (Page115) Alarms object (list) (Page116) ProcessValue Object (Page131) ProcessValues Object (List) (Page132)
112
1.14.2
1.14.2.1 Overview
The objects and lists provided in WinCC object models enables access to graphic objects and tags in Runtime.
Example:
113
Access to Tags
In WinCC, tags are accessed directly in Runtime using the superordinate "HMIRuntime" object. Tag values can be read out or set anew.
Lists
Lists of WinCC object models behave in the same way as standard collections of VBS. Exception: The "Tags" list has no Enum function.
Available Objects
Alarm Alarms AlarmLogs DataItem DataLogs DataSet HMIRuntime Item Layer Layers Logging ProcessValues ProcessValue Project ScreenItem ScreenItems Screen Screens Tag
114
See also
ScreenItems Object (List) (Page138) TagSet Object (List) (Page151) Tags Object (List) (Page149) Tag Object (Page146) Screens Object (List) (Page143) Screen Object (Page140) ScreenItem Object (Page134) Layers Object (Listing) (Page129) Layer Object (Page127) Item Object (Page126) HMIRuntime Object (Page125)
1.14.2.2 Description
Alarm object
115
See also
Alarms object (list) (Page116)
1.14.2.3 Description
Usage
Using the "Alarms" list you can: Access a message in the list (Item method) Create a new alarm object (Create method) Read the alarm ID of the message (AlarmID attribute) Read the status of a message (State property) Read the time stamp of the message (Timestamp property) Generate an instance of the alarm object (Instance property) Read the name of the computer on which the message came (ComputerName property)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
116
Example
In the following example, a message is created and configured:
'VBS200 Dim MyAlarm Set MyAlarm = HMIRuntime.Alarms(1) MyAlarm.State = 5 'hmiAlarmStateCome + hmiAlarmStateComment MyAlarm.Comment = "MyComment" MyAlarm.UserName = "Hans-Peter" MyAlarm.ProcessValues(1) = "Process Value 1" MyAlarm.ProcessValues(4) = "Process Value 4" MyAlarm.Create "MyApplication"
See also
TimeStamp Property (Page556) ComputerName property (Page345) Context property (Page345) State property (Page524) AlarmID property (Page282) Instance property (Page402) Comment property (Page344) UserName property (Page606) ProcessValue property (Page485) Alarm object (Page115) ProcessValues Object (List) (Page132) Create method (Page644) Item Method (Page687)
117
1.14.2.4 Description
AlarmLogs Object
Using the object, swapped archive segments of Alarm Logging may be reconnected to Runtime, or previously swapped archive segments of Alarm Logging may be deleted again. Therein Archive segments to be swapped are copied to the common archiving directory of the WinCC project, or previously swapped archive segments are deleted in the common archiving directory. Using parameters you may control from where archive segments are to be swapped. You may also specify the time period over which archive segments are to be swapped or deleted. Archive segments are copied to the common archiving directory of the project. If an error occurred during the operation with archiving segments, the method used returns an error message. Additional information may be found under the subject heading "Error Messages from Database Area".
Usage
Previously swapped archive segments of Alarm Logging may be connected with Runtime ("Restore" method). Previously swapped archive segments of Alarm Logging may be deleted from the Runtime project ("Remove" method).
118
Example:
In the following example, archive segments from Alarm Logging are swapped and the return value is output as Trace.
'VBS187 HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.AlarmLogs.Restore("D: \Folder","2004-09-14","2004-09-20",-1) & vbNewLine
See also
Error Messages from Database Area (Page732) Restore Method (Page708) Remove Method (Page703) DataLogs Object (Page121) Logging Object (Page130)
1.14.2.5 Description
DataItem Object
The DataItem object is used to access the contents of the DataSet list. Values or object references are stored in the list as DataItem. Access uses the name under which the value was added to the list. Single access using an index is not recommended since the index changes during adding or deleting of values. The
119
Example:
The example shows how the value of 'Motor1' is output as Trace.
'VBS163 HMIRuntime.Trace "motor1: " & HMIRuntime.DataSet("motor1").Value & vbNewLine
The following example enumerates all DataItem objects of the DataSet list. Name and value are output as Trace.
'VBS164 Dim data For Each data In HMIRuntime.DataSet HMIRuntime.Trace data.Name & ": " & data.Value & vbNewLine Next
See also
Screen Object (Page140) HMIRuntime Object (Page125) DataSet-Objekt (List) (Page122) Value Property (Page610) Name Property (Page452)
120
1.14.2.6 Description
DataLogs Object
Using the object, swapped archive segments of Tag Logging may be reconnected to Runtime, or previously swapped archive segments of Tag Logging may be deleted again. Therein Archive segments to be swapped are copied to the common archiving directory of the WinCC project, or previously swapped archive segments are deleted in the common archiving directory. Using parameters you may control from where archive segments are to be swapped. You may also specify the time period over which archive segments are to be swapped or deleted. In addition, you may set the archive type ("Tag Logging Fast", "Tag Logging Slow", "Tag Logging Fast and Tag Logging Slow"). Archive segments are copied to the common archiving directory of the project. If an error occurred during the operation with archiving segments, the method used returns an error message. Additional information may be found under the subject heading "Error Messages from Database Area".
Usage
Previously swapped archive segments of Tag Logging may be connected with Runtime ("Restore" method). Previously swapped archive segments of Tag Logging may be deleted from the Runtime project ("Remove" method).
121
Example:
In the following example, fast archive segments from Tag Logging are swapped and the return value is output as Trace.
'VBS188 HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.DataLogs.Restore("D: \Folder","2004-09-14","2004-09-20",-1,1) & vbNewLine
See also
Error Messages from Database Area (Page732) Restore Method (Page708) Remove Method (Page703) AlarmLogs Object (Page118) Logging Object (Page130)
1.14.2.7 Description
DataSet-Objekt (List)
Using the DataSet object, data may be exchanged across several actions. A DataSet object is global and defined by the Screen object. Any VBS action may access the data.
122
Usage
Using the "DataSet" list, you may: Output or process (enumerate) all objects in the list. Output the number of elements contained ("Count" property). To process a specific object in the list ("Item" method). Add an object to the list ("Add" method). Remove a specific object from the list ("Remove" method). Remove all objects from the list ("RemoveAll" method). Access to list elements uses:
HMIRuntime.DataSet("Itemname")
In a picture, you may access the DataSet object of the picture by using:
DataSet("Itemname")
If upon access the stated name does not exist in the list, VT_Empty is returned and an Exception is triggered.
123
Example:
The example shows how to add a value to the list, how to read it and remove it. It make sense to perform this in several different actions.
'VBS162 HMIRuntime.DataSet.Add "motor1", 23 HMIRuntime.Trace "motor1: " & HMIRuntime.DataSet("motor1").Value & vbNewLine HMIRuntime.DataSet.Remove("motor1")
See also
DataItem Object (Page119) RemoveAll Method (Page707) Remove Method (Page703) Item Method (Page687) Count Property (Page346) Add Method (Page641)
124
1.14.2.8 Description
HMIRuntime Object
Usage
The "HMIRuntime" object can be used for the following, for example: Read or set the current Runtime language ("Language" property). Read or set the name of the current base picture ("BaseScreenName" property). Read the path of the active Runtime project ("ActiveProject" property). Access tags ("Tags" property). Access tags of a list ("DataSet" property). Exit Runtime ("Stop" method). Display messages in a diagnostics window ("Trace" method).
125
Example:
The following command terminates WinCC Runtime:
'VBS3 HMIRuntime.Stop
See also
Screens Object (List) (Page143) TagSet Object (List) (Page151) Tags Object (List) (Page149) Logging Object (Page130) DataSet-Objekt (List) (Page122) Visible Property (Page624) Trace Method (Page724) Tags Property (Page531) Stop Method (Page723) AlignmentLeft Property (Page283) Logging Property (Page431) Language Property (Page406) DataSet Property (Page351) CurrentContext Property (Page347) BaseScreenName Property (Page302) ActiveProject Property (Page278) ActiveScreen Property (Page278) MenuToolBarConfig Property (Page442) Alarms object (list) (Page116)
1.14.2.9 Description
Item Object
Usage
The "Item" object is used, for example, to address the properties of the object currently selected in Graphics Designer.
126
Example:
In the following example, a rectangle has been created. When the object has been selected, all the properties of the current object can be set a background color red:
'VBS195 Item.BackColor = RGB(255,0,0)
See also
Objects and Lists (Page113)
The layer object returns the result of access to the layers list.
Parent Object
Picture, in which the picture layer is.
Usage
Depending on certain events, the Layer object can be used to obtain access to the properties of a complete layer in order, for example, to hide or unhide a layer with operating elements according to the operator authorization.
127
Example:
In the following example, Layer 1 is set invisible:
'VBS4 Layers(2).Visible = vbFalse
See also
Layer Object (Page127) Visible Property (Page624) Parent Property (Page471) Name Property (Page452)
128
The Layers list enables access to all 32 layers of the graphical Runtime system.
Parent Object
Picture, in which the picture layer is.
Usage
The "Layers" list can be used to: Process all layers in the list ("_NewEnum" property). Count all layers contained in the list ("Count" property). Process a layer from the list ("Item" method). The properties represent default properties and methods of a list and are not described in detail in the WinCC documentation.
See also
Parent Property (Page471) Item Method (Page687) Count Property (Page346) Layer Object (Page127)
129
Using the object, swapped archive segments may be reconnected to Runtime, or previously swapped archive segments may be deleted again. Therein Archive segments to be swapped are copied to the common archiving directory of the WinCC project, or previously swapped archive segments are deleted in the common archiving directory. Using parameters you may control from where archive segments are to be swapped. You may also specify the time period over which archive segments are to be swapped or deleted. Archive segments are copied to the common archiving directory of the project. If an error occurred during the operation with archiving segments, the method used returns an error message. Additional information may be found under the subject heading "Error Messages from Database Area".
Usage
Previously swapped archive segments of Alarm Logging and Tag Logging may be connected with Runtime ("Restore" method). Previously swapped archive segments of Alarm Logging and Tag Logging may be deleted from the Runtime project ("Remove" method).
130
Example:
In the following example, archive segments from Alarm Logging and Tag Logging are swapped and the return value is output as Trace.
'VBS189 HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.Restore("D: \Folder","2004-09-14","2004-09-20",-1) & vbNewLine
See also
Error Messages from Database Area (Page732) DataLogs Object (Page121) AlarmLogs Object (Page118) Restore Method (Page708) Remove Method (Page703) DataLogs Property (Page351) AlarmLogs Property (Page283)
131
See also
ProcessValues Object (List) (Page132)
Usage
Using the "ProcessValues" list, you can: Edit a ProcessValue from the list ("Item" method) Display or edit all the objects in the list (_NewEnum attribute) Count all ProcessValues contained in the list (Count property) Read or set the values of the ProcessValue object (Value property) The properties represent default properties and methods of a list and are not described in detail in the WinCC documentation.
132
See also
Alarms object (list) (Page116) ProcessValue Object (Page131) Count Property (Page346) Value Property (Page610) Item Method (Page687)
Using the object, information may be requested from the current Runtime project. The project object is returned as the result of ActiveProject.
Usage
Using the "Project" object, you may: Read the path of the current Runtime project ("Path" property). Read the name of the current Runtime project, without path or file extension ("Name" property).
133
Example:
The following example returns name and path of the current Runtime project as Trace:
'VBS159 HMIRuntime.Trace "Name: " & HMIRuntime.ActiveProject.Name & vbNewLine HMIRuntime.Trace "Path: " & HMIRuntime.ActiveProject.Path & vbNewLine
See also
ActiveProject Property (Page278) Name Property (Page452) Path Property (Page473)
The ScreenItem object returns the result of access to the ScreenItem list.
Parent Object
Picture containing the picture element.
134
Usage
The ScreenItem object can be used to access the properties of graphic objects within a picture according to certain events. The "ScreenItem" object can be used for the following, for example: To activate or deactivate the visualization of an object ("Visible" property). To release or block the operation of an object ("Enabled" property). Change the width and height of an object ("Height" and "Width" properties). Change the position of an object ("Top" and "Left" properties). Read and define a layer in which a graphic object is located ("Layer" property). Read or define the name of a graphic object ("ObjectName" property). Define a reference to the superordinate picture ("Parent" property). Using the "Activate" method, the focus is set on the respective ScreenItem object. If the focus cannot be set because the object is non-operable, for example, an error is generated. Using error processing (On Error Resume Next), the error may be evaluated.
Round button
T-piece
WinCC FunctionTrendCon trol WinCC gauge control WinCC OnlineTrendContr ol WinCC OnlineTableContr ol WinCC push button control WinCC RulerControl WinCC slider control
Slider
Line
135
Detailed descriptions of the individual object types is provided under "ScreenItem Object Types". The ScreenItem object's "Type" property can be used to address the object types via the VBS Type ID.
Object properties
The "ScreenItem" object has different properties according to the features. The following section describes the properties which all ScreenItem object types have:
When a specific object type is addressed, certain further properties are added to the standard properties:
136
Example
In the following example, the radius of a circle is set to 2 in Runtime per mouse click:
Sub OnClick(ByVal Item) 'VBS5 Dim objCircle Set objCircle= ScreenItems("Circle1") objCircle.Radius = 2 End Sub
See also
Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) Parent Property (Page471) Left Property (Page423) Layer Property (Page408) Height Property (Page391) Enabled Property (Page360) Activate Method (Page639) Example: How to Read Tag Values (Page741) Example: Writing tag values (Page739) Properties (Page276) Objects and Lists (Page113) Object Types of the ScreenItem Object (Page152)
137
Parent Object
Picture containing the picture element.
Usage
The "ScreenItems" list can be used to: To display or edit all objects in the list (i.e. all objects within a picture) ("_NewEnum" property). To count the objects in a picture ("Count" property). To process a specific object in the list ("Item" method). The properties are standard properties and methods of a collection and are not described in detail in the WinCC documentation.
138
Example:
In the following example, the name of the objects in the current picture are displayed in a message box:
Sub OnClick(ByVal Item) 'VBS6 Dim lngAnswer Dim lngIndex lngIndex = 1 For lngIndex = 1 To ScreenItems.Count lngAnswer = MsgBox(ScreenItems(lngIndex).Objectname, vbOKCancel) If vbCancel = lngAnswer Then Exit For Next End Sub
See also
Count Property (Page346) Example: How to Read Tag Values (Page741) Example: Writing tag values (Page739) ScreenItem Object (Page134) Parent Property (Page471) Item Method (Page687)
139
The Screen object returns the result of access to the Screen list. All the properties and methods of this object can also be edited directly in Runtime. The "Screen" object represents a WinCC picture in Runtime and contains all the properties of the picture document and picture view. The "Screen" object also contains the following: A list of all the graphic objects contained in the addressed picture which can be addressed by the "ScreenItems" object. A list of all the layers contained in the addressed picture which can be addressed by the "Layers" object.
Parent Object
A picture window in which the Screen object is embedded. When the Screen object is the basic picture, the Parent object is not defined and set to zero.
Usage
The "Screen" object can be used for the following, for example: To release or block the operation of a screen ("Enabled" property). Change the width and height of a screen ("Height" and "Width" properties).
140
Example:
In the following example, the width of the first picture in Runtime is increased by 20 pixels:
'VBS7 Dim objScreen Set objScreen = HMIRuntime.Screens(1) MsgBox "Screen width before changing: " & objScreen.Width objScreen.Width = objScreen.Width + 20 MsgBox "Screen width after changing: " & objScreen.Width
Note Always enter picture names without the extension "PDL" for reasons of compatibility with future versions.
141
See also
ScreenItems Property (Page501) Refresh Method (Page702) Activate Method (Page639) Zoom Property (Page637) Width Property (Page626) Parent Property (Page471) ObjectSizeDeclutteringMin Property (Page457) ObjectSizeDeclutteringMax Property (Page457) ObjectSizeDeclutteringEnable Property (Page456) ObjectName Property (Page455) Layers Property (Page423) DataSet Property (Page351) LayerDeclutteringEnable Property (Page422) Height Property (Page391) FillStyle Property (Page369) FillColor Property (Page368) ExtendedZoomingEnable Property (Page367) Enabled Property (Page360) BackColor Property (Page295) ActiveScreenItem Property (Page279) AccessPath Property (Page276)
142
By using the picture window technique, several windows can be opened simultaneously in WinCC Runtime but only one basic picture exists. The "Screens" list enables access to all open pictures in Runtime using the picture names. The Screens list contains all invisible pictures.
Usage
When configuring a multi-user project, it is essential to specify the server prefix to access a picture which is not on the local computer. The "Screens" list can be used to: Display or edit all the pictures within the list ("_NewEnum" property). To count the pictures in a project ("Count" property). To process a specific picture in the list ("Item" method). Initiate new drawing of all visible pictures ("Refresh" method). The properties are standard properties and methods of a collection and are not described in detail in the WinCC documentation. The access code, required in the VBS environment in the HMIRuntime.Screens(<Zugriffsschlssel>) instruction, must fulfill the syntax requirements: [<Grundbildname>.]<Bildfenstername>[:<Bildname>] ...
143
Examples
The pictures are addressed by the hierarchy information in the list. There are two options here, with or without use of the picture name. In the following examples, a basic picture "BaseScreenName" is configured with a picture window "ScreenWindow". The picture window contains the picture "ScreenName".
144
See also
ScreenItem Object (Page134) Refresh Method (Page702) Item Method (Page687) Count Property (Page346)
Usage
Using the "SmartTags" object, you can: Access the faceplate tags in a faceplate type. Syntax: SmartTags("<tagname>") Access the properties of a faceplate type. Syntax: SmartTags("Properties\<propertyname>")
Example 1
Insert a rectangle and a button in a faceplate type. Define a faceplate variable var1. Connect the "Width" property of the rectangle to faceplate variable var1. Dynamize the "OnClick" event of the button as follows with VBS.
'VBS306 Dim w w = SmartTags("var1") w = w + 10 SmartTags("var1") = w
When you activate Runtime, the faceplate variable is incremented by 10 every time you click the button. This increases the rectangle width by 10.
145
Example 2:
Insert a rectangle and a button in a faceplate type. Define the instance-specific property "wide". Link the "Width" property of the rectangle to the instance-specific property "wide". Dynamize the "OnClick" event of the button as follows with VBS:
'VBS308 Dim w w = SmartTags("Properties\wide") SmartTags("Properties\wide") = w + 50
When you activate Runtime, the instance-specific property "wide" is increased by 50 every time you click the button. This increases the rectangle width by 50.
See also
SmartTag property (Page517)
146
Usage
The "Tag" object can be used to: Read out information on the tag ("Name", "QualityCode", "TimeStamp", "LastError" and "ErrorDescription" properties) Set a value for a tag ("Write" method, "Value" property) Read a value for a tag ("Read" method, "Value" property) Read the value of a "Tag1" tag:
'VBS13 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") objTag.Read() MsgBox objTag.Value
147
Note Tag names must not contain any special characters. Please note that when creating a tag, it must not contain a value (Value = VT_EMPTY). Initialize the tags after declaration with the corresponding value.
are automatically compiled by the CrossReference of WinCC and then listed in the picture properties. If tags are addressed with different formulations in the code, this can be notified by the following section of the CrossReference:
' ' WINCC:TAGNAME_SECTION_START Const TagNameInAction = "TagName" ' WINCC:TAGNAME_SECTION_END
The section can be inserted in VBS actions as often as required. Note It is not possible to guarantee the compilation of combined tag names from the CrossReference.
148
See also
Name Property (Page452) Example: How to Read Tag Values (Page741) Example: Writing tag values (Page739) Write Method (Page725) Read Method (Page698) Value Property (Page610) TimeStamp Property (Page556) QualityCode Property (Page487) LastError Property (Page407) ErrorDescription Property (Page363)
The "Tags" list enables access to tags in WinCC Runtime. The result of access to the "Tags" list is returned by an object of the type "Tag". The Tag object can be used to access all the tag properties and methods.
149
Usage
Tags in the list are accessed via:
HMIRuntime.Tags("Tagname")
The Tags list is used to declare tags (tag objects) for read and write access. In order that the read and write access can be executed without any errors, the corresponding tags must be available in the WinCC Tag Management. Using VBScript in WinCC it is possible to address tags directly by their name to define and read values. If you wish to inquire about additional tag properties, such as quality code or time stamp, or wish to execute error processing, you must address the tag through tags list. The tag object returned enables access to all tag properties and methods. Using the "CreateTagSet" method, you may generate a TagSet object which allows simultaneous access to several tags.
Example:
There are two options when creating tags: With specification of the server prefix: For tags in multi-user systems which are not stored locally. Direct use of the tag name: For tags stored locally on the computer.
150
Set objTag = HMIRuntime.Tags("Tagname") If just the tag name is used, the "ServerPrefix" and "TagPrefix" properties are assigned the values from the current context (current picture window).
See also
Example: How to Read Tag Values (Page741) Example: Writing tag values (Page739) Item Method (Page687) CreateTagSet Method (Page644) Tag Object (Page146)
Usage
Using the TagSet object, you may: Add tags to the list ("Add" method) Access tag objects contained in the list, and their properties ("Item" method) Write all tags of the list ("Write" method) Read all tags of the list ("Read" method) Remove single tags from the list ("Remove" method) Remove all tags from the list ("RemoveAll" method) Tags in the list are accessed via:
'VBS169 Dim myTags myTags = HMIRuntime.Tags.CreateTagSet myTags("Tagname")
In order to have error-free read/write access to tags (tag objects) of the list, the respective tags must exist in WinCC tag management. If an error occurred during read/write access, the method used will return an error message using the "LastError" and "ErrorDescription" properties.
151
Example:
The following example shows how to generate a TagSet object, how to add tags, and how to write values.
'VBS168 Build a Reference to the TagSet Object Dim group Set group = HMIRuntime.Tags.CreateTagSet 'Add Tags to the Collection group.Add "Motor1" group.Add "Motor2" 'Set the Values of the Tags group("Motor1").Value = 3 group("Motor2").Value = 9 'Write the Values to the DataManager group.Write
See also
LastError Property (Page407) Example: How to Read Tag Values (Page741) Example: Writing tag values (Page739) Write Method (Page725) RemoveAll Method (Page707) Remove Method (Page703) Read Method (Page698) Item Method (Page687) ErrorDescription Property (Page363) Count Property (Page346) Add Method (Page641) Tags Object (List) (Page149) Tag Object (Page146)
1.14.3
1.14.3.1
Introduction
The following section lists all the available types of the "ScreenItem" object.
152
See also
ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Group (Page274) Customized object (Page273) Controls (Page230)
153
Standard objects
Usage
In the following example, the object with the name "Ellipse1" is moved 10 pixels to the right:
'VBS17 Dim objEllipse Set objEllipse = ScreenItems("Ellipse1") objEllipse.Left = objEllipse.Left + 10
154
See also
FillStyle Property (Page369) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) RadiusWidth Property (Page488) RadiusHeight Property (Page488) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) BackFlashColorOn Property (Page297) BackFlashColorOff Property (Page297) BackColor Property (Page295)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "Ellipse Arc"
Usage
In the following example, the object with the name "EllipseArc1" is moved 10 pixels to the right:
'VBS18 Dim objEllipseArc Set objEllipseArc = ScreenItems("EllipseArc1") objEllipseArc.Left = objEllipseArc.Left + 10
156
See also
RadiusHeight Property (Page488) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) StartAngle Property (Page523) RadiusWidth Property (Page488) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashBorderColor Property (Page373) EndAngle Property (Page361) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) Layer Property (Page408)
157
Object Type of ScreenItem Object. Represents the graphic object "Ellipse Segment"
Usage
In the following example, the object with the name "EllipseSegment1" is moved 10 pixels to the right:
'VBS19 Dim objEllipseSeg Set objEllipseSeg = ScreenItems("EllipseSegment1") objEllipseSeg.Left = objEllipseSeg.Left + 10
158
See also
Layer Object (Page127) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) StartAngle Property (Page523) RadiusWidth Property (Page488) RadiusHeight Property (Page488) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) EndAngle Property (Page361) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) BackFlashColorOn Property (Page297)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, BackColor Property (Page295)
Circle Description
Usage
In the following example, the object with the name "Circle1" is moved 10 pixels to the right:
'VBS20 Dim objCircle Set objCircle= ScreenItems("Circle1") objCircle.Left = objCircle.Left + 10
160
See also
Properties (Page276) BorderStyle Property (Page314) Activate Method (Page639) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Radius Property (Page488) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360) BorderWidth Property (Page315) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) BackFlashColorOn Property (Page297) BackFlashColorOff Property (Page297) BackColor Property (Page295) Layer Property (Page408)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
161
Object Type of ScreenItem Object. Represents the graphic object "Circular Arc"
Usage
In the following example, the object with the name "CircularArc1" is moved 10 pixels to the right:
'VBS21 Dim objCircularArc Set objCircularArc = ScreenItems("CircularArc1") objCircularArc.Left = objCircularArc.Left + 10
162
See also
StartAngle Property (Page523) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Radius Property (Page488) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashBorderColor Property (Page373) EndAngle Property (Page361) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) Layer Property (Page408)
163
Object Type of ScreenItem Object. Represents the graphic object "Pie Segment"
Usage
In the following example, the object with the name "PieSegment1" is moved 10 pixels to the right:
'VBS22 Dim objCircleSeg Set objCircleSeg = ScreenItems("PieSegment1") objCircleSeg.Left = objCircleSeg.Left + 10
164
See also
Type Property (Page596) BorderColor Property (Page313) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Top Property (Page575) ToolTipText Property (Page574) StartAngle Property (Page523) Radius Property (Page488) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) EndAngle Property (Page361) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderBackColor Property (Page312) BackFlashColorOn Property (Page297) BackFlashColorOff Property (Page297)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, Layer Property (Page408)
Line Description
Usage
In the following example, the object with the name "Line1" is moved 10 pixels to the right:
'VBS23 Dim objLine Set objLine = ScreenItems("Line1") objLine.Left = objLine.Left + 10
166
See also
PasswordLevel Property (Page472) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) RotationAngle Property (Page493) ReferenceRotationTop Property (Page490) ReferenceRotationLeft Property (Page490) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashBorderColor Property (Page373) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderEndStyle Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) Layer Property (Page408)
167
Polygon Description
Usage
In the following example, the object with the name "Polygon1" is moved 10 pixels to the right:
'VBS24 Dim objPolygon Set objPolygon = ScreenItems("Polygon1") objPolygon.Left = objPolygon.Left + 10
168
See also
ReferenceRotationTop Property (Page490) BackFlashColorOn Property (Page297) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) RotationAngle Property (Page493) ReferenceRotationLeft Property (Page490) PointCount Property (Page482) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Index Property (Page400) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, BackFlashColorOff
BorderBackColor Property (Page312) Property (Page297) 169 BackColor Property (Page295) ActualPointTop Property (Page280) ActualPointLeft Property (Page280)
Polyline Description
Usage
In the following example, the object with the name "Polyline1" is moved 10 pixels to the right:
'VBS25 Dim objPolyline Set objPolyline = ScreenItems("Polyline1") objPolyline.Left = objPolyline.Left + 10
170
See also
Layer Object (Page127) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) RotationAngle Property (Page493) ReferenceRotationTop Property (Page490) ReferenceRotationLeft Property (Page490) PointCount Property (Page482) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Index Property (Page400) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashBorderColor Property (Page373) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderEndStyle Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) ActualPointTop Property (Page280) ActualPointLeft Property (Page280) Layer Property (Page408)
171
Rectangle Description
Usage
In the following example, the object with the name "Rectangle1" is moved 10 pixels to the right:
'VBS26 Dim objRectangle Set objRectangle = ScreenItems("Rectangle1") objRectangle.Left = objRectangle.Left + 10
172
Handling errors always relates to the procedure layer. If a script in a procedure causes an error, VBScript checks whether an error handling measure is implemented in this layer. If not, control is transferred one layer up (to the calling procedure). If there is no error handling measure here either, the control is transferred yet another layer up. This continues until either the top module level is reached or the code for Runtime error handling is located. If the activation of the Runtime error handling fails, the control is transferred to the top level on the internal VBScript Runtime error handing. This opens an error dialog and stops the script. The "On Error Resume Next" command can be installed on all layers (i.e. also in procedures). When the error handling measure is use, it can basically be determined whether the user is actually using the required implementation type. In addition, it can be ensured that there is no termination of execution due to a faulty access to the object.
173
See also
Properties (Page276) BorderFlashColorOn Property (Page314) Activate Method (Page639) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) BackFlashColorOn Property (Page297) BackFlashColorOff Property (Page297) BackColor Property (Page295) Layer Property (Page408)
174
Object Type of ScreenItem Object. Represents the graphic object "Rounded Rectangle".
Usage
In the following example, the object with the name "RoundedRectangle1" is moved 10 pixels to the right:
'VBS28 Dim objRoundedRectangle Set objRoundedRectangle = ScreenItems("RoundedRectangle1") objRoundedRectangle.Left = objRoundedRectangle.Left + 10
175
The instruction causes the VBScript engine to initiate the follow-on command in the case of a Runtime error. The error code can subsequently be checked using the Err object. In order to deactivate the handling of Runtime errors in scripts, use the following command:
On Error Goto 0
Handling errors always relates to the procedure layer. If a script in a procedure causes an error, VBScript checks whether an error handling measure is implemented in this layer. If not, control is transferred one layer up (to the calling procedure). If there is no error handling measure here either, the control is transferred yet another layer up. This continues until either the top module level is reached or the code for Runtime error handling is located. If the activation of the Runtime error handling fails, the control is transferred to the top level on the internal VBScript Runtime error handing. This opens an error dialog and stops the script. The "On Error Resume Next" command can be installed on all layers (i.e. also in procedures). When the error handling measure is use, it can basically be determined whether the user is actually using the required implementation type. In addition, it can be ensured that there is no termination of execution due to a faulty access to the object.
176
See also
FlashBackColor Property (Page373) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) RoundCornerWidth Property (Page494) RoundCornerHeight Property (Page493) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) BackFlashColorOn Property (Page297) BackFlashColorOff Property (Page297) BackColor Property (Page295)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "Static Text"
Usage
In the following example, the object with the name "StaticText1" is moved 10 pixels to the right:
'VBS30 Dim objStaticText Set objStaticText = ScreenItems("StaticText1") objStaticText.Left = objStaticText.Left + 10
178
See also
ObjectName Property (Page455) BorderFlashColorOn Property (Page314) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Text list (Page210) PasswordLevel Property (Page472) Parent Property (Page471) Orientation Property (Page468) Left Property (Page423) Layer Object (Page127) Height Property (Page391) ForeFlashColorOn Property (Page384) ForeFlashColorOff Property (Page383) ForeColor Property (Page383) FontUnderline Property (Page382) FontSize Property (Page382) FontName Property (Page381) FontItalic Property (Page380) FontBold Property (Page380) FlashRateForeColor Property (Page377) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashForeColor Property (Page374) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, Enabled Property (Page360)
179
Connector Description
Usage
In the following example, the object with the name "Connector1" is moved 10 pixels to the right:
'VBS31 Dim objConnector Set objConnector = ScreenItems("Connector1") objConnector.Left = objConnector.Left + 10
180
See also
ScreenItems Object (List) (Page138) Activate Method (Page639) Properties (Page276) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) TopConnectedObjectName Property (Page576) TopConnectedConnectionPointIndex Property (Page576) Top Property (Page575) ToolTipText Property (Page574) Parent Property (Page471) Orientation Property (Page468) ObjectName Property (Page455) Left Property (Page423) Layer Property (Page408) Height Property (Page391) Enabled Property (Page360) BottomConnectedObjectName Property (Page316) BottomConnectedConnectionPointIndex Property (Page315)
181
Smart objects
Object Type of ScreenItem Object. Represents the graphic object "3D Bar"
Usage
In the following example, the object with the name "3DBar1" is moved 10 pixels to the right:
'VBS32 Dim objBar Set objBar = ScreenItems("3DBar1") objBar.Left = objBar.Left + 10
182
The instruction causes the VBScript engine to initiate the follow-on command in the case of a Runtime error. The error code can subsequently be checked using the Err object. In order to deactivate the handling of Runtime errors in scripts, use the following command:
On Error Goto 0
Handling errors always relates to the procedure layer. If a script in a procedure causes an error, VBScript checks whether an error handling measure is implemented in this layer. If not, control is transferred one layer up (to the calling procedure). If there is no error handling measure here either, the control is transferred yet another layer up. This continues until either the top module level is reached or the code for Runtime error handling is located. If the activation of the Runtime error handling fails, the control is transferred to the top level on the internal VBScript Runtime error handing. This opens an error dialog and stops the script. The "On Error Resume Next" command can be installed on all layers (i.e. also in procedures). When the error handling measure is use, it can basically be determined whether the user is actually using the required implementation type. In addition, it can be ensured that there is no termination of execution due to a faulty access to the object.
183
184
See also
Type Property (Page596) Layer08Color Property (Page415) BorderStyle Property (Page314) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) ZeroPointValue Property (Page637) Width Property (Page626) Visible Property (Page624) Top Property (Page575) ToolTipText Property (Page574) Process Property (Page485) PredefinedAngles Property (Page484) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Min Property (Page449) Max Property (Page435) LightEffect Property (Page424) Left Property (Page423) Layer10Value Property (Page422) Layer09Value Property (Page422) Layer08Value Property (Page421) Layer07Value Property (Page421) Layer06Value Property (Page421) Layer05Value Property (Page420) Layer04Value Property (Page420) Layer03Value Property (Page420) Layer02Value Property (Page420) Layer01Value Property (Page419) Layer00Value Property (Page419) Layer10Color Property (Page415) Layer09Color Property (Page415) Layer07Color Property (Page414)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, Layer05Color Property (Page414)
Layer06Color Property (Page414) 185 Layer04Color Property (Page413) Layer03Color Property (Page413) Layer02Color Property (Page413)
Object Type of ScreenItem Object. Represents the graphic object "Application Window"
Usage
In the following example, the object with the name "ApplicationWindow1" is moved 10 pixels to the right:
'VBS33 Dim objAppWindow Set objAppWindow = ScreenItems("ApplicationWindow1") objAppWindow.Left = objAppWindow.Left + 10
186
See also
Properties (Page276) Activate Method (Page639) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) WindowBorder Property (Page627) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) Template Property (Page532) Parent Property (Page471) OnTop Property (Page460) ObjectName Property (Page455) Moveable Property (Page451) MaximizeButton Property (Page435) Left Property (Page423) Layer Object (Page127) Height Property (Page391) Enabled Property (Page360) CloseButton Property (Page328) Caption Property (Page320) Application Property (Page287)
187
Bar Description
Usage
In the following example, the object with the name "Bar1" is moved 10 pixels to the right:
'VBS34 Dim objBar Set objBar = ScreenItems("Bar1") objBar.Left = objBar.Left + 10
188
Handling errors always relates to the procedure layer. If a script in a procedure causes an error, VBScript checks whether an error handling measure is implemented in this layer. If not, control is transferred one layer up (to the calling procedure). If there is no error handling measure here either, the control is transferred yet another layer up. This continues until either the top module level is reached or the code for Runtime error handling is located. If the activation of the Runtime error handling fails, the control is transferred to the top level on the internal VBScript Runtime error handing. This opens an error dialog and stops the script. The "On Error Resume Next" command can be installed on all layers (i.e. also in procedures). When the error handling measure is use, it can basically be determined whether the user is actually using the required implementation type. In addition, it can be ensured that there is no termination of execution due to a faulty access to the object.
189
See also
ToolTipText Property (Page574) Layer Object (Page127) ColorChangeType Property (Page332) Average Property (Page294) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) ZeroPointValue Property (Page637) ZeroPoint Property (Page636) Width Property (Page626) WarningLow Property (Page626) WarningHigh Property (Page626) Visible Property (Page624) TypeWarningLow Property (Page601) TypeWarningHigh Property (Page600) TypeToleranceLow Property (Page600) TypeToleranceHigh Property (Page600) TypeLimitLow5 Property (Page600) TypeLimitLow4 Property (Page599) TypeLimitHigh5 Property (Page599) TypeLimitHigh4 Property (Page599) TypeAlarmLow Property (Page598) TypeAlarmHigh Property (Page598) Type Property (Page596) TrendColor Property (Page579) Trend Property (Page577) Top Property (Page575) ToleranceLow Property (Page562) ToleranceHigh Property (Page562) ScalingType Property (Page499) Scaling Property (Page498) ScaleTicks Property (Page498) ScaleColor Property (Page498) RightComma Property (Page492) Process Property (Page485) 190 PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Min Property (Page449)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "Picture Window"
Usage
In the following example, the object with the name "ScreenWindow1" is moved 10 pixels to the right:
'VBS35 Dim objScrWindow Set objScrWindow = ScreenItems("ScreenWindow1") objScrWindow.Left = objScrWindow.Left + 10
191
See also
ServerPrefix Property (Page509) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Zoom Property (Page637) WindowBorder Property (Page627) Width Property (Page626) Visible Property (Page624) UpdateCycle Property (Page603) Type Property (Page596) Top Property (Page575) TagPrefix Property (Page531) ScrollPositionY Property (Page502) ScrollPositionX Property (Page502) ScrollBars Property (Page502) ScreenName Property (Page500) Screens Property (Page501) Parent Property (Page471) OnTop Property (Page460) OffsetTop Property (Page458) OffsetLeft Property (Page458) ObjectName Property (Page455) Moveable Property (Page451) MaximizeButton Property (Page435) Left Property (Page423) Layer Object (Page127) Height Property (Page391) Enabled Property (Page360) CloseButton Property (Page328) CaptionText Property (Page321) Caption Property (Page320) AdaptSize Property (Page281) AdaptPicture Property (Page281) MenuToolBarConfig Property (Page442) 192
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Control Description
Object Type of ScreenItem Object. Represents the graphic object "Control" The Control object type always assumes the properties of the Control type selected. In the case of controls provided by WinCC, the properties are indicated under the description of the corresponding Control. In the case of controls from external suppliers, the control properties are supplied and thus not a part of this description. However, the control properties can be queried using the "Item" property.
Usage
In the following example, the object with the name "Control1" is moved 10 pixels to the right:
'VBS36 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left + 10
193
Special feature
The controls provided by WinCC return a special ID as the type. It can be found under the topic "Type Identification in VBS" in the individual descriptions of the WinCC Controls.
Note In order that example above works, a multimedia control should be inserted in the picture. Determine the UserFriendlyName as follows:
'VBS38 Dim objControl Dim strFriendlyName Set objControl = ScreenItems("Control1") strFriendlyName = CreateObject("WScript.Shell").RegRead("HKCR\" & objControl.Type & "\") MsgBox strFriendlyName
Note In order that example above works, a multimedia control should be inserted in the picture.
194
The properties of the ScreenItem object are used in the case of identical names, if you use the following form:
Control.type
195
See also
Object Property (Page455) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Property (Page408) Height Property (Page391) Enabled Property (Page360)
Object Type of ScreenItem Object. Represents the graphic object "I/O Field"
196
Usage
In the following example, the object with the name "IOField1" is moved 10 pixels to the right:
'VBS39 Dim objIOField Set objIOField = ScreenItems("IOField1") objIOField.Left = objIOField.Left + 10
197
See also
OperationMessage Property (Page460) EditAtOnce Property (Page360) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) PasswordLevel Property (Page472) Parent Property (Page471) OutputValue Property (Page470) OutputFormat Property (Page469) Orientation Property (Page468) OperationReport Property (Page461) ObjectName Property (Page455) LimitMin Property (Page426) LimitMax Property (Page426) Left Property (Page423) Layer Object (Page127) HiddenInput Property (Page392) Height Property (Page391) ForeFlashColorOn Property (Page384) ForeFlashColorOff Property (Page383) ForeColor Property (Page383) FontUnderline Property (Page382) FontSize Property (Page382) FontName Property (Page381) FontItalic Property (Page380) FontBold Property (Page380) FlashRateForeColor Property (Page377) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashForeColor Property (Page374) 198 FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillColor Property (Page368)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the "faceplate instance" graphic object.
Usage
In the following example, the object with the name "FaceplateInstance1" is moved 10 pixels to the right:
'VBS309 Dim objFaceplateObject Set objFaceplateObject = ScreenItems("FaceplateInstance1") objFaceplateObject.Left = objFaceplateObject.Left + 10
199
Object Type of ScreenItem Object. Represents the graphic object "Graphic Object"
Usage
In the following example, the object with the name "GraphicObject1" is moved 10 pixels to the right:
'VBS40 Dim objGraphicView Set objGraphicView= ScreenItems("GraphicObject1") objGraphicView.Left = objGraphicView.Left + 10
200
See also
Parent Property (Page471) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) PicUseTransColor Property (Page482) PictureName Property (Page480) PicTransColor Property (Page478) PicReferenced Property (Page477) PasswordLevel Property (Page472) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) BackFlashColorOn Property (Page297)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, BackColor Property (Page295)
Combobox Description
Usage
In the following example, the object with the name "ComboBox1" is moved 10 pixels to the right:
'VBS21 Dim objComboBox Set objComboBox = ScreenItems("ComboBox1") objComboBox.Left = objComboBox.Left + 10
202
Object Type of ScreenItem Object. Represents the "List Box" graphic object.
Usage
In the following example, the object with the name "ListBox1" is moved 10 pixels to the right:
'VBS21 Dim objListBox Set objListBox = ScreenItems("ListBox1") objListBox.Left = objListBox.Left + 10
203
Object Type of ScreenItem Object. Represents the "Multiline Text" graphic object.
Usage
In the following example, the object with the name "MultiLineEdit1" is moved 10 pixels to the right:
'VBS21 Dim objMultiLineEdit Set objMultiLineEdit = ScreenItems("MultiLineEdit1") objMultiLineEdit.Left = objMultiLineEdit.Left + 10
204
Object Type of ScreenItem Object. Represents the graphic object "OLE Element". The return value is a STRING type.
Usage
In the following example, the object with the name "OLEElement1" is moved 10 pixels to the right:
'VBS41 Dim objOLEElement Set objOLEElement = ScreenItems("OLEElement1") objOLEElement.Left = objOLEElement.Left + 10
Special feature
In the case of OLE Elements, the version-independent ProgID is returned as the type. It is possible to determine the version-dependent ProgID or "User friendly Name" from the ProgID: In the following example, "OLEObject1" is a control embedded in the picture which already returns the version-independent ProgID as a result of the Type property.
205
Note In order that the example above works, a Word document should be embedded in the picture as an OLE Element. Determine the User Friendly Name as follows:
'VBS43 Dim objControl Dim strFriendlyName Set objControl = ScreenItems("OLEElement1") strFriendlyName = CreateObject("WScript.Shell").RegRead("HKCR\" & objControl.Type & "\") MsgBox strFriendlyName
Note In order that the example above works, a Word document should be embedded in the picture as an OLE Element.
206
In the case of identical names, the properties of the ScreenItem object are used.
See also
Height Property (Page391) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Parent Property (Page471) Object Property (Page455) ObjectName Property (Page455) Left Property (Page423) Layer Property (Page408) Enabled Property (Page360)
207
Object Type of ScreenItem Object. Represents the graphic object "Group Display"
Usage
In the following example, the object with the name "GroupDisplay1" is moved 10 pixels to the right:
'VBS44 Dim objGroupDisplay Set objGroupDisplay = ScreenItems("GroupDisplay1") objGroupDisplay.Left = objGroupDisplay.Left + 10
208
See also
Activate Method (Page639) MCKQBackColorOn Property (Page439) FontBold Property (Page380) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) UserValue4 Property (Page608) UserValue3 Property (Page607) UserValue2-Eigenschaft (Page607) UserValue1 Property (Page607) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) SignificantMask Property (Page516) SameSize Property (Page497) Relevant Property (Page491) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) MessageClass Property (Page447) MCText Property (Page441) MCKQTextFlash Property (Page441) MCKQTextColorOn Property (Page440) MCKQTextColorOff Property (Page440) MCKQBackFlash Property (Page440) MCKQBackColorOff Property (Page439) MCKOTextFlash Property (Page439) MCKOTextColorOn Property (Page439) MCKOTextColorOff Property (Page438) MCKOBackFlash Property (Page438) MCKOBackColorOn Property (Page438) MCKOBackColorOff Property (Page437) MCGUTextFlash Property (Page437)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, MCGUTextColorOff
MCGUTextColorOn Property (Page437) Property (Page437) 209 MCGUBackFlash Property (Page436) MCGUBackColorOn Property (Page436) MCGUBackColorOff-Eigenschaft (Page436)
Object Type of ScreenItem Object. Represents the graphic object "Text List"
Usage
In the following example, the object with the name "TextList1" is moved 10 pixels to the right:
'VBS45 Dim objSymIO Set objSymIO = ScreenItems("TextList1") objSymIO.Left = objSymIO.Left + 10
210
See also
Type Property (Page596) FontUnderline Property (Page382) BackFlashColorOff Property (Page297) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) UnselTextColor Property (Page603) UnselBGColor Property (Page602) Top Property (Page575) ToolTipText Property (Page574) SelTextColor Property (Page508) SelBGColor Property (Page504) PasswordLevel Property (Page472) Parent Property (Page471) OutputValue Property (Page470) Orientation Property (Page468) OperationReport Property (Page461) OperationMessage Property (Page460) ObjectName Property (Page455) NumberLines Property (Page454) ListType Property (Page428) Left Property (Page423) Layer Object (Page127) LanguageSwitch Property (Page406) ItemBorderWidth Property (Page404) ItemBorderStyle Property (Page403) ItemBorderColor Property (Page403) ItemBorderBackColor Property (Page403) Height Property (Page391) ForeFlashColorOn Property (Page384) ForeFlashColorOff Property (Page383) ForeColor Property (Page383)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, FontName Property (Page381)
211
Object Type of ScreenItem Object. Represents the graphic object "Status Display"
Usage
In the following example, the object with the name "StatusDisplay1" is moved 10 pixels to the right:
'VBS46 Dim objGraphicIO Set objGraphicIO= ScreenItems("StatusDisplay1") objGraphicIO.Left = objGraphicIO.Left + 10
212
See also
Layer Object (Page127) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Index Property (Page400) Height Property (Page391) FlashRateFlashPic Property (Page376) FlashRateBorderColor Property (Page376) FlashPicUseTransColor Property (Page375) FlashPicture Property (Page375) FlashPicTransColor Property (Page374) FlashPicReferenced Property (Page374) FlashFlashPicture Property (Page373) FlashBorderColor Property (Page373) Enabled Property (Page360) BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314) BorderFlashColorOff Property (Page314) BorderColor Property (Page313) BorderBackColor Property (Page312) BasePicUseTransColor Property (Page302) BasePicture Property (Page302) BasePicTransColor Property (Page301) BasePicReferenced Property (Page301)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
213
Windows objects
Usage
In the following example, the object with the name "Button1" is moved 10 pixels to the right:
'VBS47 Dim cmdButton Set cmdButton = ScreenItems("Button1") cmdButton.Left = cmdButton.Left + 10
214
The instruction causes the VBScript engine to initiate the follow-on command in the case of a Runtime error. The error code can subsequently be checked using the Err object. In order to deactivate the handling of Runtime errors in scripts, use the following command:
On Error Goto 0
Handling errors always relates to the procedure layer. If a script in a procedure causes an error, VBScript checks whether an error handling measure is implemented in this layer. If not, control is transferred one layer up (to the calling procedure). If there is no error handling measure here either, the control is transferred yet another layer up. This continues until either the top module level is reached or the code for Runtime error handling is located. If the activation of the Runtime error handling fails, the control is transferred to the top level on the internal VBScript Runtime error handing. This opens an error dialog and stops the script. The "On Error Resume Next" command can be installed on all layers (i.e. also in procedures). When the error handling measure is use, it can basically be determined whether the user is actually using the required implementation type. In addition, it can be ensured that there is no termination of execution due to a faulty access to the object.
215
See also
Top Property (Page575) FlashBorderColor Property (Page373) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) WindowsStyle Property (Page629) Width Property (Page626) Visible Property (Page624) Type Property (Page596) ToolTipText Property (Page574) Text list (Page210) PictureUp Property (Page479) PictureDown Property (Page479) PasswordLevel Property (Page472) Parent Property (Page471) Orientation Property (Page468) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Hotkey Property (Page397) Height Property (Page391) ForeFlashColorOn Property (Page384) ForeFlashColorOff Property (Page383) ForeColor Property (Page383) FontUnderline Property (Page382) FontSize Property (Page382) FontName Property (Page381) FontItalic Property (Page380) FontBold Property (Page380) FlashRateForeColor Property (Page377) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashForeColor Property (Page374) FlashBackColor Property (Page373) FillStyle Property (Page369) 216 FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "Check Box"
Usage
In the following example, the object with the name "CheckBox1" is moved 10 pixels to the right:
'VBS49 Dim chkCheckBox Set chkCheckBox = ScreenItems("CheckBox1") chkCheckBox.Left = chkCheckBox.Left + 10
217
See also
FontSize Property (Page382) BackColor Property (Page295) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Text list (Page210) Process Property (Page485) PasswordLevel Property (Page472) Parent Property (Page471) Orientation Property (Page468) OperationMessage Property (Page460) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Index Property (Page400) Height Property (Page391) ForeFlashColorOn Property (Page384) ForeFlashColorOff Property (Page383) ForeColor Property (Page383) FontUnderline Property (Page382) FontName Property (Page381) FontItalic Property (Page380) FontBold Property (Page380) FlashRateForeColor Property (Page377) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashForeColor Property (Page374) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) 218 FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "Radio Box"
Usage
In the following example, the object with the name "RadioBox1" is moved 10 pixels to the right:
'VBS50 Dim objOptionGroup Set objOptionGroup = ScreenItems("RadioBox1") objOptionGroup.Left = objOptionGroup.Left + 10
219
See also
ForeColor Property (Page383) BackFlashColorOn Property (Page297) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Text list (Page210) Process Property (Page485) PasswordLevel Property (Page472) Parent Property (Page471) Orientation Property (Page468) OperationMessage Property (Page460) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Index Property (Page400) Height Property (Page391) ForeFlashColorOn Property (Page384) ForeFlashColorOff Property (Page383) FontUnderline Property (Page382) FontSize Property (Page382) FontName Property (Page381) FontItalic Property (Page380) FontBold Property (Page380) FlashRateForeColor Property (Page377) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashForeColor Property (Page374) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) 220 FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "Round Button"
Usage
In the following example, the object with the name "RoundButton1" is moved 10 pixels to the right:
'VBS51 Dim objSwitch Set objSwitch= ScreenItems("RoundButton1") objSwitch.Left = objSwitch.Left + 10
221
See also
PicDownUseTransColor Property (Page477) BorderColorTop Property (Page313) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Toggle Property (Page561) Radius Property (Page488) Pressed Property (Page484) PicUpUseTransColor Property (Page481) PicUpTransparent Property (Page481) PicUpReferenced Property (Page481) PictureUp Property (Page479) PictureDown Property (Page479) PictureDeactivated Property (Page479) PicDownTransparent Property (Page477) PicDownReferenced Property (Page477) PicDeactUseTransColor Property (Page476) PicDeactTransparent Property (Page476) PicDeactReferenced-Eigenschaft (Page476) PasswordLevel Property (Page472) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) 222 FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) Enabled Property (Page360)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Slider Description
Usage
In the following example, the object with the name "Slider1" is moved 10 pixels to the right:
'VBS53 Dim sldSlider Set sldSlider = ScreenItems("Slider1") sldSlider.Left = sldSlider.Left + 10
223
Handling errors always relates to the procedure layer. If a script in a procedure causes an error, VBScript checks whether an error handling measure is implemented in this layer. If not, control is transferred one layer up (to the calling procedure). If there is no error handling measure here either, the control is transferred yet another layer up. This continues until either the top module level is reached or the code for Runtime error handling is located. If the activation of the Runtime error handling fails, the control is transferred to the top level on the internal VBScript Runtime error handing. This opens an error dialog and stops the script. The "On Error Resume Next" command can be installed on all layers (i.e. also in procedures). When the error handling measure is use, it can basically be determined whether the user is actually using the required implementation type. In addition, it can be ensured that there is no termination of execution due to a faulty access to the object.
224
See also
Height Property (Page391) BackColorBottom Property (Page297) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) WindowsStyle Property (Page629) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) SmallChange Property (Page517) Process Property (Page485) PasswordLevel Property (Page472) Parent Property (Page471) OperationReport Property (Page461) OperationMessage Property (Page460) ObjectName Property (Page455) Min Property (Page449) Max Property (Page435) Left Property (Page423) Layer Object (Page127) FlashRateBorderColor Property (Page376) FlashRateBackColor Property (Page376) FlashBorderColor Property (Page373) FlashBackColor Property (Page373) FillStyle Property (Page369) FillingIndex Property (Page369) Filling Property (Page368) FillColor Property (Page368) ExtendedOperation Property (Page367) Enabled Property (Page360) Direction Property (Page357) ColorTop Property (Page335)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, ButtonColor Property (Page317)
ColorBottom Property (Page332) 225 BorderWidth Property (Page315) BorderStyle Property (Page314) BorderFlashColorOn Property (Page314)
1.14.3.5
Tube objects
Object Type of ScreenItem Object. Represents the "Polygon Tube" graphic object.
Usage
In the following example, the object with the name "TubePolyline1" is moved 10 pixels to the right:
'VBS24 Dim objTubePolyline Set objTubePolyline = ScreenItems("TubePolyline1") objTubePolyline.Left = objTubePolyline.Left + 10
226
T-piece Description
Usage
In the following example, the object with the name "TubeTeeObject1" is moved 10 pixels to the right:
'VBS21 Dim objTubeTeeObject Set objTubeTeeObject = ScreenItems("TubeTeeObject1") objTubeTeeObject.Left = objTubeTeeObject.Left + 10
227
Object Type of ScreenItem Object. Represents the "Double T-piece" graphic object.
Usage
In the following example, the object with the name "TubeDoubleTeeObject1" is moved 10 pixels to the right:
'VBS21 Dim objTubeDoubleTeeObject Set objTubeDoubleTeeObject = ScreenItems("TubeDoubleTeeObject1") objTubeDoubleTeeObject.Left = objTubeDoubleTeeObject.Left + 10
228
Object Type of ScreenItem Object. Represents the "Tube Arc" graphic object.
Usage
In the following example, the object with the name "TubeArcObject1" is moved 10 pixels to the right:
'VBS24 Dim objTubeArcObject Set objTubeArcObject = ScreenItems("TubeArcObject1") objTubeArcObject.Left = objTubeArcObject.Left + 10
229
1.14.3.6 Controls
Controls
Note In order that example above works, a multimedia control should be inserted in the picture. Determine the User Friendly Name as follows:
'VBS154 Dim objControl Dim strFriendlyName Set objControl = ScreenItems("Control1") strFriendlyName = CreateObject("WScript.Shell").RegRead("HKCR\" & objControl.Type & "\") MsgBox strFriendlyName
Note In order that example above works, a multimedia control should be inserted in the picture.
230
Methods
The "ByRef" declaration may only be implemented as a "Variant" (ByRef xxx as Variant) The "ByVal" declaration may only be implemented with tag types (ByVal xxx as Long)
Properties
The "ByRef" declaration may only be implemented as a "Variant" (ByRef xxx as Variant) The "ByVal" declaration may only be implemented with tag types (ByVal xxx as Long)
Events
The "ByRef" declaration is not permitted. The "ByVal" declaration may only be implemented as a "Variant" (ByVal xxx as Variant)
Arrays
If arrays are used, they must be declared with (ByRef xxx As Variant). In order that arrays can be transferred in variants, variant tag must also be inserted as an intermediate tag according to the following scheme:
'VBS151 Dim arrayPoints(200) Dim vArrayCoercion 'Variant for array Coercion ' Make the VBS Array compatibile with the OLE Automation vArrayCoercion = (arrayPoints) objTrendControl.DataXY = vArrayCoercion ' this array will occur in the control
If you use the following form, the properties of the ScreenItem object are used in the case of identical names:
231
Double parameter
When using a Control which is not an internal WinCC control, it is possible that the event prototypes contain a parameter with the name "Item". In this case, the name of the parameter is renamed according to "ObjectItem" in the VBS prototype submitted. If this name already exists, the name is differentiated by numbers being appended.
232
See also
HMI Symbol Library 1.4.1 (Page233) WinCC Slider Control (Page259) WinCC Push Button Control (Page253) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Gauge Control (Page243) WinCC Function Trend Control (before WinCC V7) (Page267) WinCC Digital/Analog Clock (Page239) WinCC Alarm Control (before WinCC V7) (Page265) WinCC UserArchiveControl (Page263) WinCC RulerControl (Page257) WinCC OnlineTrendControl (Page250) WinCC OnlineTableControl (Page247) WinCC FunctionTrendControl (Page241) WinCC AlarmControl (Page236)
Object Type of ScreenItem Object. Represents the graphic object "HMI Symbol Library"
233
Usage
In the following example, the object with the name "Control1" is moved 20 pixels to the right:
'VBS64 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +20
Properties
This object type has the following properties:
234
See also
Left Property (Page423) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Controls (Page230) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) Stretch Property (Page529) Rotation Property (Page492) Picture Property (Page478) Parent Property (Page471) ObjectName Property (Page455) Object Property (Page455) Layer Object (Page127) Height Property (Page391) ForeColor Property (Page383) Flip Property (Page377) Enabled Property (Page360) Cursor Property (Page348) BlinkSpeed Property (Page308) BlinkMode Property (Page307) BlinkColor Property (Page307) BackStyle Property (Page299) BackColor Property (Page295)
235
Object Type of ScreenItem Object. Represents the graphic object "WinCC AlarmControl" as of WinCC V7.0.
Usage
In the following example, the object with the name "Control1" is moved 10 pixels to the right:
'VBS54 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left 10
236
GetHitlistColumn LockAlarm GetHitlistColumn LoopInAlarm Collection GetMessageBloc MoveToFirstLine k GetMessageBloc MoveToFirstPage kCollection GetMessageCol umn GetMessageCol umnCollection MoveToLastLine MoveToLastPage
LongTermArchiveConsistenc OperatorMessageSourceTyp TableColor y e7 MessageBlockAlign MessageBlockAutoPrecision s MessageBlockCaption MessageBlockDateFormat OperatorMessageSourceTyp TableColor2 e8 OperatorMessageSourceTyp TableForeColor e9 PageMode PageModeMessageNumber TableForeColor2 TimeBase TitleColor TitleCut TitleDarkShadowColor TitleForeColor TitleGridLineColor TitleLightShadowColor TitleSort TitleStyle ToolbarAlignment ToolbarBackColor ToolbarButtonActive
MessageBlockExponentialFo PrintJobName rmat MessageBlockFlashOn MessageBlockHideText MessageBlockHideTitleText MessageBlockIndex RowScrollbar RowTitleAlign RowTitles RTPersistence
MessageBlockLeadingZeros RTPersistencePasswordLev el MessageBlockLength MessageBlockPrecisions MessageBlockSelected MessageBlockShowDate MessageBlockShowIcon RTPersistenceType SelectedCellColor SelectedCellForeColor SelectedRowColor SelectedRowForeColor
237
See also
Controls (Page230)
238
Object Type of ScreenItem Object. Represents the graphic object "WinCC Digital/Analog Clock"
Usage
In the following example, the object with the name "Control1" is moved 11 pixels to the right:
'VBS55 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +11
239
See also
Parent Property (Page471) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Controls (Page230) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) Ticks Property (Page536) TicksColor Property (Page536) SquareExtent Property (Page523) SecondNeedleWidth Property (Page503) SecondNeedleHeight Property (Page503) Picture Property (Page478) ObjectName Property (Page455) Object Property (Page455) MinuteNeedleWidth Property (Page450) MinuteNeedleHeight Property (Page450) LocaleID Property (Page429) Left Property (Page423) Layer Object (Page127) HourNeedleWidth Property (Page398) HourNeedleHeight Property (Page398) Height Property (Page391) Handtype Property (Page391) HandFillColor Property (Page390) ForeColor Property (Page383) Font Property (Page379) FocusRect Property (Page378) Enabled Property (Page360) BackStyle Property (Page299) BackColor Property (Page295) Analog Property (Page286) 240
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "WinCC FunctionTrendControl" as of WinCC V7.0.
Usage
In the following example, the object with the name "Control1" is moved 13 pixels to the right:
'VBS57 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +13
241
GetTrendWindowCollection Print GetXAxis GetXAxisCollection GetYAxis GetYAxisCollection ShowHelp ShowPropertyDialog ShowTagSelection ShowTimeSelection
ToolbarButtonPasswordLeve TrendTrendWindow l ToolbarButtonRemove ToolbarButtonRename ToolbarButtonRepos ToolbarButtonTooltipText ToolbarButtonVisible ToolbarShowTooltips ToolbarUseBackColor ToolbarUseHotKeys ToolbarVisible TrendActualize TrendAdd TrendUncertainColor TrendUncertainColoring TrendUpperLimit TrendUpperLimitColor TrendUpperLimitColoring TrendVisible TrendWindowAdd TrendWindowCoarseGrid
242
StatusbarElementTooltipText
See also
Controls (Page230)
Object Type of ScreenItem Object. Represents the graphic object "WinCC Gauge Control"
243
Usage
In the following example, the object with the name "Control1" is moved 14 pixels to the right:
'VBS58 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +14
244
See also
WarningColor Property (Page625) Object Property (Page455) BackColor Property (Page295) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Object Types of the ScreenItem Object (Page152) Width Property (Page626) Warning Property (Page625) Visible Property (Page624) ValueMin Property (Page624) ValueMax Property (Page623) ValueColumnAlignment Property (Page617) UnitText Property (Page602) UnitOffset Property (Page602) UnitFont Property (Page601) UnitColor Property (Page601) Type Property (Page596) Top Property (Page575) TicWidth Property (Page536) TicTextOffset Property (Page535) TicTextColor Property (Page535) TicOffset Property (Page535) TicFont Property (Page534) TicColor Property (Page534) ShowWarning Property (Page515) ShowPeak Property (Page511) ShowNormal Property (Page511) ShowDecimalPoint Property (Page510) ShowDanger Property (Page510) Rectangular Property (Page489) Parent Property (Page471) ObjectName Property (Page455) NormalColor Property (Page454)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, LocaleID Property (Page429)
NeedleColor Property (Page453) 245 Left Property (Page423) Layer Object (Page127) Height Property (Page391)
Object Type of ScreenItem Object. Represents the "WinCC Media Control" graphic object as of WinCC V7.0. Object Type of ScreenItem Object. Represents the "WinCC Media Control" graphic object as of WinCC V7.0.
Usage
In the following example, the object with the name "Control1" is moved 16 pixels to the right:
'VBS60 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left 16
246
Object Type of ScreenItem Object. Represents the graphic object "WinCC OnlineTableControl" as of WinCC V7.0.
Usage
In the following example, the object with the name "Control1" is moved 15 pixels to the right:
'VBS59 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left 15
247
GetTimeColumnColl MoveToPrevious ection DeactivateD GetToolbarButton NextColumn ynamic DetachDB GetToolbarButtonC PreviousColumn ollection Edit GetValueColumn Print
248
StatusbarBackColor
249
See also
Controls (Page230)
Object Type of ScreenItem Object. Represents the graphic object "WinCC OnlineTrendControl" as of WinCC V7.0.
250
Usage
In the following example, the object with the name "Control1" is moved 16 pixels to the right:
'VBS60 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left 16
GetTrendWindowCollection PreviousTrend GetValueAxis GetValueAxisCollection MoveAxis MoveToFirst Print ShowHelp ShowPercentageAxis ShowPropertyDialog
StatusbarElementTooltipText ToolbarButtonRepos StatusbarElementVisible StatusbarElementWidth StatusbarShowTooltips StatusbarUseBackColor StatusbarVisible TimeAxisActualize TimeAxisAdd TimeAxisAlign TimeAxisBeginTime ToolbarButtonTooltipText ToolbarButtonVisible ToolbarShowTooltips ToolbarUseBackColor ToolbarUseHotKeys ToolbarVisible TrendAdd TrendAutoRangeBeginTagN ame
TrendAutoRangeBeginValue TrendWindowName
251
ToolbarButtonPasswordLeve TrendUpperLimitColoring l
See also
Controls (Page230)
252
Object Type of ScreenItem Object. Represents the graphic object "WinCC Push Button Control"
Usage
In the following example, the object with the name "Control1" is moved 17 pixels to the right:
'VBS61 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +17
Note The events KeyDown, KeyUp and KeyPress cannot be addressed by VBS. If it is required to make controls dynamic with the help of VBS, no parameter must be declared with ByRef.
253
The instruction causes the VBScript engine to initiate the follow-on command in the case of a Runtime error. The error code can subsequently be checked using the Err object. In order to deactivate the handling of Runtime errors in scripts, use the following command:
On Error Goto 0
Handling errors always relates to the procedure layer. If a script in a procedure causes an error, VBScript checks whether an error handling measure is implemented in this layer. If not, control is transferred one layer up (to the calling procedure). If there is no error handling measure here either, the control is transferred yet another layer up. This continues until either the top module level is reached or the code for Runtime error handling is located. If the activation of the Runtime error handling fails, the control is transferred to the top level on the internal VBScript Runtime error handing. This opens an error dialog and stops the script. The "On Error Resume Next" command can be installed on all layers (i.e. also in procedures). When the error handling measure is use, it can basically be determined whether the user is actually using the required implementation type. In addition, it can be ensured that there is no termination of execution due to a faulty access to the object.
254
If 0 <> Err.Number Then HMIRuntime.Trace objScreenItem.ObjectName & ": no Control" & vbCrLf Err.Clear End If End If Next On Error Goto 0 'Deactivation of errorhandling
255
See also
Properties (Page276) FontName Property (Page381) Activate Method (Page639) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Controls (Page230) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Transparent Property (Page577) Top Property (Page575) PictureUnselected Property (Page480) PictureSelected Property (Page480) Parent Property (Page471) Outline Property (Page469) ObjectName Property (Page455) Object Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) FrameWidth Property (Page386) FrameColorUp Property (Page385) FrameColorDown Property (Page385) ForeColor Property (Page383) FontUnderline Property (Page382) FontStrikeThru Property (Page382) FontSize Property (Page382) FontItalic Property (Page380) Font Property (Page379) FontBold Property (Page380) FocusRect Property (Page378) Enabled Property (Page360) Caption Property (Page320) BackColor Property (Page295) AutoSize Property (Page293) 256
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "WinCC RulerControl" as of WinCC V7.0.
Usage
In the following example, the object with the name "Control1" is moved 16 pixels to the right:
'VBS60 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left 16
257
StatusbarElementTooltipText ToolbarButtonTooltipText StatusbarElementVisible StatusbarElementWidth StatusbarShowTooltips StatusbarUseBackColor StatusbarVisible TableColor TableColor2 TableForeColor TableForeColor2 TitleColor ToolbarButtonVisible ToolbarShowTooltips ToolbarUseBackColor ToolbarUseHotKeys ToolbarVisible UseSelectedTitleColor UseSourceBackColors UseSourceForeColors UseTableColor2 VerticalGridLines
258
See also
Controls (Page230)
Object Type of ScreenItem Object. Represents the graphic object "WinCC Slider Control"
Usage
In the following example, the object with the name "Control1" is moved 19 pixels to the right:
'VBS63 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +19
259
The instruction causes the VBScript engine to initiate the follow-on command in the case of a Runtime error. The error code can subsequently be checked using the Err object. In order to deactivate the handling of Runtime errors in scripts, use the following command:
On Error Goto 0
Handling errors always relates to the procedure layer. If a script in a procedure causes an error, VBScript checks whether an error handling measure is implemented in this layer. If not, control is transferred one layer up (to the calling procedure). If there is no error handling measure here either, the control is transferred yet another layer up. This continues until either the top module level is reached or the code for Runtime error handling is located. If the activation of the Runtime error handling fails, the control is transferred to the top level on the internal VBScript Runtime error handing. This opens an error dialog and stops the script. The "On Error Resume Next" command can be installed on all layers (i.e. also in procedures). When the error handling measure is use, it can basically be determined whether the user is actually using the required implementation type. In addition, it can be ensured that there is no termination of execution due to a faulty access to the object.
260
End If End If Next On Error GoTo 0 ' deactivating error handling End Sub
261
See also
PictureThumb Property (Page480) BarFillColor Property (Page300) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Controls (Page230) WithLabels Property (Page630) WithAxes Property (Page629) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) TickStyle Property (Page537) ThumbBackColor Property (Page534) ShowThumb Property (Page514) ShowPosition Property (Page511) ShowBar Property (Page510) RangeMin Property (Page489) RangeMax Property (Page489) Position Property (Page482) PictureBack Property (Page478) Parent Property (Page471) OuterBevelWidth Property (Page469) OuterBevelStyle Property (Page468) ObjectName Property (Page455) Object Property (Page455) LocaleID Property (Page429) Left Property (Page423) Layer Object (Page127) LabelColor Property (Page405) InnerBevelWidth Property (Page401) InnerBevelStyle Property (Page401) InnerBevelOffset Property (Page401) Height Property (Page391) ForeColor Property (Page383) 262 FontPosition Property (Page381) Font Property (Page379) FocusWidth Property (Page378) FocusColor Property (Page378)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "WinCC UserArchiveControl" as of WinCC V7.0.
Usage
In the following example, the object with the name "Control1" is moved 16 pixels to the right:
'VBS60 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left + 16
263
StatusbarElementTooltipText ToolbarButtonTooltipText StatusbarElementVisible StatusbarElementWidth StatusbarShowTooltips StatusbarUseBackColor StatusbarVisible TableColor TableColor2 TableForeColor TableForeColor2 ToolbarButtonVisible ToolbarShowTooltips ToolbarUseBackColor ToolbarUseHotKeys ToolbarVisible UseSelectedTitleColor UseTableColor2 VerticalGridLines
264
See also
Controls (Page230)
Controls before WinCC V7 WinCC Alarm Control (before WinCC V7) Description
Object Type of ScreenItem Object. Represents the graphic object "WinCC Alarm Control"
Usage
In the following example, the object with the name "Control1" is moved 10 pixels to the right:
'VBS54 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left + 10
265
See also
ProjectPath Property (Page486) BackColor Property (Page295) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Controls (Page230) WindowType Property (Page629) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolbarButtons Property (Page571) Titleline Property (Page560) TitleCut Property (Page559) StatusbarPanes Property (Page528) ServerNames Property (Page509) SelectionType Property (Page507) SelectionRectWidth Property (Page507) SelectionRectColor Property (Page506) SelectionMode Property (Page506) PersistentRTPermission Property (Page475) PersistentRTCSPermission Property (Page475) Parent Property (Page471) ObjectName Property (Page455) Object Property (Page455) MsgFilterSQL Property (Page452) MsgCtrlFlags Property (Page451) LineTitle Property (Page427) LineHeight Property (Page427) LineFont Property (Page426) Left Property (Page423) Layer Object (Page127) Height Property (Page391) HeaderSort Property (Page391) GridLineVert Property (Page390) 266 GridLineHorz Property (Page388) Font Property (Page379) Enabled Property (Page360) ColWidth Property (Page343)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "WinCC Function Trend Control"
Usage
In the following example, the object with the name "Control1" is moved 13 pixels to the right:
'VBS57 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +13
267
See also
Top Property (Page575) ScalingTypeY Property (Page500) Layer Object (Page127) DesiredCurveSourceUAArchive Property (Page356) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Controls (Page230) Width Property (Page626) Visible Property (Page624) UpperLimitValue Property (Page604) UpperLimit Property (Page603) UpperLimitColor Property (Page604) Type Property (Page596) ToolbarHotKeys Property (Page572) ToolbarButtons Property (Page571) ToolbarAlignment Property (Page563) Titleline Property (Page560) TimeZone Property (Page558) TimeAxisX Property (Page544) TagProviderClsid Property (Page532) SourceUAColumnY Property (Page523) SourceUAColumnX Property (Page522) SourceUAArchiveStartID Property (Page522) SourceUAArchive Property (Page521) SourceTimeRange Property (Page521) SourceTagProviderDataY Property (Page521) SourceTagProviderDataX Property (Page520) SourceTagNameY Property (Page520) SourceTagNameX Property (Page520) SourceNumberOfValues Property (Page519) SourceNumberOfUAValues Property (Page519) SourceEndTime Property (Page519) SourceBeginTime Property (Page518) ShowValuesExponentialY Property (Page515) 268 ShowValuesExponentialX Property (Page515) ShowRulerImmediately Property (Page512) ScalingTypeX Property (Page499) RulerPrecisionY Property (Page497)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "WinCC Online Table Control"
Usage
In the following example, the object with the name "Control1" is moved 15 pixels to the right:
'VBS59 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +15
269
See also
TimeOverlap Property (Page554) ItemVisible Property (Page404) PrintBackgroundColor Property (Page484) Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Controls (Page230) Width Property (Page626) Visible Property (Page624) Variable Property (Page624) ValueColumnAlignment Property (Page617) UpperLimitValue Property (Page604) UpperLimit Property (Page603) UpperLimitColor Property (Page604) Type Property (Page596) Top Property (Page575) ToolbarHotKeys Property (Page572) Toolbar Property (Page562) ToolbarButtons Property (Page571) ToolbarAlignment Property (Page563) Titleline Property (Page560) TimeZone Property (Page558) TimeRangeFactor Property (Page556) TimeRange Property (Page555) TimeRangeBase Property (Page556) TimeOverlapColor Property (Page555) TimeJump Property (Page553) TimeJumpColor Property (Page554) TimeFormat Property (Page553) TimeColumnAlignment Property (Page545) Statusbar Property (Page524) PrintJob Property (Page484) Precisions Property (Page483) PersistentRTPermission Property (Page475) PersistentRT Property (Page474) 270 PersistentRTCSPermission Property (Page475) PersistentRTCS Property (Page474) Parent Property (Page471) Online Property (Page459)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
Object Type of ScreenItem Object. Represents the graphic object "WinCC Online Trend Control"
Usage
In the following example, the object with the name "Control1" is moved 16 pixels to the right:
'VBS60 Dim objControl Set objControl = ScreenItems("Control1") objControl.Left = objControl.Left +16
271
See also
Properties (Page276) TimeAxis Property (Page537) LowerLimitColor Property (Page434) Caption Property (Page320) Activate Method (Page639) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Controls (Page230) Width Property (Page626) Visible Property (Page624) UpperLimitValue Property (Page604) UpperLimit Property (Page603) UpperLimitColor Property (Page604) Type Property (Page596) Top Property (Page575) ToolbarHotKeys Property (Page572) Toolbar Property (Page562) ToolbarButtons Property (Page571) ToolbarAlignment Property (Page563) Titleline Property (Page560) TimeZone Property (Page558) TimeRangeFactor Property (Page556) TimeRange Property (Page555) TimeRangeBase Property (Page556) TimeOverlap Property (Page554) TimeOverlapColor Property (Page555) TimeJump Property (Page553) TimeJumpColor Property (Page554) TimeAxisFormat Property (Page539) TagName Property (Page531) Statusbar Property (Page524) ShowRulerImmediately Property (Page512) ServerData Property (Page509) RulerPrecisions Property (Page496) Replacement Property (Page491) ReplacementColor Property (Page491) 272 RelayCurves Property (Page490) ProviderClsid Property (Page486) PrintJob Property (Page484) Precisions Property (Page483)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1.14.3.7 Description
Customized object
Object Type of ScreenItem Object. Represents the graphic object "Customized Object"
Application
Customized properties in a customized object must be accessed in VBS via the attribute name. Intellisense is only applicable to the customized object as a whole. The attribute name is to be found under Properties of the properties placed outside (right-click Property) and can be modified there. In the following example, the object with the name "CustomizedObject1" is moved 10 pixels to the right:
'VBS65 Dim objCustomObject Set objCustomObject = ScreenItems("CustomizedObject1") objCustomObject.Left = objCustomObject.Left + 10
273
See also
Activate Method (Page639) Properties (Page276) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Object Types of the ScreenItem Object (Page152) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) Enabled Property (Page360)
1.14.3.8 Description
Group
274
Usage
In the following example, the object with the name "Group1" is moved 10 pixels to the right: 'VBS66 Dim objGroup Set objGroup = ScreenItems("Group1") objGroup.Left = objGroup.Left + 10
See also
Properties (Page276) Activate Method (Page639) ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Object Types of the ScreenItem Object (Page152) Width Property (Page626) Visible Property (Page624) Type Property (Page596) Top Property (Page575) ToolTipText Property (Page574) Parent Property (Page471) ObjectName Property (Page455) Left Property (Page423) Layer Object (Page127) Height Property (Page391) Enabled Property (Page360)
275
1.14.4
1.14.4.1 Overview
Properties
Properties
The properties of the individual objects can be used to modify specific graphic objects and tags in Runtime , e.g. activating an operating element per mouse click or triggering a color change by modifying a tag value. Properties on graphic objects can be addressed via the following syntax:
'VBS191 Dim obj Set obj = ScreenItems("object1") obj.property = Value
In the following example, the object with the name "Control1" is moved 10 pixels to the right:
'VBS192 Dim obj Set obj = ScreenItems("control1") obj.Left = obj.Left + 10
1.14.4.2 Aa - Ad
Example:
In the following example, the path of the picture "ScreenWindow1" is issued:
'VBS67
276
See also
ScreenItem Object (Page134) Screens Object (List) (Page143)
Example:
Dim ctrl Set ctrl = ScreenItems("Control") ctrl.Object.activate = true
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
277
See also
Path Property (Page473) Name Property (Page452) Ellipse segment (Page158) HMIRuntime Object (Page125)
Usage
"ActiveScreen" is used in Runtime to address the properties of the picture which contains the currently focussed object.
Example:
The following example assigns the name of the current picture to the tag "strScrName" and outputs it in a message:
'VBS68 Dim strScrName strScrName = HMIRuntime.ActiveScreen.Objectname MsgBox strScrName
See also
Screen Object (Page140) HMIRuntime Object (Page125)
278
Usage
"ActiveScreenItem" is used in Runtime in order to address the properties of the object currently in focus.
Example:
The following example displays the name of the object in the "ScreenWindow1" picture which has the focus:
'VBS69 Dim objScreen Set objScreen = HMIRuntime.Screens("ScreenWindow1") MsgBox objScreen.ActiveScreenItem.ObjectName
See also
ScreenItem Object (Page134) HMIRuntime Object (Page125)
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
279
See also
Polyline (Page170) Polygon (Page168) ScreenItem Object (Page134)
See also
Polyline (Page170) Polygon (Page168) ScreenItem Object (Page134)
280
See also
Button (Page214) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) I/O Field (Page196) ScreenItem Object (Page134)
See also
Picture Window (Page191) ScreenItem Object (Page134)
See also
Picture Window (Page191) ScreenItem Object (Page134)
281
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
Alarms object (list) (Page116)
See also
Bar (Page188) ScreenItem Object (Page134)
282
See also
HMIRuntime Object (Page125)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
283
See also
Group Display (Page208) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
See also
Group Display (Page208) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
284
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name AllServer.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
285
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
286
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
Application Window (Page186) ScreenItem Object (Page134)
287
FALSE
The attribute can be assigned dynamic properties by means of the name ApplyProjectSettings.
See also
WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
288
See also
Text list (Page210) ScreenItem Object (Page134)
See also
I/O Field (Page196) Text list (Page210) ScreenItem Object (Page134)
See also
I/O Field (Page196) ScreenItem Object (Page134)
289
The attribute can be assigned dynamic properties by means of the name AutoCompleteColumns.
The attribute can be assigned dynamic properties by means of the name AutoCompleteRows.
The attribute can be assigned dynamic properties by means of the name AutoPosition.
290
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
291
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
FALSE
The attribute can be assigned dynamic properties by means of the name AutoScroll.
The attribute can be assigned dynamic properties by means of the name AutoSelectionColors.
292
The attribute can be assigned dynamic properties by means of the name AutoSelectionRectColors.
The attribute can be assigned dynamic properties by means of the name AutoShow.
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
293
See also
Bar (Page188) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
294
1.14.4.3 Ba
See also
ScreenItem Object (Page134) Button (Page214) Round Button (Page221) Slider (Page223) Group Display (Page208)
295
Example:
The following example defines the background of the "ScreenWindow1" picture to red:
'VBS70 Dim objScreen Set objScreen = HMIRuntime.Screens("ScreenWindow1") objScreen.BackColor = RGB(255, 0, 0)
See also
FillStyle Property (Page369) FillColor Property (Page368) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) Bar (Page188)
296
See also
Slider (Page223) ScreenItem Object (Page134)
See also
Slider (Page223) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
297
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
298
See also
HMI Symbol Library 1.4.1 (Page233) WinCC Slider Control (Page259) WinCC Gauge Control (Page243) WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
299
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
300
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
Status display (Page212) ScreenItem Object (Page134)
See also
Status display (Page212) ScreenItem Object (Page134)
301
See also
Status display (Page212) ScreenItem Object (Page134)
See also
Status display (Page212) ScreenItem Object (Page134)
command. When reading out the "BaseScreenName" property, only the picture name without server prefix is returned.
302
Example:
The following example executes a picture change to "bild1.pdl":
HMIRuntime.BaseScreenName = "bild1"
See also
ScreenItem Object (Page134) HMIRuntime Object (Page125)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
303
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
304
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) WinCC Function Trend Control (before WinCC V7) (Page267)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
305
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
306
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
Text list (Page210) ScreenItem Object (Page134)
See also
HMI Symbol Library 1.4.1 (Page233) ScreenItem Object (Page134)
307
See also
HMI Symbol Library 1.4.1 (Page233) ScreenItem Object (Page134)
See also
HMI Symbol Library 1.4.1 (Page233) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name BlockAlign.
308
The attribute can be assigned dynamic properties by means of the name BlockAutoPrecisions.
The attribute can be assigned dynamic properties by means of the name BlockDateFormat.
309
The attribute can be assigned dynamic properties by means of the name BlockExponentialFormat.
The attribute can be assigned dynamic properties by means of the name BlockHideText.
The attribute can be assigned dynamic properties by means of the name BlockHideTitleText.
310
The attribute can be assigned dynamic properties by means of the name BlockShowDate.
The attribute can be assigned dynamic properties by means of the name BlockShowIcon.
The attribute can be assigned dynamic properties by means of the name BlockShowTitleIcon.
311
The attribute can be assigned dynamic properties by means of the name BlockTimeFormat.
The attribute can be assigned dynamic properties by means of the name BlockUseSouceFormat.
See also
ScreenItem Object (Page134)
312
See also
ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) Button (Page214) Round Button (Page221)
See also
Button (Page214) Round Button (Page221) ScreenItem Object (Page134)
313
See also
Polyline (Page170) Line (Page166) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
314
See also
ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
See also
Connector (Page180) ScreenItem Object (Page134)
315
See also
Connector (Page180) ScreenItem Object (Page134)
See also
Radio box (Page219) Check box (Page217) ScreenItem Object (Page134)
See also
Radio box (Page219) Check box (Page217) ScreenItem Object (Page134)
316
See also
Text list (Page210) I/O Field (Page196) ScreenItem Object (Page134)
See also
Slider (Page223) ScreenItem Object (Page134)
317
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
318
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) Group Display (Page208)
See also
Group Display (Page208) ScreenItem Object (Page134)
319
1.14.4.4 Ca - Cl
Controls
Defines or returns the text to be displayed on the label on the button or in the title bar (Online Trend Control and Online Table Control). Write/Read access.
See also
Controls (Page230) Picture Window (Page191) Application Window (Page186) ScreenItem Object (Page134)
320
See also
ScreenItem Object (Page134) WinCC Gauge Control (Page243)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
321
See also
Picture Window (Page191) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name CellCut.
322
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
323
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
324
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
325
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
326
See also
Bar (Page188) ScreenItem Object (Page134)
See also
I/O Field (Page196) ScreenItem Object (Page134)
See also
I/O Field (Page196) ScreenItem Object (Page134)
327
See also
WinCC Function Trend Control (before WinCC V7) (Page267) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name Closeable.
See also
Picture Window (Page191) Application Window (Page186) ScreenItem Object (Page134)
328
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
329
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
330
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
331
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Slider (Page223) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
332
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
333
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
334
See also
Slider (Page223) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
335
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name ColumnAlign.
336
The attribute can be assigned dynamic properties by means of the name ColumnDateFormat.
The attribute can be assigned dynamic properties by means of the name ColumnExponentialFormat.
337
The attribute can be assigned dynamic properties by means of the name ColumnFlagUnique.
The attribute can be assigned dynamic properties by means of the name ColumnHideText.
The attribute can be assigned dynamic properties by means of the name ColumnHideTitleText.
338
The attribute can be assigned dynamic properties by means of the name ColumnLeadingZeros.
339
The attribute can be assigned dynamic properties by means of the name ColumnResize.
340
The attribute can be assigned dynamic properties by means of the name ColumnShowDate.
The attribute can be assigned dynamic properties by means of the name ColumnShowIcon.
The attribute can be assigned dynamic properties by means of the name ColumnShowTitleIcon.
341
The attribute can be assigned dynamic properties by means of the name ColumnSort .
The attribute can be assigned dynamic properties by means of the name ColumnTimeFormat.
342
The attribute can be assigned dynamic properties by means of the name ColumnTitleAlign.
The attribute can be assigned dynamic properties by means of the name ColumnTitles.
The attribute can be assigned dynamic properties by means of the name ColumnVisible .
343
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
See also
Alarms object (list) (Page116)
See also
WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
344
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267)
See also
Alarms object (list) (Page116)
345
See also
Alarms object (list) (Page116)
The attribute can be assigned dynamic properties by means of the name ConnectTrendWindows.
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
346
Example:
The example shows how the number of objects in a DataSet list is output.
'VBS165 HMIRuntime.Trace "Count: " & HMIRuntime.DataSet.Count & vbNewLine
The following example adds two tags to the TagSet list and outputs the count properties as Trace.
'VBS177 Dim group Set group = HMIRuntime.Tags.CreateTagSet group.Add "Motor1" group.Add "Motor2" HMIRuntime.Trace "Count: " & group.Count & vbNewLine
See also
CreateTagSet Method (Page644) TagSet Object (List) (Page151) ScreenItems Object (List) (Page138) Screens Object (List) (Page143) Layers Object (Listing) (Page129) DataSet-Objekt (List) (Page122) ProcessValues Object (List) (Page132)
347
See also
HMIRuntime Object (Page125)
See also
ScreenItem Object (Page134) HMI Symbol Library 1.4.1 (Page233)
See also
Text list (Page210) I/O Field (Page196) ScreenItem Object (Page134)
348
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
349
1.14.4.5 Da
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
350
See also
I/O Field (Page196) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
DataLogs Object (Page121) HMIRuntime Object (Page125)
See also
DataSet-Objekt (List) (Page122) HMIRuntime Object (Page125)
351
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
Example: Calling Methods of an ActiveX Control (Page748) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
352
The attribute can be assigned dynamic properties by means of the name DefaultSort.
353
The attribute can be assigned dynamic properties by means of the name DefaultSort2.
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
354
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
355
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
356
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
357
See also
Slider (Page223) Bar (Page188) 3D Bar (Page182) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name DisplayOptions.
358
The attribute can be assigned dynamic properties by means of the name DoubleClickAction.
1.14.4.6
See also
WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
See also
WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
359
See also
Text list (Page210) I/O Field (Page196) ScreenItem Object (Page134)
Example:
The following example disables all objects in the picture "NewPDL1":
'VBS71 Dim objScreen Dim objScrItem Dim lngIndex Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count strName = objScreen.ScreenItems.Item(lngIndex).ObjectName 'Read names of objects Set objScrItem = objScreen.ScreenItems(strName) objScrItem.Enabled=False 'Lock object Next
See also
Screen Object (Page140) ScreenItem Object (Page134)
360
The attribute can be assigned dynamic properties by means of the name EnableDelete.
The attribute can be assigned dynamic properties by means of the name EnableEdit.
The attribute can be assigned dynamic properties by means of the name EnableInsert.
361
See also
Pie segment (Page164) Circular arc (Page162) Ellipse segment (Page158) Ellipse arc (Page156) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
362
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
In order that ErrorDescription returns a value, a read process must be executed beforehand. If an error occurs during read or write of several tags using the TagSet object, the error is set to "Multi Tag Error". In order to determine at which tag the error occurred and what type of error it was, the ErrorDescription property of each tag must be analyzed.
363
Example:
The following example displays the error description for "Tag1":
'VBS72 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") objtag.Read MsgBox objTag.ErrorDescription
The following example adds two tags to the TagSet list and outputs the ErrorDescription property as Trace.
'VBS179 Dim group Set group = HMIRuntime.Tags.CreateTagSet group.Add "Motor1" group.Add "Motor2" HMIRuntime.Trace "ErrorDescription: " & group.ErrorDescription & vbNewLine
The ErrorDescription property of a tag contained in the list may be accessed as follows:
HMIRuntime.Trace "ErrorDescription: " & group("Motor1").ErrorDescription & vbNewLine
See also
LastError Property (Page407) QualityCode Property (Page487) TagSet Object (List) (Page151) Tag Object (Page146)
See also
Bar (Page188) ScreenItem Object (Page134)
364
The attribute can be assigned dynamic properties by means of the name ExportDirectoryChangeable.
365
The attribute can be assigned dynamic properties by means of the name ExportFilenameChangeable.
The attribute can be assigned dynamic properties by means of the name ExportSelection.
The attribute can be assigned dynamic properties by means of the name ExportShowDialog.
366
See also
Slider (Page223) ScreenItem Object (Page134)
Example:
Activates ExtendedZooming for picture NewPDL1.
'VBS155 Dim objScreen Set objScreen = HMIRuntime.Screens("NewPDL1") objScreen.ExtendedZoomingEnable = 1
See also
Screen Object (Page140)
367
1.14.4.7 Fi - Fl
Example:
The following example defines the fill color for "ScreenWindow1" to blue:
'VBS73 Dim objScreen Set objScreen = HMIRuntime.Screens("ScreenWindow1") objScreen.FillStyle = 131075 objScreen.FillColor = RGB(0, 0, 255)
See also
FillStyle Property (Page369) BackColor Property (Page295) ScreenItem Object (Page134)
368
See also
ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
369
Example:
The following example sets the fill pattern for "ScreenWindow1" to transparent:
'VBS190 Dim myScr Set myScr = HMIRuntime.Screens("PictureWindow1") myScr.FillStyle = 65536
See also
FillColor Property (Page368) BackColor Property (Page295) Screen Object (Page140)
370
See also
Bar (Page188) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
371
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
372
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
See also
Status display (Page212) ScreenItem Object (Page134)
373
See also
I/O Field (Page196) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) ScreenItem Object (Page134)
See also
Status display (Page212) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) Status display (Page212)
374
See also
Status display (Page212) ScreenItem Object (Page134)
See also
Status display (Page212) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
375
See also
ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
See also
Status display (Page212) ScreenItem Object (Page134)
376
See also
Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
See also
HMI Symbol Library 1.4.1 (Page233) ScreenItem Object (Page134)
377
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
378
Example:
'VBS74 Dim objControl1 Dim objControl2 Set objControl1 = ScreenItems("Control1") Set objControl2 = ScreenItems("Control2") objControl2.Font = objControl1.Font ' take over only the type of font
379
See also
WinCC Slider Control (Page259) WinCC Push Button Control (Page253) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) WinCC Digital/Analog Clock (Page239) WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) Group Display (Page208) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) Bar (Page188) ScreenItem Object (Page134)
380
See also
WinCC Push Button Control (Page253) Group Display (Page208) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) Group Display (Page208) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) Bar (Page188) ScreenItem Object (Page134)
381
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) Group Display (Page208) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) Bar (Page188) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
382
See also
WinCC Push Button Control (Page253) Group Display (Page208) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) WinCC Push Button Control (Page253) WinCC Digital/Analog Clock (Page239) HMI Symbol Library 1.4.1 (Page233) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
383
See also
Text list (Page210) Static text (Page178) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
See also
Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
384
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
385
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
1.14.4.8
386
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
True type fonts must be used within the trend window if "From the top" or "From the bottom" is selected for writer orientation. Only this setting ensures legibility of the labeling of the vertical axis.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
387
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
388
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
389
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
1.14.4.9 Ha - Hi
390
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
Example:
The following example halves the height of all objects in the "NewPDL1" picture whose names begin with "Circle":
'VBS75
391
Dim objScreen Dim objCircle Dim lngIndex Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count ' 'Searching all circles strName = objScreen.ScreenItems.Item(lngIndex).ObjectName If "Circle" = Left(strName, 6) Then ' 'to halve the height of the circles Set objCircle = objScreen.ScreenItems(strName) objCircle.Height = objCircle.Height / 2 End If Next
See also
Width Property (Page626) Object Types of the ScreenItem Object (Page152) ScreenItem Object (Page134)
See also
I/O Field (Page196) ScreenItem Object (Page134)
392
393
The attribute can be assigned dynamic properties by means of the name HitlistColumnSort .
394
The attribute can be assigned dynamic properties by means of the name HitlistDefaultSort.
The attribute can be assigned dynamic properties by means of the name HitListMaxSourceItemsWarn.
395
The attribute can be assigned dynamic properties by means of the name HitListRelTime.
396
If you do not wish to define a time period for the statistics set the time factor "HitlistRelTimeFactor" to "0".
The attribute can be assigned dynamic properties by means of the name HitListMaxRelTimeFactorType.
The attribute can be assigned dynamic properties by means of the name HorizontalGridLines.
397
See also
Button (Page214) ScreenItem Object (Page134)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
398
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
399
WinCC online trend control, WinCC online table control, WinCC function trend control
The "Index" property is evaluated by other properties in order to be able to assign the settings to a specific trend or column pair. The valid values for the index move within the range from 0 to (NumItems - 1). The "NumItems" properties contains the number of the trends/column pairs to be displayed. The index must always be set before you change the properties of a trend / column in runtime.
Status display
Defines the status (0 to 255) or returns it. A basic picture and flash picture can be defined for each status value.
See also
Status display (Page212) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) Polyline (Page170) Polygon (Page168) Radio box (Page219) Check box (Page217) ScreenItem Object (Page134)
400
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
401
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
Alarms object (list) (Page116)
402
See also
Text list (Page210) ScreenItem Object (Page134)
See also
Text list (Page210) ScreenItem Object (Page134)
See also
Text list (Page210) ScreenItem Object (Page134)
403
See also
Text list (Page210) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
404
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
405
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
Text list (Page210) ScreenItem Object (Page134)
Example:
The following example sets the data language to German:
'VBS76
406
HMIRuntime.Language = 1031
See also
HMIRuntime Object (Page125)
In order that LastError returns a value, a read must be executed beforehand. If an error occurs during read or write of several tags using the TagSet object, the error is set to "Multi Tag Error". In order to determine at which tag the error occurred and what type of error it was, the LastError property of each tag must be analyzed.
Example:
The following example displays the error code for "Tag1":
'VBS77 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") objTag.Read MsgBox objTag.LastError
The following example adds two tags to the TagSet list and outputs the LastError property as Trace.
'VBS178
407
Dim group Set group = HMIRuntime.Tags.CreateTagSet group.Add "Motor1" group.Add "Motor2" HMIRuntime.Trace "LastError: " & group.LastError & vbNewLine
The LastError property of a tag contained in the list may be accessed as follows:
HMIRuntime.Trace "LastError: " & group("Motor1").LastError & vbNewLine
See also
TagSet Object (List) (Page151) QualityCode Property (Page487) ErrorDescription Property (Page363) Tag Object (Page146)
Example:
The following example displays the name and layer of all the objects in the picture "NewPDL1":
'VBS78
408
Dim objScreen Dim objScrItem Dim lngAnswer Dim lngIndex Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count strName = objScreen.ScreenItems.Item(lngIndex).ObjectName Set objScrItem = objScreen.ScreenItems(strName) lngAnswer = MsgBox(strName & " is in layer " & objScrItem.Layer,vbOKCancel) If vbCancel = lngAnswer Then Exit For Next
See also
ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
409
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
410
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
411
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
412
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
413
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
414
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
415
Layer00FillColor property
The "Layer00FillColor" attribute defines the color with which the bar is filled in relation to "Limit 0". The "Layer00FillColor" attribute can be made dynamic with the name "Layer00FillColor".
Layer01FillColor property
The "Layer01FillColor" attribute defines the color with which the bar is filled in relation to "Limit 1". The "Layer01FillColor" attribute can be made dynamic with the name "Layer01FillColor".
Layer02FillColor property
The "Layer02FillColor" attribute defines the color with which the bar is filled in relation to "Limit 2". The "Layer02FillColor" attribute can be made dynamic with the name "Layer02FillColor".
Layer03FillColor property
The "Layer03FillColor" attribute defines the color with which the bar is filled in relation to "Limit 3". The "Layer03FillColor" attribute can be made dynamic with the name "Layer03FillColor".
Layer04FillColor property
The "Layer04FillColor" attribute defines the color with which the bar is filled in relation to "Limit 4". The "Layer04FillColor" attribute can be made dynamic with the name "Layer04FillColor".
Layer05FillColor property
The "Layer05FillColor" attribute defines the color with which the bar is filled in relation to "Limit 5". The "Layer05FillColor" attribute can be made dynamic with the name "Layer05FillColor".
Layer06FillColor property
The "Layer06FillColor" attribute defines the color with which the bar is filled in relation to "Limit 6". The "Layer06FillColor" attribute can be made dynamic with the name "Layer06FillColor".
Layer07FillColor property
The "Layer07FillColor" attribute defines the color with which the bar is filled in relation to "Limit 7".
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
416
Layer08FillColor property
The "Layer08FillColor" attribute defines the color with which the bar is filled in relation to "Limit 8". The "Layer08FillColor" attribute can be made dynamic with the name "Layer08FillColor".
Layer09FillColor property
The "Layer09FillColor" attribute defines the color with which the bar is filled in relation to "Limit 9". The "Layer09FillColor" attribute can be made dynamic with the name "Layer09FillColor".
Layer10FillColor property
The "Layer10FillColor" attribute defines the color with which the bar is filled in relation to "Limit 10". The "Layer10FillColor" attribute can be made dynamic with the name "Layer10FillColor".
Layer00FillStyle property
The "Layer00FillStyle" attribute defines the style of the bar in relation to "Limit 0". For the fill pattern to become visible, "bar fill color 0" must differ from "bar color 0". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer00FillStyle" attribute can be made dynamic with the name "Layer00FillStyle".
Layer01FillStyle property
The "Layer01FillStyle" attribute defines the style of the bar in relation to "Limit 1". For the fill pattern to become visible, "bar fill color 1" must differ from "bar color 1". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer01FillStyle" attribute can be made dynamic with the name "Layer01FillStyle".
Layer02FillStyle property
The "Layer02FillStyle" attribute defines the style of the bar in relation to "Limit 2". For the fill pattern to become visible, "bar fill color 2" must differ from "bar color 2". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer02FillStyle" attribute can be made dynamic with the name "Layer02FillStyle".
417
Layer03FillStyle property
The "Layer03FillStyle" attribute defines the style of the bar in relation to "Limit 3". For the fill pattern to become visible, "bar fill color 3" must differ from "bar color 3". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer03FillStyle" attribute can be made dynamic with the name "Layer03FillStyle".
Layer04FillStyle property
The "Layer04FillStyle" attribute defines the style of the bar in relation to "Limit 4". For the fill pattern to become visible, "bar fill color 4" must differ from "bar color 4". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer04FillStyle" attribute can be made dynamic with the name "Layer04FillStyle".
Layer05FillStyle property
The "Layer05FillStyle" attribute defines the style of the bar in relation to "Limit 5". For the fill pattern to become visible, "bar fill color 5" must differ from "bar color 5". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer05FillStyle" attribute can be made dynamic with the name "Layer05FillStyle".
Layer06FillStyle property
The "Layer06FillStyle" attribute defines the style of the bar in relation to "Limit 6". For the fill pattern to become visible, "bar fill color 6" must differ from "bar color 6". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer06FillStyle" attribute can be made dynamic with the name "Layer06FillStyle".
Layer07FillStyle property
The "Layer07FillStyle" attribute defines the style of the bar in relation to "Limit 7". For the fill pattern to become visible, "bar fill color 7" must differ from "bar color 7". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer07FillStyle" attribute can be made dynamic with the name "Layer07FillStyle".
Layer08FillStyle property
The "Layer08FillStyle" attribute defines the style of the bar in relation to "Limit 8". For the fill pattern to become visible, "bar fill color 8" must differ from "bar color 8".
418
Layer09FillStyle property
The "Layer09FillStyle" attribute defines the style of the bar in relation to "Limit 9". For the fill pattern to become visible, "bar fill color 9" must differ from "bar color 9". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer09FillStyle" attribute can be made dynamic with the name "Layer09FillStyle".
Layer10FillStyle property
The "Layer10FillStyle" attribute defines the style of the bar in relation to "Limit 10". For the fill pattern to become visible, "bar fill color 10" must differ from "bar color 10". There is a choice of 50 fill styles. The 0 "Solid" fill style fills the object with the set background color. The 1 "Transparent" fill style means neither a background nor a fill pattern is displayed. The "Layer10FillStyle" attribute can be made dynamic with the name "Layer10FillStyle".
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
419
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
420
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) 3D Bar (Page182)
See also
3D Bar (Page182) ScreenItem Object (Page134)
421
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
Example:
The example outputs the LayerDecluttering Property NewPDL1 as a trace.
'VBS156 Dim objScreen Set objScreen = HMIRuntime.Screens("NewPDL1") HMIRuntime.Trace "Enable: " & objScreen.LayerDeclutteringEnable & vbNewLine
422
See also
Screen Object (Page140)
See also
Layers Object (Listing) (Page129) HMIRuntime Object (Page125)
Example:
The following example shifts all objects in the picture "NewPDL1" 5 pixels to the left:
'VBS79 Dim objScreen Dim objScrItem Dim lngIndex Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count strName = objScreen.ScreenItems.Item(lngIndex).ObjectName Set objScrItem = objScreen.ScreenItems(strName) objScrItem.Left = objScrItem.Left - 5 Next
423
See also
Top Property (Page575) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
3D Bar (Page182) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
424
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
425
See also
I/O Field (Page196) ScreenItem Object (Page134)
See also
I/O Field (Page196) ScreenItem Object (Page134)
426
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
427
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
Text list (Page210) ScreenItem Object (Page134)
428
The attribute can be assigned dynamic properties by means of the name LoadDataImmediately.
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
429
See also
WinCC Slider Control (Page259) WinCC Gauge Control (Page243) WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
430
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
HMIRuntime Object (Page125) Logging Object (Page130)
See also
Bar (Page188) ScreenItem Object (Page134)
431
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
432
LowerLimit Property Description WinCC Online Trend Control/WinCC Function Trend Control
TRUE, when the "LowerLimitColor" specification is to be used in order to identify the tag values (from a trend referenced via "Index") which lie below the value defined in "LowerLimitValue". BOOLEAN write-read access.
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
433
LowerLimitColor Property Description WinCC Online Trend Control/WinCC Function Trend Control
Defines the color to be used in order to identify the tag values (from trend referenced via "Index") which lie below the value defined in "LowerLimitValue". Whether the information is evaluated is dependent on the value of the "LowerLimit" property. The color is defined as an RGB value. LONG write-read access.
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
LowerLimitValue Property Description WinCC Online Trend Control/WinCC Function Trend Control
Tag values (from a trend referenced via "Index") which lie below the value defined by "LowerLimitValue" are identified by the color specified in "LowerLimitColor". Whether the information is evaluated is dependent on the value of the "LowerLimit" attribute.
434
See also
WinCC Function Trend Control (before WinCC V7) (Page267) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) Slider (Page223) 3D Bar (Page182) ScreenItem Object (Page134)
435
See also
Picture Window (Page191) Application Window (Page186) ScreenItem Object (Page134)
MCGUBackColorOff-Eigenschaft Description
Defines or returns the background color for flash status "Off" in the case of the "Departed Unacknowledged" status. LONG write-read access.
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
436
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
437
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
438
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
439
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
440
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
441
See also
Picture Window (Page191) HMIRuntime Object (Page125)
The attribute can be assigned dynamic properties by means of the name MessageBlockAlign.
The attribute can be assigned dynamic properties by means of the name MessageBlockAutoPrecisions.
442
The attribute can be assigned dynamic properties by means of the name MessageBlockDateFormat.
The attribute can be assigned dynamic properties by means of the name MessageBlockExponentialFormat.
443
The attribute can be assigned dynamic properties by means of the name MessageBlockFlashOn.
The attribute can be assigned dynamic properties by means of the name MessageBlockHideText.
The attribute can be assigned dynamic properties by means of the name MessageBlockHideTitleText.
444
445
The attribute can be assigned dynamic properties by means of the name MessageBlockShowDate.
The attribute can be assigned dynamic properties by means of the name MessageBlockShowIcon.
The attribute can be assigned dynamic properties by means of the name MessageBlockShowTitleIcon.
446
See also
Group Display (Page208) ScreenItem Object (Page134)
447
The attribute can be assigned dynamic properties by means of the name MessageColumnSort .
448
2 3 4 5
The attribute can be assigned dynamic properties by means of the name MessageListType.
449
See also
Slider (Page223) Bar (Page188) 3D Bar (Page182) ScreenItem Object (Page134)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
450
See also
Picture Window (Page191) Application Window (Page186) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name Moveable.
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
451
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
Tags
The tag "Name" property is used to address the tag via the tag list. The name of a tag can contain a server prefix. In WinCC, tag names are structured according to the following scheme: <Serverprefix>::<Variablenprefix><Name der Variable> If the tag name alone is specified, the server prefix and tag prefix are removed from the context of the picture. If the tag is specified with a server prefix in the tag name, the tags and server prefix of the context are ignored and the server prefix included is used.
452
Example:
The following example returns the name of the current Runtime project as Trace:
'VBS160 HMIRuntime.Trace "Name: " & HMIRuntime.ActiveProject.Name & vbNewLine
See also
ActiveProject Property (Page278) WinCC Function Trend Control (before WinCC V7) (Page267) Tag Object (Page146) Ellipse segment (Page158) Layer Object (Page127) DataItem Object (Page119)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
453
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
Text list (Page210) ScreenItem Object (Page134)
454
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
Example:
Address the properties of an external control supplier as follows: Control.object.type If the following form alone is used Control.type the properties of the ScreenItem object are used in the case of identical names.
See also
Controls (Page230) ScreenItem Object (Page134)
455
Example:
The following example issues the names of all the objects contained in the picture "NewPDL1":
'VBS80 Dim objScreen Dim lngIndex Dim lngAnswer Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count strName = objScreen.ScreenItems.Item(lngIndex).ObjectName lngAnswer = MsgBox("Name of object " & lngIndex & ": " & strName, vbOKCancel) If vbCancel = lngAnswer Then Exit For Next
Pictures
Establish the picture name directly from the "ObjectName" property:
'VBS81 MsgBox "Screenname: " & HMIRuntime.ActiveScreen.ObjectName
See also
Screen Object (Page140) ScreenItem Object (Page134)
456
Example:
The example outputs the Decluttering Properties of the picture NewPDL1 as a trace.
'VBS157 Dim objScreen Set objScreen = HMIRuntime.Screens("NewPDL1") HMIRuntime.Trace "Min: " & objScreen.ObjectSizeDeclutteringMin & vbNewLine HMIRuntime.Trace "Max: " & objScreen.ObjectSizeDeclutteringMax & vbNewLine HMIRuntime.Trace "Enable: " & objScreen.LayerDeclutteringEnable & vbNewLine
See also
Screen Object (Page140)
Example:
The example outputs the Decluttering Properties of the picture NewPDL1 as a trace.
'VBS157 Dim objScreen Set objScreen = HMIRuntime.Screens("NewPDL1") HMIRuntime.Trace "Min: " & objScreen.ObjectSizeDeclutteringMin & vbNewLine HMIRuntime.Trace "Max: " & objScreen.ObjectSizeDeclutteringMax & vbNewLine HMIRuntime.Trace "Enable: " & objScreen.LayerDeclutteringEnable & vbNewLine
See also
Screen Object (Page140)
457
Example:
The example outputs the Decluttering Properties of the picture NewPDL1 as a trace.
'VBS157 Dim objScreen Set objScreen = HMIRuntime.Screens("NewPDL1") HMIRuntime.Trace "Min: " & objScreen.ObjectSizeDeclutteringMin & vbNewLine HMIRuntime.Trace "Max: " & objScreen.ObjectSizeDeclutteringMax & vbNewLine HMIRuntime.Trace "Enable: " & objScreen.LayerDeclutteringEnable & vbNewLine
See also
Screen Object (Page140)
See also
ScrollPositionY Property (Page502) ScrollPositionX Property (Page502) Picture Window (Page191) ScreenItem Object (Page134)
458
See also
ScrollPositionY Property (Page502) ScrollPositionX Property (Page502) Picture Window (Page191) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267)
459
See also
Picture Window (Page191) Application Window (Page186) ScreenItem Object (Page134)
See also
Slider (Page223) Text list (Page210) Radio box (Page219) Check box (Page217) I/O Field (Page196) ScreenItem Object (Page134)
460
See also
Slider (Page223) Text list (Page210) I/O Field (Page196) ScreenItem Object (Page134)
461
462
463
464
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType1.
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType2.
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType3.
465
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType4.
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType5.
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType6.
466
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType7.
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType8.
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType9.
467
The attribute can be assigned dynamic properties by means of the name OperatorMessageSourceType10.
See also
Connector (Page180) Static text (Page178) Text list (Page210) Radio box (Page219) Check box (Page217) Button (Page214) I/O Field (Page196) ScreenItem Object (Page134)
468
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
See also
I/O Field (Page196) ScreenItem Object (Page134)
469
See also
Text list (Page210) I/O Field (Page196) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name PageMode.
470
Usage
The Parent property can be used as often as required within an object hierarchy. The following section provides a systematic description of how to access all the elements in a hierarchy:
471
Example:
In the following example, the object name of the Parent object is displayed:
'VBS120 Dim objCircle Set objCircle = HMIRuntime.Screens("ScreenWindow1").ScreenItems("Circle1") MsgBox objCircle.Parent.ObjectName
See also
Picture Window (Page191) Screen Object (Page140) Objects and Lists (Page113)
See also
ScreenItem Object (Page134)
472
Example:
The following example returns the project path as Trace:
'VBS161 HMIRuntime.Trace "Path: " & HMIRuntime.ActiveProject.Path & vbNewLine
See also
Project Object (Page133)
The attribute can be assigned dynamic properties by means of the name PercentageAxis.
473
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
474
See also
WinCC Alarm Control (before WinCC V7) (Page265) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
475
Pi PicDeactReferenced-Eigenschaft Description
TRUE, when the picture assigned for the "Disable" status should be saved in the RoundButton object. Otherwise, only the associated object reference is saved. Read only access.
See also
Round Button (Page221) ScreenItem Object (Page134)
See also
Round Button (Page221) ScreenItem Object (Page134)
See also
Round Button (Page221) ScreenItem Object (Page134)
476
See also
Round Button (Page221) ScreenItem Object (Page134)
See also
Round Button (Page221) ScreenItem Object (Page134)
See also
Round Button (Page221) ScreenItem Object (Page134)
477
See also
Graphic Object (Page200) ScreenItem Object (Page134)
See also
Graphic Object (Page200) ScreenItem Object (Page134)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
478
See also
Round Button (Page221) ScreenItem Object (Page134)
See also
Button (Page214) Round Button (Page221) ScreenItem Object (Page134)
See also
Round Button (Page221) Button (Page214) ScreenItem Object (Page134)
479
See also
Graphic Object (Page200) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
480
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
See also
Round Button (Page221) ScreenItem Object (Page134)
See also
Round Button (Page221) ScreenItem Object (Page134)
See also
Round Button (Page221) ScreenItem Object (Page134)
481
See also
Graphic Object (Page200) ScreenItem Object (Page134)
See also
Polyline (Page170) Polygon (Page168) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
482
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
483
See also
ScreenItem Object (Page134) 3D Bar (Page182)
See also
Round Button (Page221) ScreenItem Object (Page134)
484
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
Slider (Page223) Radio box (Page219) Check box (Page217) Bar (Page188) 3D Bar (Page182) ScreenItem Object (Page134)
See also
Alarms object (list) (Page116)
485
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
486
Example:
The following example indicates the quality of the read value when no errors have occurred during the reading process:
'VBS83 Dim objTag Dim lngLastErr Set objTag = HMIRuntime.Tags("Tag1") objTag.Read lngLastErr = objTag.LastError If 0 = lngLastErr Then MsgBox objTag.QualityCode End If
See also
LastError Property (Page407) ErrorDescription Property (Page363) Tag Object (Page146)
487
See also
Pie segment (Page164) Circular arc (Page162) Circle (Page160) Round Button (Page221) ScreenItem Object (Page134)
See also
Ellipse segment (Page158) Ellipse arc (Page156) Ellipse (Page154) ScreenItem Object (Page134)
488
See also
Ellipse segment (Page158) Ellipse arc (Page156) Ellipse (Page154) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
489
See also
ScreenItem Object (Page134) WinCC Gauge Control (Page243)
See also
Line (Page166) Polyline (Page170) Polygon (Page168) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) Line (Page166) Polyline (Page170) Polygon (Page168)
490
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
491
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
HMI Symbol Library 1.4.1 (Page233) ScreenItem Object (Page134)
492
T-piece
Defines or returns the orientation of a T-piece in degrees. The attribute can assume one of four values. If you enter another value, it is automatically converted to modulus 360 and rounded up or down to the closest permissible value. The orientation is produced by rotating the T-piece clockwise around the center point by the specified number of degrees. 0 90 180 270 The standard position of the T-piece is the shape of the letter "T" The "leg" of the "T" points towards the left The "leg" of the "T" points upwards The "leg" of the "T" points to the right
See also
Line (Page166) Polyline (Page170) Polygon (Page168) ScreenItem Object (Page134)
493
See also
Rounded rectangle (Page175) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name RowScrollbar.
The attribute can be assigned dynamic properties by means of the name RowTitleAlign.
494
The attribute can be assigned dynamic properties by means of the name RowTitles.
The attribute can be assigned dynamic properties by means of the name RTPersistence.
495
The attribute can be assigned dynamic properties by means of the name RTPersistenceType.
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
496
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
"Statistics" window
The attribute can be assigned dynamic properties by means of the name RulerType.
497
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
498
See also
Bar (Page188) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) Bar (Page188) ScreenItem Object (Page134)
499
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
Picture Window (Page191) ScreenItem Object (Page134)
500
Example:
The following example accesses the picture "NewPDL1":
'VBS84 Dim objScreen Set objScreen = HMIRuntime.Screens("NewPDL1")
See also
Screens Object (List) (Page143) Screen Object (Page140) HMIRuntime Object (Page125)
Example:
The following example issues the number of all the objects contained in the picture "NewPDL1":
'VBS85 Dim objScreen Set objScreen = HMIRuntime.Screens("NewPDL1") Msgbox objScreen.ScreenItems.Count
See also
ScreenItems Object (List) (Page138) HMIRuntime Object (Page125)
501
See also
Picture Window (Page191) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) OffsetTop Property (Page458) OffsetLeft Property (Page458) Picture Window (Page191)
502
See also
OffsetTop Property (Page458) OffsetLeft Property (Page458) Picture Window (Page191) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) WinCC Digital/Analog Clock (Page239)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
503
See also
Text list (Page210) ScreenItem Object (Page134)
504
The attribute can be assigned dynamic properties by means of the name SelectionColoring.
505
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name SelectionRect.
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
506
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
507
The attribute can be assigned dynamic properties by means of the name SelectionType.
See also
Text list (Page210) ScreenItem Object (Page134)
508
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
Picture Window (Page191) ScreenItem Object (Page134)
509
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
510
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
511
The attribute can be assigned dynamic properties by means of the name ShowRuler.
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name ShowRulerInAxis.
512
The attribute can be assigned dynamic properties by means of the name ShowScrollbars.
The attribute can be assigned dynamic properties by means of the name ShowSortButton .
The attribute can be assigned dynamic properties by means of the name ShowSortIcon.
513
The attribute can be assigned dynamic properties by means of the name ShowStatisticRuler.
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
514
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
515
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name Sizeable.
516
The attribute can be assigned dynamic properties by means of the name SkinName.
See also
Slider (Page223) ScreenItem Object (Page134)
See also
SmartTags Object (Page145)
517
The attribute can be assigned dynamic properties by means of the name SortSequence.
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
518
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
519
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
520
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
521
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
522
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
523
See also
Pie segment (Page164) Circular arc (Page162) Ellipse segment (Page158) Ellipse arc (Page156) ScreenItem Object (Page134)
See also
Alarms object (list) (Page116)
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
524
The attribute can be assigned dynamic properties by means of the name StatusbarElementAutoSize.
525
526
527
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name StatusbarShowTooltips.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
528
The attribute can be assigned dynamic properties by means of the name StatusbarUseBackColor.
The attribute can be assigned dynamic properties by means of the name StatusbarVisible .
See also
HMI Symbol Library 1.4.1 (Page233) ScreenItem Object (Page134)
529
530
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
Picture Window (Page191) ScreenItem Object (Page134)
531
Example:
The following example accesses the tag "Tag1":
'VBS86 Dim objTag Set objTag = HMIRuntime.Tags("Tag1")
See also
Tags Object (List) (Page149) HMIRuntime Object (Page125)
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
532
See also
ScreenItem Object (Page134) Application Window (Page186)
See also
Radio box (Page219) Check box (Page217) Button (Page214) Static text (Page178) ScreenItem Object (Page134)
533
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
534
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
535
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) WinCC Gauge Control (Page243)
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
536
See also
WinCC Digital/Analog Clock (Page239) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
537
The attribute can be assigned dynamic properties by means of the name TimeAxisAlign.
538
The attribute can be assigned dynamic properties by means of the name TimeAxisDateFormat.
See also
WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
539
The attribute can be assigned dynamic properties by means of the name TimeAxisInTrendColor.
540
The attribute can be assigned dynamic properties by means of the name TimeAxisRangeType.
541
The attribute can be assigned dynamic properties by means of the name TimeAxisShowDate.
The attribute can be assigned dynamic properties by means of the name TimeAxisTimeFormat.
542
The attribute can be assigned dynamic properties by means of the name TimeAxisTimeRangeBase.
543
See also
WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name TimeBase.
The attribute can be assigned dynamic properties by means of the name TimeColumnActualize.
544
The attribute can be assigned dynamic properties by means of the name TimeColumnAlign.
See also
WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
545
The attribute can be assigned dynamic properties by means of the name TimeColumnDateFormat.
546
The attribute can be assigned dynamic properties by means of the name TimeColumnHideText.
547
548
The attribute can be assigned dynamic properties by means of the name TimeColumnRangeType.
549
The attribute can be assigned dynamic properties by means of the name TimeColumnShowDate.
The attribute can be assigned dynamic properties by means of the name TimeColumnShowIcon.
The attribute can be assigned dynamic properties by means of the name TimeColumnShowTitleIcon.
550
The attribute can be assigned dynamic properties by means of the name TimeColumnSort .
The attribute can be assigned dynamic properties by means of the name TimeColumnTimeFormat.
551
The attribute can be assigned dynamic properties by means of the name TimeColumnTimeRangeBase.
The attribute can be assigned dynamic properties by means of the name TimeColumnUseValueColumnColors.
552
See also
WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
553
See also
ScreenItem Object (Page134) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
554
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
555
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
556
Example:
'VBS87 Dim objTag Dim lngCount lngCount = 0 Set objTag = HMIRuntime.Tags("Tag11") objTag.Read SetLocale("en-gb") MsgBox FormatDateTime(objTag.TimeStamp) 'Output: e.g. 06/08/2002 9:07:50 MsgBox Year(objTag.TimeStamp) 'Output: e.g. 2002 MsgBox Month(objTag.TimeStamp) 'Output: e.g. 8 MsgBox Weekday(objTag.TimeStamp) 'Output: e.g. 3 MsgBox WeekdayName(Weekday(objTag.TimeStamp)) 'Output: e.g. Tuesday MsgBox Day(objTag.TimeStamp) 'Output: e.g. 6 MsgBox Hour(objTag.TimeStamp) 'Output: e.g. 9 MsgBox Minute(objTag.TimeStamp) 'Output: e.g. 7 MsgBox Second(objTag.TimeStamp) 'Output: e.g. 50 For lngCount = 0 To 4 MsgBox FormatDateTime(objTag.TimeStamp, lngCount) Next 'lngCount = 0: Output: e.g. 06/08/2002 9:07:50 'lngCount = 1: Output: e.g. 06 August 2002 'lngCount = 2: Output: e.g. 06/08/2002 'lngCount = 3: Output: e.g. 9:07:50 'lngCount = 4: Output: e.g. 9:07
Example:
The following example issues the time stamp of the tag "Tag1":
'VBS88 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") objTag.Read MsgBox objTag.TimeStamp
See also
Tag Object (Page146) Alarms object (list) (Page116)
557
The attribute can be assigned dynamic properties by means of the name TimeStepBase.
558
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name TitleCut .
559
560
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name TitleSort.
The attribute can be assigned dynamic properties by means of the name TitleStyle.
561
See also
Round Button (Page221) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
562
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name ToolbarAlignment.
563
The attribute can be assigned dynamic properties by means of the name ToolbarButtonActive.
The attribute can be assigned dynamic properties by means of the name ToolbarButtonBeginGroup.
564
565
The attribute can be assigned dynamic properties by means of the name ToolbarButtonClick.
The attribute can be assigned dynamic properties by means of the name ToolbarButtonClick.
566
The attribute can be assigned dynamic properties by means of the name ToolbarButtonClick.
The attribute can be assigned dynamic properties by means of the name ToolbarButtonClick.
567
The attribute can be assigned dynamic properties by means of the name ToolbarButtonClick.
568
569
570
571
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name ToolbarShowTooltips. Attribute "ToolbarButtonTooltipText" defines the tooltip text.
572
The attribute can be assigned dynamic properties by means of the name ToolbarUseBackColor.
The attribute can be assigned dynamic properties by means of the name ToolbarUseHotKeys.
The attribute can be assigned dynamic properties by means of the name ToolbarVisible .
573
Example:
The following example assigns a tool tip text to every object in the picture "NewPDL1": The picture "NewPDL1" comprises only objects containing the ToolTipText property:
'VBS89 Dim objScreen Dim objScrItem Dim lngIndex Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count strName = objScreen.ScreenItems(lngIndex).ObjectName Set objScrItem = objScreen.ScreenItems(strName) ' 'Assign tooltiptexts to the objects objScrItem.ToolTipText = "Name of object is " & strName Next
574
See also
Radio box (Page219) Status display (Page212) Connector (Page180) Text list (Page210) Static text (Page178) Slider (Page223) Group Display (Page208) Rounded rectangle (Page175) Round Button (Page221) Rectangle (Page172) Polyline (Page170) Polygon (Page168) OLE object (Page205) Line (Page166) Pie segment (Page164) Circular arc (Page162) Circle (Page160) Group (Page274) Graphic Object (Page200) Ellipse segment (Page158) Ellipse arc (Page156) Ellipse (Page154) I/O Field (Page196) Check box (Page217) Button (Page214) Bar (Page188) Customized object (Page273) 3D Bar (Page182)
575
Example:
The following example shifts all objects in the picture "NewPDL1" 5 pixels upwards:
'VBS90 Dim objScreen Dim objScrItem Dim lngIndex Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count strName = objScreen.ScreenItems(lngIndex).ObjectName Set objScrItem = objScreen.ScreenItems(strName) objScrItem.Top = objScrItem.Top - 5 Next
See also
Left Property (Page423) ScreenItem Object (Page134)
See also
Connector (Page180) ScreenItem Object (Page134)
576
See also
Connector (Page180) ScreenItem Object (Page134)
See also
WinCC Push Button Control (Page253) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
577
The attribute can be assigned dynamic properties by means of the name TrendActualize.
578
The attribute can be assigned dynamic properties by means of the name TrendAutoRangeSource.
579
See also
Bar (Page188) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name TrendExtendedColorSet.
580
The attribute can be assigned dynamic properties by means of the name TrendFill.
581
The attribute can be assigned dynamic properties by means of the name TrendLineStyle.
The attribute can be assigned dynamic properties by means of the name TrendLineType.
582
The attribute can be assigned dynamic properties by means of the name TrendLowerLimitColoring.
583
The attribute can be assigned dynamic properties by means of the name TrendPointStyle.
584
The attribute can be assigned dynamic properties by means of the name TrendProvider.
The attribute can be assigned dynamic properties by means of the name TrendProviderCLSID.
The attribute can be assigned dynamic properties by means of the name TrendProviderCLSID.
585
The attribute can be assigned dynamic properties by means of the name TrendRangeType.
586
587
The attribute can be assigned dynamic properties by means of the name TrendTimeRangeBase.
588
The attribute can be assigned dynamic properties by means of the name TrendUncertainColoring.
589
The attribute can be assigned dynamic properties by means of the name TrendWindowCoarseGrid.
590
The attribute can be assigned dynamic properties by means of the name TrendWindowFineGrid.
The attribute can be assigned dynamic properties by means of the name TrendWindowForegroundTrendGrid.
591
The attribute can be assigned dynamic properties by means of the name TrendWindowGridInTrendColor.
The attribute can be assigned dynamic properties by means of the name TrendWindowHorizontalGrid.
592
593
The attribute can be assigned dynamic properties by means of the name TrendWindowRulerLayer.
The attribute can be assigned dynamic properties by means of the name TrendWindowRulerStyle.
594
The attribute can be assigned dynamic properties by means of the name TrendWindowStatisticRulerStyle.
595
596
Special feature
In the case of non-WinCC controls and OLE objects, the version-independent ProgID is returned as the type. It is possible to determine the version-dependent ProgID or "User friendly Name" from the ProgID: In the following example, "Control1" is a control embedded in the picture which already returns the version-independent ProgID as a result of the Type property. Note Since not every Control has a version-dependent ProgID, an error handling measure should be integrated to query the version-dependent ProgID or UserFriendlyName. If no error handling is used, the code is terminated immediately without any result when no ProgID is found. Determine the version-dependent ProgID as follows:
'VBS91 Dim objControl Dim strCurrentVersion Set objControl = ScreenItems("Control1") strCurrentVersion = CreateObject("WScript.Shell").RegRead("HKCR\" & objControl.Type & "\CurVer\") MsgBox strCurrentVersion
Note In order that example above works, a multimedia control should be inserted in the picture. Determine the User Friendly Name as follows:
'VBS92 Dim objControl Dim strFriendlyName Set objControl = ScreenItems("Control1") strFriendlyName = CreateObject("WScript.Shell").RegRead("HKCR\" & objControl.Type & "\") MsgBox strFriendlyName
Note In order that example above works, a multimedia control should be inserted in the picture.
597
Example:
The following example displays the type for all objects in the picture "NewPDL1":
'VBS93 Dim objScreen Dim objScrItem Dim lngIndex Dim lngAnswer Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count strName = objScreen.ScreenItems(lngIndex).ObjectName Set objScrItem = objScreen.ScreenItems(strName) lngAnswer = MsgBox(objScrItem.Type, vbOKCancel) If vbCancel = lngAnswer Then Exit For Next
See also
ScreenItem Object (Page134) Object Types of the ScreenItem Object (Page152)
See also
ScreenItem Object (Page134) Bar (Page188)
598
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
599
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
600
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
601
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
602
See also
Text list (Page210) ScreenItem Object (Page134)
See also
Text list (Page210) ScreenItem Object (Page134)
See also
Picture Window (Page191) ScreenItem Object (Page134)
See also
WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
603
See also
WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267) ScreenItem Object (Page134)
See also
ScreenItem Object (Page134) WinCC Online Table Control (before WinCC V7) (Page269) WinCC Online Trend Control (before WinCC V7) (Page271) WinCC Function Trend Control (before WinCC V7) (Page267)
604
The attribute can be assigned dynamic properties by means of the name UseColumnBackColors.
The attribute can be assigned dynamic properties by means of the name UseColumnForeColors.
The attribute can be assigned dynamic properties by means of the name UseMessageColor.
605
UserData-Property Description
Contains the value that is to be transferred to the VB script while running a customized menu item or icon. STRING (write-read access)
Example:
Use the "User data" field in the "Menus and Toolbars" editor to apply a parameter to the procedure The following example shows the "ActivateScreen" procedure that executes the picture change. Enter the picture name in the "User Data" field:
Sub ActivateScreen (ByVal Item) Dim objScreen Dim strScreenName ' "UserData" contains the screen name specified ' in editor menus and toolbars. strScreenName = Item.Userdata HMIRuntime.BaseScreenName = strScreenName End Sub
606
See also
Alarms object (list) (Page116)
See also
ScreenItem Object (Page134) Group Display (Page208)
UserValue2-Eigenschaft Description
Defines or returns a value. The value can be evaluated by a script, for example. This value is neither evaluated nor displayed in Runtime.
See also
Group Display (Page208) ScreenItem Object (Page134)
See also
Group Display (Page208) ScreenItem Object (Page134)
607
See also
Group Display (Page208) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name UseSelectedTitleColor.
The attribute can be assigned dynamic properties by means of the name UseSourceBackColors.
608
The attribute can be assigned dynamic properties by means of the name UseSourceForeColors.
The attribute can be assigned dynamic properties by means of the name UseTableColor2.
The attribute can be assigned dynamic properties by means of the name UseTrendNameAsLabel.
609
Example:
The following example writes a new value in the "Tag1" tag:
'VBS94 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") objTag.Value = 50 objTag.Write
Example:
The example shows how to add a value to the list, and how to output it as a trace. After that, the value is changed, output again and then removed. It make sense to perform this in several different actions.
'VBS198 HMIRuntime.DataSet.Add "motor1", 23 HMIRuntime.Trace "motor1: " & HMIRuntime.DataSet("motor1").Value & vbNewLine HMIRuntime.DataSet("motor1").Value = 55 HMIRuntime.Trace "motor1: " & HMIRuntime.DataSet("motor1").Value & vbNewLine
610
HMIRuntime.DataSet.Remove("motor1")
Note For object references it must be ascertained that objects are multiread-enabled.
See also
WinCC Gauge Control (Page243) Write Method (Page725) Read Method (Page698) Tag Object (Page146) DataItem Object (Page119) ProcessValues Object (List) (Page132)
The attribute can be assigned dynamic properties by means of the name ValueAxisAlign.
611
The attribute can be assigned dynamic properties by means of the name ValueAxisAutoPrecisions.
The attribute can be assigned dynamic properties by means of the name ValueAxisAutoRange.
612
The attribute can be assigned dynamic properties by means of the name ValueAxisExponentialFormat.
613
The attribute can be assigned dynamic properties by means of the name ValueAxisInTrendColor.
614
The attribute can be assigned dynamic properties by means of the name ValueAxisScalingType.
615
The attribute can be assigned dynamic properties by means of the name ValueColumnAlign.
616
See also
WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name ValueColumnAutoPrecisions.
617
The attribute can be assigned dynamic properties by means of the name ValueColumnExponentialFormat.
The attribute can be assigned dynamic properties by means of the name ValueColumnHideText.
618
The attribute can be assigned dynamic properties by means of the name ValueColumnHideTitleText.
619
The attribute can be assigned dynamic properties by means of the name ValueColumnProvider.
The attribute can be assigned dynamic properties by means of the name ValueColumnProviderCLSID.
620
The attribute can be assigned dynamic properties by means of the name ValueColumnShowIcon.
621
The attribute can be assigned dynamic properties by means of the name ValueColumnShowTitleIcon.
The attribute can be assigned dynamic properties by means of the name ValueColumnSort .
622
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
623
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
WinCC Online Table Control (before WinCC V7) (Page269) ScreenItem Object (Page134)
The attribute can be assigned dynamic properties by means of the name VerticalGridLines.
624
Example:
The following example sets all the objects in the picture "NewPDL1" to invisible:
'VBS95 Dim objScreen Dim objScrItem Dim lngIndex Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count strName = objScreen.ScreenItems(lngIndex).ObjectName Set objScrItem = objScreen.ScreenItems(strName) objScrItem.Visible = False Next
See also
ScreenItem Object (Page134) Layer Object (Page127) HMIRuntime Object (Page125)
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
625
See also
WinCC Gauge Control (Page243) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
See also
Bar (Page188) ScreenItem Object (Page134)
626
Example:
The following example doubles the width of all objects in the pictures "NewPDL1" whose name begins with "Button":
'VBS96 Dim objScreen Dim cmdButton Dim lngIndex Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count ' 'Get all "Buttons" strName = objScreen.ScreenItems(lngIndex).ObjectName If "Button" = Left(strName, 6) Then Set cmdButton = objScreen.ScreenItems(strName) cmdButton.Width = cmdButton.Width * 2 End If Next
See also
Height Property (Page391) ScreenItem Object (Page134)
627
See also
Picture Window (Page191) Application Window (Page186) ScreenItem Object (Page134)
628
See also
Slider (Page223) Button (Page214) ScreenItem Object (Page134)
See also
WinCC Alarm Control (before WinCC V7) (Page265) ScreenItem Object (Page134)
629
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
See also
WinCC Slider Control (Page259) ScreenItem Object (Page134)
The X axis attribute can be assigned dynamic properties by means of the name XAxisAlign. The following settings are available for the Y axis:
630
The Y axis attribute can be assigned dynamic properties by means of the name YAxisAlign.
The X axis attribute can be assigned dynamic properties by means of the name XAxisAutoPrecisions. The Y axis attribute can be assigned dynamic properties by means of the name YAxisAutoPrecisions.
The X axis attribute can be assigned dynamic properties by means of the name XAxisAutoRange. The Y axis attribute can be assigned dynamic properties by means of the name YAxisAutoRange.
631
The X axis attribute can be assigned dynamic properties by means of the name XAxisExponentialFormat. The Y axis attribute can be assigned dynamic properties by means of the name YAxisExponentialFormat.
632
The X axis attribute can be assigned dynamic properties by means of the name XAxisInTrendColor. The Y axis attribute can be assigned dynamic properties by means of the name YAxisInTrendColor.
633
The X axis attribute can be assigned dynamic properties by means of the name XAxisScalingType. The Y axis attribute can be assigned dynamic properties by means of the name YAxisScalingType.
634
635
See also
ScreenItem Object (Page134) Bar (Page188)
636
See also
Bar (Page188) 3D Bar (Page182) ScreenItem Object (Page134)
Example:
The following example doubles the zoom factor of the current picture:
'VBS97 HMIRuntime.ActiveScreen.Zoom = HMIRuntime.ActiveScreen.Zoom * 2
See also
Picture Window (Page191) Screen Object (Page140)
637
1.14.5
1.14.5.1 Overview
Methods
Methods
Methods, which are applied to individual objects, can be used to read out tag values for further processing or displaying diagnostics messages in Runtime.
DeactivateDyna GetTrend mic DeleteRows DetachDB Edit Export GetColumn GetColumnColl ection GetTrendCollection GetTrendWindow GetTrendWindowCollection GetValueAxis GetValueAxisCollection GetValueColumn
GetHitlistColum GetValueColumnCollection n GetHitlistColum GetXAxis nCollection GetMessageBl ock GetMessageBl ockCollection GetXAxisCollection GetYAxis
GetMessageCo GetYAxisCollection lumn GetMessageCo HideAlarm lumnCollection GetOperatorMe Item Method ssage GetOperatorMe LockAlarm ssageCollection
638
GetRulerColum MoveToFirst n GetRulerColum MoveToFirstLine nCollection GetRulerData GetStatisticAre aColumn MoveToFirstPage MoveToLast
GetStatisticAre MoveToLastLine aColumnCollect ion GetStatisticRes MoveToLastPage ultColumn GetStatisticRes MoveToNext ultColumnColle ction
ShowHitList ShowInfoText
ZoomMove
1.14.5.2
Methods A to E
Syntax
Expression.Activate
Expression
Necessary. An expression which returns an object of type "Screen" or "ScreenItem".
Parameters
--
639
Examples
The following example shows the use for type "Screen":
'VBS98 Dim objScreen MsgBox HMIRuntime.ActiveScreen.ObjectName 'Output of active screen Set objScreen = HMIRuntime.Screens("ScreenWindow1") objScreen.Activate 'Activate "ScreenWindow1" MsgBox HMIRuntime.ActiveScreen.ObjectName 'New output of active screen
See also
ScreenItem Object (Page134) Screen Object (Page140)
Syntax
Expression.ActivateDynamic (ByVAl bstrPropertyName As String, ByVal bstrCycleName As String)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
640
Parameters
Parameters bstrPropertyName bstrCycleName Description Name of property to which trigger relates. Name of activation cycle, e.g. "CycleTime1s".
syntax
Expression.Add [Tag]
Expression
Necessary. An expression which returns an object of type "TagSet".
Parameters
VARIANT
Parameters Tag Description Name of a WinCC tag or reference to a tag object to be added to the list.
Example:
In the following example, a TagSet object is generated and a tag is added.
'VBS170 Dim group Set group = HMIRuntime.Tags.CreateTagSet group.Add "Motor1"
641
syntax
Expression.Add [vtName], [vtUserData]
Expression
Necessary. An expression which returns an object of type "DataSet".
Parameters
VARIANT
Parameters vtName vtUserData Description Name by which value or tag are to be added to list. Value to be added to list.
Example:
In this example, a value is included in the DataSet list.
'VBS172 HMIRuntime.DataSet.Add "Motor1",23
See also
TagSet Object (List) (Page151) DataSet-Objekt (List) (Page122)
642
Syntax
Ausdruck.AttachDB()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.CalculateStatistic()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
643
Syntax
Ausdruck.CopyRows()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Expression.Create (VARIANT vtApplication)
Expression
Necessary. An expression which returns an object of type "Alarm".
Parameters
VARIANT
Parameters vtApplication Description Name of alarm object (optional)
See also
Alarms object (list) (Page116)
644
syntax
Expression.CreateTagSet()
Expression
Necessary. An expression which returns an object of type "TagSet".
Parameters
VARIANT
Example:
The following example shows how to create a TagSet object.
'VBS168 'Build a Reference to the TagSet Object Dim group Set group = HMIRuntime.Tags.CreateTagSet
See also
TagSet Object (List) (Page151) Tags Object (List) (Page149)
Syntax
Ausdruck.CutRows()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
645
Syntax
Ausdruck.DeactivateDynamic(ByVal bstrPropertyName As String)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
String
Parameters bstrPropertyName Description Name of property to which trigger relates.
Syntax
Ausdruck.DeleteRows()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
646
Syntax
Ausdruck.DetachDB()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.Edit()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.Export()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
647
Parameters
VARIANT
1.14.5.3
Get methods
Syntax
Ausdruck.GetColumn(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Parameters vIndex Description Index or name of column of UserArchiveControl.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
648
Syntax
Ausdruck.GetColumnCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll
649
Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Expression.GetHitlistColumn(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Parameters vIndex Description Index or name of hitlist column
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
650
Syntax
Expression.GetHitlisteColumnCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll
651
Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Expression.GetMessageBlock(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Parameters vIndex Description Index or name of message block.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
652
Syntax
Expression.GetMessageBlockCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1")
653
Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Expression.GetMessageColumn(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Parameters vIndex Description Index or name of column in message list.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
654
Syntax
Expression.GetMessageColumnCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection
655
HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Expression.GetOperatorMessage(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Parameters vIndex Description Index or name of operator message
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
656
Syntax
Expression.GetOperatorMessageCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll
657
Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Expression.GetRulerBlock(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Parameters vIndex Description Index or name of block in RulerControl
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
658
Syntax
Expression.GetRulerBlockCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection
659
HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Expression.GetRulerColumn(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Parameters vIndex Description Index or name of column of RulerControl.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
660
Syntax
Expression.GetRulerColumnCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection
661
HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetRulerData(ByVal vTrend As Variant, ByVal RulerIndex As Long, pvValue As Variant, Optional pvTimeStamp As Variant, Optional pvFlags As Varian) Long
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
Parameters vTrend RulerIndex pvValue pvTimeStamp pvFlags Description Name of the curve Type of ruler: Ruler, statistic or statistics area Value of X axis Time Qualitycode
Syntax
Ausdruck.GetStatisticAreaColumn(ByVal vIndex As Variant)
662
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Parameters vIndex Description Index or name of column of statistics area window.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetStatisticAreaColumnCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
663
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetStatisticResultColumn(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
664
Parameters
VARIANT
Parameters vIndex Description Index or name of column of statistics window.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetStatisticResultColumnCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
665
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetStatusbarElement(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
666
Parameters
VARIANT
Parameters vIndex Description Index or name of status bar element.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetStatusbarElementCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
667
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetTimeAxis(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
668
Parameters
VARIANT
Parameters vIndex Description Index or name of time axis.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetTimeAxisCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
669
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetTimeColumn(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
670
Parameters
VARIANT
Parameters vIndex Description Index or name of time column.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetTimeColumnCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
671
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetToolbarButton(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
672
Parameters
VARIANT
Parameters vIndex Description Index or name of toolbar button function.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetToolbarButtonCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
673
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetTrend(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
674
Parameters
VARIANT
Parameters vIndex Description Index or name of curve.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetTrendCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
675
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetTrendWindow(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
676
Parameters
VARIANT
Parameters vIndex Description Index or name of curve window.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetTrendWindowCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
677
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetValueAxis(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
678
Parameters
VARIANT
Parameters vIndex Description Index or name of value axis.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetValueAxisCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
679
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetValueColumn(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
680
Parameters
VARIANT
Parameters vIndex Description Index or name of value column of OnlineTableControl.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetValueColulmnCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
681
Parameters
--
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetXAxis(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
682
Parameters
VARIANT
Parameters vIndex Description Index or name of X axis.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetXAxisCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
683
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
Syntax
Ausdruck.GetYAxis(ByVal vIndex As Variant)
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
684
Parameters
VARIANT
Parameters vIndex Description Index or name of Y axis.
Example
Use of the "Getxxx" methods in the controls is illustrated on the basis of an example relating to a toolbar button function.
'VBS201 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim toolbu Set toolbu = ctrl.GetToolbarButton ("ShowHelp") HMIRuntime.Trace "Name: " & toolbu.Name & vbCrLf HMIRuntime.Trace "Index: " & toolbu.Index & vbCrLf HMIRuntime.Trace "Hotkey: " & toolbu.HotKey & vbCrLf End Sub
Note If you use the "Get..." methods to access properties of a control, you must use the latter part of the property name. For example, if the index of a toolbar button function is not addressed via ".ToolbarButtonIndex" but via ".Index".
Syntax
Ausdruck.GetYAxisCollection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
685
Example
Use of the "GetxxxCollection" methods in the controls is illustrated on the basis of an example relating to the toolbar button functions.
'VBS202 Dim ctrl Set ctrl = ScreenItems.Item("Control1") Dim coll Set coll = ctrl.GetToolbarButtonCollection HMIRuntime.Trace "Number of toolbar buttons:" & coll.Count & vbCrLf Dim toolbu For Each toolbu In coll HMIRuntime.Trace toolbu.Name & vbCrLf Next End Sub
1.14.5.4
Methods H to M
Syntax
Expression.HideAlarm()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
686
syntax
Expression.Item()
Expression
Necessary. An expression which returns an object of the type "Screens", "Layers" (or "Tags"). NOTICE In the case of "Tags", restricted functional scope! The standard methods get_Count and get_NewEnum are missing so that access via Index nor the counting of all tags is possible.
Parameters
VARIANT
Example:
The following example issues the names of all objects contained in the picture "NewPDL1":
'VBS99 Dim objScreen Dim objScrItem Dim lngIndex Dim lngAnswer Dim strName lngIndex = 1 Set objScreen = HMIRuntime.Screens("NewPDL1") For lngIndex = 1 To objScreen.ScreenItems.Count ' 'The objects will be indicate by Item() strName = objScreen.ScreenItems.Item(lngIndex).ObjectName Set objScrItem = objScreen.ScreenItems(strName) lngAnswer = MsgBox(objScrItem.ObjectName, vbOKCancel) If vbCancel = lngAnswer Then Exit For Next
687
See also
ScreenItems Object (List) (Page138) ScreenItem Object (Page134) Tags Object (List) (Page149) Alarms object (list) (Page116) ProcessValues Object (List) (Page132)
Syntax
Expression.LockAlarm()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Expression.LoopInAlarm()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
688
Syntax
Expression.MoveAxis()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Expression.MoveToFirst()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.MoveToFirstLine()
689
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.MoveToFirstPage()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.MoveToLast()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
690
Syntax
Ausdruck.MoveToLastLine()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.MoveToLastPage()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.MoveToNext()
691
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.MoveToNextLine()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.MoveToNextPage()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
692
Syntax
Ausdruck.MoveToPrevious()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.MoveToPreviousLine()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
syntax
Ausdruck.MoveToPreviousPage()
693
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
1.14.5.5
Methods N to R
Syntax
Ausdruck.NextColumn()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.NextTrend()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
694
Syntax
Ausdruck.OneToOneView()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Syntax
Expression.PasteRows()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.PreviousColumn()
695
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.PreviousTrend()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.Print()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
696
Syntax
Ausdruck.QuitHorn()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.QuitSelected()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.QuitVisible()
697
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
If the value of the tag is not read successfully, the properties of the tag object are assigned the following values:
Property Value Name QualityCode Timestamp LastError ErrorDescription Allocation VT_Empty Tag name (unchanged) Bad Out of Service 0 Read operation error codes Error description on LastError
Note A summary of possible Quality Codes may be found in WinCC Information System under key word "Communication" > "Diagnostics" or "Communication" > "Quality Codes".
698
syntax
Expression.Read([Readmode])
Expression
Necessary. An expression which returns a tag object. The return value of the Read method is the value of the tag read out.
Parameters
The optional "Readmode" parameter enables the distinction between two types of reading:
Parameters 0 1 Description The tag value is read from the process image (cache). 0 is the default value. The value of a tag is read directly from AS or channel (direct).
If the "Readmode" parameter is omitted, the value is read from the process image by default. The return value of the Read method is the tag value read out as VARIANT.
699
Direct reading
In the case of direct reading, the current value is returned. The tag is not registered cyclically, the value is requested from the AS one time only. Direct reading has the following properties: The value is read explicitly from the AS. The call takes longer compared to reading from the process image. The duration of the call is dependent on the bus load and AS, amongst other things.
700
Expression
Necessary. An expression which returns an object of type "TagSet".
Direct reading
Since one call may process several read commands, performance is enhanced in comparison to single calls.
Example:
The following example shows how tags are included in the TagSet list, how tag values are imported and subsequently read.
'VBS174 Dim group Set group = HMIRuntime.Tags.CreateTagSet group.Add "Motor1" group.Add "Motor2" group.Read HMIRuntime.Trace "Motor1: " & group("Motor1").Value & vbNewLine HMIRuntime.Trace "Motor2: " & group("Motor2").Value & vbNewLine
If the optional parameter "Readmode" is set to 1, the process tags are not registered but read directly from AS or channel.
group.Read 1
See also
Example: How to Read Tag Values (Page741) Example: Writing tag values (Page739) LastError Property (Page407) ErrorDescription Property (Page363) TagSet Object (List) (Page151) Tag Object (Page146)
701
Syntax
Ausdruck.ReadTags()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
syntax
Expression.Refresh
Expression
Necessary. An expression which returns a "Screens" or "Screen" type object.
Parameters
--
Examples
The first example forces all visible pictures to be drawn again:
'VBS149 HMIRuntime.Screens.Refresh
702
See also
Screen Object (Page140) Screens Object (List) (Page143) HMIRuntime Object (Page125)
syntax
Expression.Remove [Tag]
Expression
Necessary. An expression which returns an object of type "TagSet".
Parameters
VARIANT
Parameters Tag Description Name of a WinCC tag or reference to a tag object to be removed from the list.
Example:
The following example shows how several tags are included in the TagSet list, and how to remove a tag again.
'VBS175 Dim group Set group = HMIRuntime.Tags.CreateTagSet group.Add "Motor1" group.Add "Motor2"
703
group.Remove "Motor1"
syntax
Expression.Remove [Name]
Expression
Necessary. An expression which returns an object of type "DataSet".
Parameters
VARIANT
Parameters Name Description Name of the object to be removed from the list.
Example:
The example shows how to remove the object "motor1" from the list.
'VBS166 HMIRuntime.DataSet.Remove("motor1")
704
Expression
Necessary. An expression which returns an object of type "Logging" or "AlarmLogs".
Object DataLogs
Expression.Remove [TimeFrom] [TimeTo] [TimeOut] [Type] [ServerPrefix]
Expression
Necessary. An expression which returns an object of type "DataLogs".
Parameters TimeFrom
Point in time, from which the archives are to be deleted. When indicating the time format, a short form is also possible. This is described in the "Time Format" section.
TimeTo
Time up to which archive segments are to be deleted. When indicating the time format, a short form is also possible. This is described in the "Time Format" section.
Timeout
Timeout in milliseconds. If you enter "-1" as a value, the wait will be infinite. If you enter a value of "0", there will be no wait.
705
Type:
Type of archive. The parameter can (optionally) be used only to delete archive segments of the tag logging. The following values can be entered:
Assigned Value 1 2 3 Type hmiDataLogFast hmiDataLogSlow hmiDataLogAll Description Tag Logging Fast data Tag Logging Slow data Tag Logging Fast and Slow data
ServerPrefix
Reserved for future versions.
Return value
If an error occurred during deletion of the archive segments, the method will return an error message. Additional information may be found under the subject heading "Error Messages from Database Area".
Time format
Time format is defined as follows: YYYY-MM-DD hh:mm:ss, where YYYY represents the year, MM the month, DD the day, hh the hour, mm the minute and ss the second. For example, the time of 2 minutes and one second past 11 o'clock on July 26, 2004 is displayed as follows: 2004-07-26 11:02:01. For parameters "TimeFrom" and "TimeTo" the statement of data and time is also possible in short form. Not all format fields must be filled in this case. The short form means that the information on date and time may be lacking one or several parameters, beginning with the value for seconds. For example, the statement may be in the form of "YYYY-MM" or "YYYYMM-DD hh". Using the statement "TimeFrom" = "2004-09" and "TimeTo" = "2004-10-04" all archive segments between September 2004 up to and including October 4th are to be swapped.
Example:
In the following example, archive segments re-swapped after the fact for a specified time period may be removed and the return value may be output as Trace.
'VBS182 HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.Remove("2004-08-22","2004-09-22",-1) & vbNewLine
In the following example, all archive segments re-swapped after the fact may be removed and the return value may be output as Trace.
706
See also
Error Messages from Database Area (Page732) Example: How to Start an Action on the Server (Logging Object) (Page746) Logging Object (Page130) DataSet-Objekt (List) (Page122) DataLogs Object (Page121) AlarmLogs Object (Page118) TagSet Object (List) (Page151)
syntax
Expression.RemoveAll
Expression
Necessary. An expression which returns an object of type "TagSet".
Parameters
--
Example:
The following example shows how several tags are included in the TagSet list, and how to remove all tags again.
'VBS176 Dim group Set group = HMIRuntime.Tags.CreateTagSet group.Add "Motor1" group.Add "Motor2" group.RemoveAll
707
syntax
Expression.RemoveAll
Expression
Necessary. An expression which returns an object of type "DataSet".
Parameters
--
Example:
The example shows how all objects are removed from the list.
'VBS167 HMIRuntime.DataSet.RemoveAll
See also
DataSet-Objekt (List) (Page122) TagSet Object (List) (Page151) Tag Object (Page146)
708
Expression
Required. An expression which returns an object of type "Logging" or "AlarmLogs".
Object DataLogs
Expression.Restore [SourcePath] [TimeFrom] [TimeTo] [TimeOut] [Type] [ServerPrefix]
Expression
Required. An expression which returns an object of type "DataLogs".
709
Parameter SourcePath
Path to archive data.
TimeFrom
Point in time, from which the archives are to be stored. When indicating the time format, a short form is also possible. This is described in the "Time Format" section.
TimeTo
Time up to which archive segments are to be swapped. When indicating the time format, a short form is also possible. This is described in the "Time Format" section.
Timeout
Timeout in milliseconds. If you enter "-1" as a value, the wait will be infinite. If you enter a value of "0", there will be no wait.
Type
Type of archive. The parameter can (optionally) be used only to store archive segments of the tag logging. The following values can be entered:
Assigned Value 1 2 3 Type hmiDataLogFast hmiDataLogSlow hmiDataLogAll Description Tag Logging Fast data Tag Logging Slow data Tag Logging Fast and Slow data
ServerPrefix
Reserved for future versions.
Return value
If an error occurred during swapping of archive segments, the method will return an error message. Additional information may be found under the subject heading "Error Messages from Database Area".
710
Time format
Time format is defined as follows: YYYY-MM-DD hh:mm:ss, where YYYY represents the year, MM the month, DD the day, hh the hour, mm the minute and ss the second. For example, the time of 2 minutes and one second past 11 o'clock on July 26, 2004 is displayed as follows: 2004-07-26 11:02:01. For parameters "TimeFrom" and "TimeTo" the statement of data and time is also possible in short form. Not all format fields must be filled in this case. The short form means that the information on date and time may be lacking one or several parameters, beginning with the value for seconds. For example, the statement may be in the form of "YYYY-MM" or "YYYYMM-DD hh". Using the statement "TimeFrom" = "2004-09" and "TimeTo" = "2004-10-04" all archive segments between September 2004 up to and including October 4th are to be swapped.
Example
In the following example, all archive segments since the specified time period are re-swapped, and the return value is output as Trace.
'VBS184 HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.Restore("D:\Folder","2004-09-14","",-1) & vbNewLine
In the following example, all Tag Logging Slow archive segments since the specified time period are re-swapped, and the return value is output as Trace.
'VBS185 HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.DataLogs.Restore("D:\Folder","2004-09-14 12:30:05","2004-09-20 18:30",-1,2) & vbNewLine
In the following example, all Alarm Logging archive segments up to the specified time period are re-swapped, and the return value is output as Trace.
'VBS186 HMIRuntime.Trace "Ret: " & HMIRuntime.Logging.AlarmLogs.Restore("","2004-09-20",-1) & vbNewLine
See also
Error Messages from Database Area (Page732) Example: How to Start an Action on the Server (Logging Object) (Page746) Logging Object (Page130) DataLogs Object (Page121) AlarmLogs Object (Page118)
711
1.14.5.6
Methods S to T
Syntax
Ausdruck.SelectedStatisticArea()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ServerExport()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
712
Syntax
Ausdruck.ServerImport()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowColumnSelection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowComment()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
713
Parameters
--
Syntax
Ausdruck.ShowDisplayOptionsDialog()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowEmergencyQuitDialog()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
714
Syntax
Ausdruck.ShowHelp()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
Syntax
Ausdruck.ShowHideList()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowHitList()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
715
Parameters
--
Syntax
Ausdruck.ShowInfoText()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowLockDialog()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
716
Syntax
Ausdruck.ShowLockList()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowLongTermArchiveList()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowMessageList()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
717
Parameters
--
Syntax
Ausdruck.ShowPercentageAxis()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowPropertyDialog()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
VARIANT
718
Syntax
Ausdruck.ShowSelectArchive()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowSelection ()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowSelectTimeBase()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
719
Parameters
--
Syntax
Ausdruck.ShowSelectionDialog()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowShortTermArchiveList()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
720
Syntax
Ausdruck.ShowSort()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowSortDialog()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowTagSelection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
721
Parameters
--
Syntax
Ausdruck.ShowTimebaseDialog()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ShowTimeSelection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
722
Syntax
Ausdruck.ShowTrendSelection()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
-- -
Syntax
Ausdruck.StartStopUpdate()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
723
syntax
HMIRuntime.Stop
Parameters
---
Example:
The following example terminates WinCC Runtime:
'VBS124 HMIRuntime.Stop
See also
HMIRuntime Object (Page125)
syntax
HMIRuntime.Trace
Parameters
STRING
Example:
The following example writes a text in the diagnostics window:
'VBS103 HMIRuntime.Trace "Customized error message"
See also
HMIRuntime Object (Page125)
724
1.14.5.7
Methods U to Z
Syntax
Ausdruck.UnhideAlarm()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.UnlockAlarm()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
725
If the value of the tag is not set successfully, the properties of the tag object are assigned the following values:
Property Value Name QualityCode Timestamp LastError ErrorDescription Allocation Tag values set by the user (unchanged) Tag name (unchanged) Bad Out of Service 0 Write operation error codes Error description on LastError
syntax
Expression.Write [Value],[Writemode]
Expression
Necessary. An expression which returns a tag object.
Parameters
The value to be written can be transferred directly to the method as a parameter. If the parameter is not specified, the value in the "Value" property is used. The "Writemode" option parameter can be used to select whether the tag value should be written synchronously or asynchronously. If the "Writemode" parameter is not used, writing is performed asynchronously as its default value. During the writing process, no information is supplied on the status of the tags. The "Value" property contains the value which was set before or during the writing operation, therefore is may not correspond to the real current value of the tag. If the data on the tag should be updated, use the Read method.
726
On asynchronous writing, it is written immediately into the tag image. The user does not receive any feedback if the value has been written in the programmable controller, too. In the case of synchronous writing (direct to the PLC), the writing operation actually occurs when the PLC is ready to operate. The use receives a check-back message if the writing operation was not successful.
or
'VBS105 Dim objTag Set objTag = HMIRuntime.Tags("Var1") objTag.Write 5 MsgBox objTag.Value
Synchronous writing
'VBS106 Dim objTag Set objTag = HMIRuntime.Tags("Var1") objTag.Value = 5 objTag.Write ,1 MsgBox objTag.Value
727
Expression
Necessary. An expression which returns an object of type "TagSet".
Parameters
In order to write different values, the "Value" property of individual tag objects must be set, and write must be called thereafter without the "Value" parameter. Since the write commands are grouped into one call, it results in improved performance compared to single calls. In a TagSet object, it is not possible to pass on a value using the "Write" method. Individual values must be set using the "Value" property of the individual tag objects.
Example:
The following example shows how tags are included in the TagSet list, how tag values are set and subsequently written.
'VBS173 Dim group Set group = HMIRuntime.Tags.CreateTagSet group.Add "Wert1" group.Add "Wert2" group("Wert1").Value = 3 group("Wert2").Value = 9 group.Write
If you set the optional parameter "Writemode" equal to 1, the process tags are written synchronously (directly to AS).
group.Write 1
728
See also
LastError Property (Page407) ErrorDescription Property (Page363) TagSet Object (List) (Page151) Tag Object (Page146)
Syntax
Expression.WriteTags()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ZoomArea()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
729
Syntax
Ausdruck.ZoomInOut()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ZoomInOutTime()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ZoomInOutValues()
730
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ZoomInOutX()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
Syntax
Ausdruck.ZoomInOutY()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
731
Syntax
Ausdruck.ZoomMove()
Expression
Necessary. An expression that returns an object of the "ScreenItem" type.
Parameters
--
1.14.6
1.14.6.1
Appendix
Error Messages from Database Area
Introduction
Upon access to databases, a value is returned upon execution. Values in the range "0x8..." represent an error message. Values not equal to "0x8..." represent a status message.
Status Messages
The following status messages are defined:
0x0 0x1 OK Function did not find any errors in parameter supply and did not find any internal errors. The following causes may result in this value. When connecting databases: - No archive could be found in the given time window. - Archives were found in the given time window, but they were already connected. When separating databases: - No connected archives could be found in the given time window. No checks are performed on whether or not archives are attached at all.
732
Error Messages
The following error messages are defined (n in English only):
Error code 0x80047200 0x80047201 0x80047202 0x80047203 0x80047204 0x80047205 0x80047206 0x80047207 0x80047208 0x80047209 0x8004720A 0x8004720B 0x8004720C 0x8004720D 0x8004720F 0x80047210 Error Message WinCC is not activated Invalid archive type Invalid lower boundary Invalid upper boundary Path 'CommonArchiving' could not be created in the project path Timeout, please retry WinCC was deactivated Wrong signification At least one database had a invalid signature and has not been attached. Database could not be attached Copy to 'CommonArchiving' is not possible. Invalid syntax for database filename. No list of databases. Database already detached. Database could not be detached. Unsigned database attached. At least one database without signature has been attached. Path error : - Path invalid, - no *.MDF files found in specified path or - no permission to specified path.
See also
Remove Method (Page703) Write Method (Page725) Read Method (Page698) Restore Method (Page708) Logging Object (Page130) DataLogs Object (Page121) AlarmLogs Object (Page118)
733
1.15
1.15.1
Examples of VBScript
Examples of VBScript
Introduction
The following section contains application examples of VBS in WinCC. The "Examples in WinCC" section contains examples of codes with which the WinCC Runtime environment can be made dynamic. These examples have been conceived so that they can be assumed 1:1 in the configuration. The "General Examples" section contains examples with which to influence the Microsoft environment. There is no guarantee nor support for the running capability of these examples.
See also
Examples in WinCC (Page734)
1.15.2
1.15.2.1
Examples in WinCC
Examples in WinCC
Introduction
This section contains examples of using VBScript in WinCC with regard to the following topics: Access to objects in the Graphics Designer (e.g. color or text change) Set color of objects above RGB colors Configuring language change Deactivate Runtime Start external program Globally configure picture change (from Global Script) Configuring Change Picture Via Property Use trace for diagnostics output Set value of a tag Read value of a tag Check the success of a read/write action into a tag Asynchronously set value of a tag
734
See also
Example: Starting an external application (Page760) Example: Writing Object Properties (Page743) Example: How to Read Tag Values (Page741) Example: Writing tag values (Page739) Example: Configuring diagnostics output via Trace (Page738) Example: Configuring Change Picture Via Property (Page738) Example: Configuring change picture globally (Page737) Example: Deactivating Runtime (Page737) Example: How to Configure Language Changes (Page736) Example: Defining the color of objects (Page736) Example: Accessing objects in Graphics Designer (Page735)
1.15.2.2
Introduction
Access can be made to all Graphic Designer objects using VBS WinCC in order to make the graphic Runtime environment dynamic. Graphic objects can be made dynamic on operation (e.g. clicking the mouse on a button), depending on a tag or cyclically (e.g. flashing). The following examples illustrate how to change a graphic object following a mouse click.
Procedure
In the following example, the radius of a circle is set to 20 in Runtime per mouse click:
'VBS121 Dim objCircle Set objCircle= ScreenItems("Circle1") objCircle.Radius = 20
Note The expression used in the example only applies to Graphics Designer. In the case of analog actions in Global Script, address the objects using the HMIRuntime object.
See also
Examples in WinCC (Page734)
735
1.15.2.3
Introduction
The colors of graphic objects are defined via RGB values (Red/Green/Blue). The color values for graphic objects can be set or read out.
Procedure
The following example defines the fill color for "ScreenWindow1" to blue:
'VBS122 Dim objScreen Set objScreen = HMIRuntime.Screens("ScreenWindow1") objScreen.FillStyle = 131075 objScreen.FillColor = RGB(0, 0, 255)
See also
Examples in WinCC (Page734)
1.15.2.4
Introduction
The Runtime language of WinCC can be changed using VBS. The most typical use is buttons with the corresponding language codes which are placed on the start page of a project. You specify the Runtime language in VBS by using a country code, e.g., 1031 for German Default, 1033for English - USA etc. A summary of all country codes may be found in the Basics of VBScript under the subject header "Regional Scheme ID (LCID) Diagram".
Procedure
Use the "Mouse click" event on a button to create a VBS action and enter the following action code to switch the Runtime language to German:
'VBS123 HMIRuntime.Language = 1031
See also
Examples in WinCC (Page734)
736
1.15.2.5
Introduction
It is possible to terminate WinCC Runtime with VBS, e.g. via a mouse click or in dependence on tag values or other events, such as multiple faulty input of a password when starting Runtime.
What to do
The following example terminates WinCC Runtime:
'VBS124 HMIRuntime.Stop
See also
Examples in WinCC (Page734)
1.15.2.6
Introduction
VBS can be used to initiate a global picture change and thus, for example, display a picture from a server on a client in a distributed system. To do this, server's server prefix must precede the target picture.
What to do
Configure the following code for a picture change to a button, for example:
'VBS125 HMIRuntime.BaseScreenName = "Serverprefix::New screen"
See also
Examples in WinCC (Page734)
737
1.15.2.7
Introduction
If partitioned pictures are used in the configuration, e.g. in a basic picture title and operating bar for the user interface and an embedded picture window for the actual picture display, configure a picture change using the properties of the picture window. The property of the "ScreenName" picture window must be changed in order for the other picture to appear. The action and picture window must be configured in the same picture.
What to do
In the following example, the "test.pdl" picture is displayed in the "ScreenWindow" picture window when executing the action:
'VBS126 Dim objScrWindow Set objScrWindow = ScreenItems("ScreenWindow") objScrWindow.ScreenName = "test"
See also
Examples in WinCC (Page734)
1.15.2.8
Introduction
If a GSC diagnostics window has been inserted in the picture, diagnostics output can be displayed in the diagnostics window in Runtime using the Trace command. GSC Diagnostics issues the Trace methods contained in the actions in the chronological sequence they are called. This also applies to Trace instructions in procedures which are called in actions. The targeted implementation of Trace instructions, e.g. for the output of tag values, enables the progress of actions and the procedures called in them to be traced. The Trace instructions are entered in the form "HMIRuntime.Trace(<Ausgabe>)". The GSC Diagnostics displays trace output from C and VBS.
What to do
The following example writes a text in the diagnostics window:
'VBS127 HMIRuntime.Trace "Customized error message"
738
See also
Examples in WinCC (Page734)
1.15.2.9
Introduction
Using VBS, it is possible to write a tag value to the PLC, e.g. by clicking the mouse on a button to specify setpoint values, or to set internal tag values to trigger other actions. Various write variations are mentioned and explained below.
Simple writing
In the following example, a value is written to the "Tag1" tag:
'VBS128 HMIRuntime.Tags("Tag1").Write 6
Referencing offers the advantage of being able to work with the tag object before writing. The tag value can be read, calculations executed and written again:
'VBS130 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") objTag.Read objTag.Value = objTag.Value + 1 objTag.Write
Synchronous writing
Normally, the value to be written is transferred to the tag management and processing of the action resumed. In some cases, however, it must be ensured that the value has actually been written before processing of the action can be resumed.
739
or
'VBS132 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") objTag.Value = 8 objTag.Write ,1
Note Please note that the call takes longer in comparison to the standard call. The duration is also dependent on the channel and AS, amongst other things. The type of writing complies to the SetTagXXXWait() call in C scripting.
740
Note After writing a tag, the QualityCode property of the local tag object is set to "BAD Out of Service" because it is not known which Quality Code manages the tag in the process. The Quality Code cannot be written from VBS.
See also
Write Method (Page725) Examples in WinCC (Page734)
Simple reading
In the following example, the value of "Tag1" is read and displayed in the Global Script diagnostics window:
'VBS134 HMIRuntime.Trace "Value: " & HMIRuntime.Tags("Tag1").Read & vbCrLf
741
Referencing offers the advantage of being able to work with the tag object. The tag value can be read, calculations executed and written again:
'VBS136 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") objTag.Read objTag.Value = objTag.Value + 1 objTag.Write
Using the Read method, process tags which have been read are added to the image, from this moment on they cyclically requested from the AS. If the tag is already in the image, the value contained in it is returned. For Close Picture, the tag actions are ended again. Note If a tag is requested in a Global Script action, it remains registered throughout the enter Runtime of WinCC.
Direct reading
Normally, the tag values are read from the tag image. In certain situations, however, it may be necessary to read the value direct from the AS, e.g. to synchronize fast processes. If the optional parameter is set to 1 for the read process, the tag is not logged in cyclically but the value is requested once from the AS.
'VBS137 Dim objTag Set objTag = HMIRuntime.Tags("Tag1") HMIRuntime.Trace "Value: " & objTag.Read(1) & vbCrLf
Note Please note that the call takes longer in comparison to the standard call. The duration is also dependent on the channel and AS, amongst other things. This type of call must be avoided in the case of cyclic C actions because this is the main reason for performance problems. This type of read process corresponds to GetTagXXXWait() call from C scripting.
742
Note If an error occurs during reading, QualityCode is set to BAD NON-SPECIFIC. Therefore, it is sufficient to check the QualityCode following reading.
See also
Read Method (Page698) Examples in WinCC (Page734)
743
Note If the work is completed without an object reference, only the standard properties are provided in Intellisense. The form of expression used in the example only applies to Graphics Designer. In the case of analog actions in Global Script, address the objects using the HMIRuntime object.
Referencing is useful when several object properties must be changed. When using Intellisense, this process then lists all the object properties. Note The form of expression used in the example only applies to Graphics Designer. In the case of analog actions in Global Script, address the objects using the HMIRuntime object.
744
It is not necessary to specify the picture name. It is possible to address a picture uniquely using the picture window name. Therefore, it is sufficient to specify the name of the picture window, as in the following example:
'VBS142 Dim objRectangle Set objRectangle = HMIRuntime.Screens("ScreenWindow1.ScreenWindow2").ScreenItems("Rectangle1") objRectangle.BackColor = RGB(255,0,0)
This type of addressing enables objects in picture windows to be addressed in different pictures. This is a particularly interesting aspect in respect of the picture module technique.
745
NOTICE If you make an object property dynamic with a VBS action via the return value of a script, the value of the object property is written only if it has changed in relation to the last script run. It is not considered if the value had been changed from another location. Therefore it is illegal to change properties which have been made dynamic by VBS action via the return value from another location (e.g., other C scripts or VBS scripts). if you do not observe this, wrong values can be the results.
See also
VBS Reference (Page109) Examples in WinCC (Page734)
1.15.2.12 Example: How to Start an Action on the Server (Logging Object) Introduction
In multi-user projects, the Logging object presently functions on the server only. The following example shows how to start an action on the server from the client, and how to swap and delete archive segments on client accordingly. The example shows a global action started with a control tag. The contents of the control tag determine whether the "Restore" method or the "Remove" method is called. At the end of the action, the control tag is set to "0". A query prevents the action from being started on client computers. Path and time period are passed on by internal tags. The path information may also contain a network release. Archive segments to be swapped must therefore not be stored locally at the server. It must be warranted, though, that the server may directly access the path. Note The example shows a delete suggestion and may be adjusted as needed.
746
What to do
1. Create the following internal tags with project-wide updating in the WinCC Explorer: - StartLogging (unsigned 8 bit value) - SourcePath (Text tag 8 bit character set) - TimeFrom (Text tag 8 bit character set) - TimeTo (Text tag 8 bit character set) - RetVal (signed 32 bit value) 2. Create a global VBS action and enter the tag StartLogging as tag trigger with cycle "Upon Change". 3. Copy the following script into the action
'VBS180 Dim StartLogging Dim SourcePath Dim TimeFrom Dim TimeTo Dim RetVal 'Exit when running on client If (Left(HMIRuntime.ActiveProject.Path, 1) = "\") Then Exit Function End If 'read parameters StartLogging = HMIRuntime.Tags("StartLogging").Read SourcePath = HMIRuntime.Tags("SourcePath").Read(1) TimeFrom = HMIRuntime.Tags("TimeFrom").Read(1) TimeTo = HMIRuntime.Tags("TimeTo").Read(1) 'restore or remove depends on the parameter If (StartLogging = 1) Then RetVal = HMIRuntime.Logging.Restore(SourcePath, TimeFrom, TimeTo, -1) HMIRuntime.Tags("RetVal").Write RetVal, 1 HMIRuntime.Tags("StartLogging").Write 0,1 Elseif (StartLogging = 2) Then RetVal = HMIRuntime.Logging.Remove(TimeFrom, TimeTo, -1) HMIRuntime.Tags("RetVal").Write RetVal, 1 HMIRuntime.Tags("StartLogging").Write 0,1 End If
The action may be started on a client with the following action, for example. Please note that parameters must be written prior to setting the control tag.
'VBS181 'set parameters HMIRuntime.Tags("SourcePath").Write "\\client_pc\temp",1 HMIRuntime.Tags("TimeFrom").Write "2004",1 HMIRuntime.Tags("TimeTo").Write "2004",1 'start action HMIRuntime.Tags("StartLogging").Write 1.1
747
748
Example 4: WinCC FunctionTrendControl with value supply via array (before WinCC V7)
In this example, a Function Trend Control called "Control1" is supplied with 100 value pairs. In order that the value pair can be transferred correctly, the transfer e.g. in "dblAxisXY" must not occur directly but via an intermediate tag, e.g. "varTemp".
'VBS152 Dim lngIndex Dim dblXY(1) Dim dblAxisXY(100) Dim varTemp Dim objTrendControl Set objTrendControl = ScreenItems("Control1") For lngIndex = 0 To 100 dblXY(0) = CDbl(lngIndex * 0.8) dblXY(1) = CDbl(lngIndex)
749
Note Insert the instructions, separated by stops, in self-defined procedures. Declaration and assignments must always precede them.
See also
General examples for VBScript (Page755)
Example: How to configure a user-defined toolbar button with a self-created selection dialog Introduction
In the following example you create a user-defined toolbar button of an OnlineTrendControl. On this toolbar button you configure a self-created selection dialog with which you can optionally set one of two different time ranges of the OnlineTrendControl.
750
Requirement
The Graphics Designer is open. An archive is created in the Tag Logging Editor.
751
752
Requirement
The Graphics Designer is open. An archive is created in the Tag Logging Editor with three archive tags.
753
754
objTrend.ValueAxis = objValueAxis.Name 'add new trend and assign properties Set objTrend = objTrendControl.GetTrendCollection.AddItem("myTrend3") objTrend.Provider = 1 objTrend.TagName = "TestArchive\ArchivTag3" objTrend.Color = RGB(0,0,255) objTrend.TrendWindow = objTrendWindow.Name objTrend.TimeAxis = objTimeAxis.Name objTrend.ValueAxis = objValueAxis.Name
Note In the VB script, replace the archive used and the archive tags "Archive\ArchiveTagX" with the names of the archive and archive tags that have been created.
1.15.3
1.15.3.1
General Examples
General examples for VBScript
Introduction
This section contains examples of the general use of VBScript with regard to the following topics: Program data connection with VBS To retrieve methods Using the MS Automation Interface Starting External Applications
755
See also
Example: Configuring a Database Connection with VBS (Page756) Example: Starting an external application (Page760) Example: Using the MS Automation interface (Page758) Example: Calling Methods of an ActiveX Control (Page748)
1.15.3.2
Introduction
The following examples describe the configuration of an Access database link via an ODBC driver. Example 1 writes a tag value from WinCC in an Access database. Example 2 reads a value from the database and writes it in a WinCC tag. The examples do not contain any handling faults.
Procedure, Example 1
1. Create the Access database with the WINCC_DATA table and columns (ID, TagValue) with the ID as the Auto Value. 2. Set up the ODBC data source with the name "SampleDSN", reference to the above Access database. 3. Programming.
756
Example 1
'VBS108 Dim objConnection Dim strConnectionString Dim lngValue Dim strSQL Dim objCommand strConnectionString = "Provider=MSDASQL;DSN=SampleDSN;UID=;PWD=;" lngValue = HMIRuntime.Tags("Tag1").Read strSQL = "INSERT INTO WINCC_DATA (TagValue) VALUES (" & lngValue & ");" Set objConnection = CreateObject("ADODB.Connection") objConnection.ConnectionString = strConnectionString objConnection.Open Set objCommand = CreateObject("ADODB.Command") With objCommand .ActiveConnection = objConnection .CommandText = strSQL End With objCommand.Execute Set objCommand = Nothing objConnection.Close Set objConnection = Nothing
Procedure, Example 2
1. Create the WinCC tag with the name dbValue. 2. Create Access database with WINCC_DATA table and ID, TagValue columns: ID, create TagValue (ID as auto value). 3. Set up the ODBC data source with the name "SampleDSN", reference to the above Access database. 4. Programming.
Example 2
'VBS108a Dim objConnection Dim objCommand Dim objRecordset Dim strConnectionString Dim strSQL Dim lngValue Dim lngCount strConnectionString = "Provider=MSDASQL;DSN=SampleDSN;UID=;PWD=;" strSQL = "select TagValue from WINCC_DATA where ID = 1" Set objConnection = CreateObject("ADODB.Connection") objConnection.ConnectionString = strConnectionString objConnection.Open Set objRecordset = CreateObject("ADODB.Recordset")
757
Set objCommand = CreateObject("ADODB.Command") objCommand.ActiveConnection = objConnection objCommand.CommandText = strSQL Set objRecordset = objCommand.Execute lngCount = objRecordset.Fields.Count If (lngCount>0) Then objRecordset.movefirst lngValue = objRecordset.Fields(0).Value HMIRuntime.Tags("dbValue").Write lngValue Else HMIRuntime.Trace "Selection returned no fields" & vbNewLine End If Set objCommand = Nothing objConnection.Close Set objRecordset = Nothing Set objConnection = Nothing
There are several ways in which to define the ConnectionString for the connection depending on the provider used:
See also
General examples for VBScript (Page755)
1.15.3.3
Introduction
The following three examples illustrate how to use the MS Automation interface.
758
Example 1: MS Excel
In this example, an output value from an input field is written in an Excel table.
'VBS113 Dim objExcelApp Set objExcelApp = CreateObject("Excel.Application") objExcelApp.Visible = True ' 'ExcelExample.xls is to create before executing this procedure. 'Replace <path> with the real path of the file ExcelExample.xls. objExcelApp.Workbooks.Open "<path>\ExcelExample.xls" objExcelApp.Cells(4, 3).Value = ScreenItems("IOField1").OutputValue objExcelApp.ActiveWorkbook.Save objExcelApp.Workbooks.Close objExcelApp.Quit Set objExcelApp = Nothing
Example 2: MS Access
This example opens a report from MS Access.
'VBS114 Dim objAccessApp Set objAccessApp = CreateObject("Access.Application") objAccessApp.Visible = True ' 'DbSample.mdb and RPT_WINCC_DATA have to create before executing 'this procedure. 'Replace <path> with the real path of the database DbSample.mdb. objAccessApp.OpenCurrentDatabase "<path>\DbSample.mdb", False objAccessApp.DoCmd.OpenReport "RPT_WINCC_DATA", 2 objAccessApp.CloseCurrentDatabase Set objAccessApp = Nothing
759
VBS for Creating Procedures and Actions 1.16 Basic Principles of VBScript
See also
General examples for VBScript (Page755)
1.15.3.4
Introduction
The following two examples illustrate how to start an external application.
Example:
'VBS117 Dim objWshShell Set objWshShell = CreateObject("Wscript.Shell") objWshShell.Run "Notepad Example.txt", 1
See also
General examples for VBScript (Page755)
1.16
1.16.1
Introduction
The most important topics of the Microsoft VBScript Reference are provided below: VBScript Language Directory VBScript Tutorial with the most important basic principles Scripting runtime reference If a full version of the VBScript Reference is required, it is available under http://msdn2.microsoft.com/en-us/library/t0aew7h6 (http://msdn2.microsoft.com/en-us/library/ t0aew7h6)
760
VBS for Creating Procedures and Actions 1.16 Basic Principles of VBScript
See also
Microsoft VBScript Reference (http://msdn2.microsoft.com/en-us/library/t0aew7h6)
1.16.2
VBScript Basics
761
In Runtime, background tasks, such as printing daily reports, monitoring tags or performing picture-specific calculations, are performed as actions. These actions are started by triggers. Functions can be called from actions. WinCC has a multitude of functions, which can be modified by the user. Furthermore, the user can also develop his own functions. The Global Script editor is used to create and edit functions and actions. This chapter will show you How to use the Global Script editor How to create and edit functions How to create and edit actions How to use the diagnostic tools to analyze runtime problems
2.2
Introduction
WinCC supports the use of functions and actions for dynamization of the processes in your WinCC project. These functions and actions are written in ANSI-C.
763
ANSI-C for Creating Functions and Actions 2.2 Creating Functions and Actions
Trigger Types
The following trigger types are available:
764
ANSI-C for Creating Functions and Actions 2.2 Creating Functions and Actions
Actions are used for picture-independent background tasks, such as printing daily reports, monitoring tags or performing calculations. Functions are pieces of code, which can be used in several locations, but are only defined in one place. WinCC includes a multitude of functions. Furthermore, you can also write your own functions and actions. The included standard functions can be modified by the user. In the event that WinCC is reinstalled or upgraded, the standard functions that were modified are deleted or replaced by the unedited standard functions. Therefore, you should back up the modified functions prior to upgrading or reinstalling.
Design Tool
WinCC supports the design, creation and editing of functions and actions with the Global Script editor. Global Script is started from the navigation window of WinCC Explorer.
765
ANSI-C for Creating Functions and Actions 2.3 Characteristics of Project Functions
See also
Runtime Behavior of Actions (Page824) How To Create and Edit Actions (Page802) Creating and Editing Functions (Page790) The Global Script Editor (Page775) Use of DLLs in Functions and Actions (Page774) Use of Global C-Tags (Page772) How to Add Global Script Runtime to a Project's Startup List (Page771) How to Generate a New Header (Page786) Characteristics of Global Actions (Page770) Characteristics of Local Actions (Page769) Characteristics of Internal Functions (Page768) Characteristics of Standard Functions (Page767) Characteristics of Project Functions (Page766)
2.3
766
ANSI-C for Creating Functions and Actions 2.4 Characteristics of Standard Functions
See also
How to Protect a Function Against Unauthorized Access (Page798) Creating and Editing Functions (Page790)
2.4
767
ANSI-C for Creating Functions and Actions 2.5 Characteristics of Internal Functions
See also
How to Use Standard and Project Functions (Page796) Creating and Editing Functions (Page790)
2.5
768
ANSI-C for Creating Functions and Actions 2.6 Characteristics of Local Actions
2.6
769
ANSI-C for Creating Functions and Actions 2.7 Characteristics of Global Actions
See also
How to Protect an Action Against Unauthorized Access (Page809) Triggers (Page811) How To Create and Edit Actions (Page802) How to Add Global Script Runtime to a Project's Startup List (Page771)
2.7
770
ANSI-C for Creating Functions and Actions 2.8 How to Add Global Script Runtime to a Project's Startup List
In contrast to local actions, global actions are executed on all project computers in a clientserver project. In a single-user project there is no difference between global and local actions.
See also
How to Protect an Action Against Unauthorized Access (Page809) Triggers (Page811) How To Create and Edit Actions (Page802) How to Add Global Script Runtime to a Project's Startup List (Page771)
2.8
Introduction
In order to run Global Script Actions in Runtime, Global Script Runtime must be added to the project's startup list. This does not affect the executability of the functions.
Procedure
1. In the shortcut menu of computer in WinCC Explorer, select "Properties". The "Computer Properties" dialog is opened. 2. Click the "Startup" tab.
771
ANSI-C for Creating Functions and Actions 2.9 Use of Global C-Tags
3. Selection option "Global Script Runtime".
2.9
772
ANSI-C for Creating Functions and Actions 2.9 Use of Global C-Tags
void dummy() //Function name { . //Function code }
Validity range
A tag defined in this manner is known to every function and action in Runtime. It is created as soon as Runtime is started, even if the function itself was not called. Note When you operate the WinCC Service Mode, there is no common data area for C scripting. Thus, for example, no global C variables can be exchanged between "Global Script" and the "Graphics Designer".
773
ANSI-C for Creating Functions and Actions 2.10 Use of DLLs in Functions and Actions
2.10
Adjusting DLLs
WinCC allows you to use your own DLLs (Dynamic Link Libraries). Functions in existing DLLs can be enabled for functions and actions by making the necessary additions to the respective function or action. Add the following code in front of the function or action: #pragma code("<Name>.dll") <Type of returned value> <Function_name 1>(...); <Type of returned value> <Function_name2>(...); . . . <Type of returned value> <Function_name n>(...); #pragma code() The functions <Function_name 1> ... <Function_name n> from <Name.dll> are declared and can now be called by the respective function or action. Example: #pragma code("kernel32.dll") VOID GetLocalTime(LPSYSTEMTIME lpSystemTime); #pragma code() SYSTEMTIME st; GetLocalTime(&st); As an alternative to this procedure, you can also make the necessary additions in the "Apdefap.h" header file. When using own DLLs in WinCC, you must use the release version. WinCC is delivered as a release version and thus uses the release version of the system DLLs. If you generate a custom DLL in the debug version, it is possible that both the release and the debug version of the DLL are loaded, increasing the memory requirements.
774
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Structures of the DLL have to be set up using 1-byte alignment. Note The DLL must be saved in either the "\bin" directory or in a path defined in the "PATH" system tag. This tag is defined in the operating system properties.
2.11
2.11.1
Introduction
WinCC supports the creation and editing of functions and actions with the Global Script editor. Global Script is started from the project window of WinCC Explorer.
775
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Figure 2-1
776
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Find in Files:
The results of the search are displayed in the output window with one line per search term found. Each line has a line number and shows the path and file name plus the line number and text of the line in which the search term was found. By double-clicking a line displayed in the output window, you can open the associated file. The cursor is placed in the line in which the search term was found.
The Toolbars
Global Script has two toolbars. They can be made visible as needed and dragged to any position on the screen with the mouse.
777
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
See also
Printing Functions and Actions (Page788) How to Search in Files (Page787) How to Compile All Functions (Page786) How to Generate a New Header (Page786) How to Delete Actions or Project and Standard Functions (Page785) How to Use "Save As..." (Page784) How to Set the Font Style (Page784) How to Set Different Views (Page783) Working with the Toolbars (Page781) Working in the Edit Window (Page778)
2.11.2
2.11.2.1
Introduction
The edit window includes an array of functions, which can be executed with either the keyboard or the mouse. In the edit window, you can edit functions and actions.
778
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Contents
The window can be split. The upper part of the edit window displays the code of the function or action. In the lower part, you can see the messages that the compiler output while compiling the function or action.
Properties
When the window is opened for the first time, the lower part of the window is minimized. When the compiler process is started, the lower part of the window is enlarged to allow for the display of the compiler messages. The division of the window can be adjusted with the mouse. Doubleclick an error message to jump to the corresponding line in the code.
Color code
The C code is color-coded as follows:
Color Blue Green Red Black Description Keywords Comments Strings Other C-codes Example define, double, if // is a comment "Rectangle3" level=100*newvalue/255;
779
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Note A function or action cannot have more than 32767 characters including spaces.
See also
Editing Functions with the Mouse (Page780) Editing Functions with the Keyboard (Page780)
2.11.2.2
Move cursor by one window content to end of text <PAGE DOWN> <CTRL+PAGE UP> <CTRL+PAGE DOWN> <TAB> <CTRL+X> <CTRL+C> <CTRL+V>
2.11.2.3
780
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Editing function Extended selection Set cursor Move selected text Duplicate selected text Mouse command (left mouse button) <SHIFT> + mouse-click Click Drag and drop <CTRL>+drag and drop
Other editing functions: By double-clicking a compiler error message, the editor jumps to the corresponding line in the code. Right-clicking calls up a shortcut menu. With the following actions, the selected text is replaced by the result of the action: Input of character(s) through the keyboard Pasting of text from the clipboard Insertion of a function call by means of parameter assignment
2.11.3
Purpose
The toolbars are located in their default position below the menu bar, at the top of the Global Script window. The toolbar buttons allow for fast and easy execution to a number of Global Script functions. There are two toolbars available: The standard toolbar
Contents
The standard toolbar contains buttons for the following functions:
Button Function Creates a new action. Creates a new standard function. Key combination <ALT+A> or <CTRL+N> <ALT+S> or <CTRL+N>
781
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Button Function Creates a new project function. Creates a new header file. Opens an existing action or function. Saves the content of the active edit window. This function is only available, if an edit window is open. Cuts the selected text and copies it to the clipboard. This function is only available, if text has been selected. Copies the selected text to the clipboard. This function is only available, if text has been selected. Pastes the contents of the clipboard at the location of the cursor. This function is only available, if the clipboard is not empty. Undoes the last maximum 30 editor actions. This function is only available, if an editor action has been performed. Redoes the last editor action that was undone. This function is only available, if an editor action has been undone. Prints the contents of the active edit window as project documentation. This function is only available, if an edit window is open. Activates the direct help (What's this?). Generates a new header. Allows you to set the font. Key combination <ALT+P> or <CTRL+N> <CTRL+H> <CTRL+O> <CTRL+S> <CTRL+X> <CTRL+C> <CTRL+V>
<CTRL+Z> <CTRL+A>
<CTRL+P>
Note The key combination <CTRL+N> is only available, if at least one edit window is open. If the active edit window contains a function and <CTRL+N> is pressed, a new project function is created. If the active edit window contains an action, this key combination creates a new global action. The editing toolbar contains buttons for the following functions:
Button Function Enables you to add information about functions and, in the case of an action, to setup a trigger. This function is only available, if an edit window is open. Compiles the code in the active edit window. This function is only available, if an edit window is open. Opens the tag dialog. This function is only available, if an edit window is open. Key combination <CTRL+I>
<SHIFT+F8> <CTRL+R>
782
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Button Function Opens a dialog for the selection of a picture. The name of the selected picture is inserted at the position of the cursor in the edit window. This function is only available, if an edit window is open. Imports an action. This function is only available, if there is an action in the active window. Exports the action from the active edit window. This function is only available, if there is an action in the active window. Key combination <CTRL+W>
<CTRL+M> <CTRL+T>
Properties
Both toolbars can be shown or hidden. They can be pinned below the menu bar. When they are not pinned down, they can be dragged with the mouse to any position on the screen.
See also
How to Set Different Views (Page783)
2.11.4
Introduction
In this context, views are considered to be different combinations of elements visible in the Global Script editor, such as the output window, status bar and toolbars. These elements can be individually displayed or hidden. By default, all elements are visible.
Procedure
1. Opens the "View" menu in the Global Script menu bar. 2. Activate or deactivate the display of the desired elements e.g. the toolbars. If "show" is chosen, a check mark is displayed in front of the name. Note When Global Script restarted, the editor reverts to the default settings and all elements are again visible.
783
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
2.11.5
Introduction
The font style is composed of the settings "Font", "Style" and "Size". The style selected is active in all edit windows.
Procedure
1. Click the button in the standard toolbar to open the dialog for setting the font style. 2. Make the desired settings. 3. Confirm your settings by clicking "OK".
Alternative procedure
You can also open the dialog for the font style settings in the following manner: Select the "Options" menu in the Global Scripts menu bar and select "Font", or use the corresponding key combination. Note The settings are automatically saved and are not reset when WinCC is restarted.
2.11.6
Introduction
If a function or action is created, Global Script saves the corresponding file in a predefined path with a default file name, e.g. "new_function_1.fct" for functions and "gsccs1.pas" for actions. Since these default file names are not particularly useful, use "Save As ..." to save the function or action under a different - more meaningful - file name. The file with the default file name is retained. With "Save As ...", only the file name is changed, the function or action name remains unchanged. Global Script expects that the function or action is saved in a project directory. If this is not the case, a message is displayed, but the file is saved nonetheless.
Requirement
"Save As..." is only available, if at least one edit window is open. It saves the content of the active edit window.
784
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
Procedure
1. In the Global Script menu bar, open the "File" menu. 2. Select "Save As...". 3. Enter the new file name. 4. Close the dialog by clicking the "Save" button.
See also
How to Delete Actions or Project and Standard Functions (Page785)
2.11.7
Introduction
Actions or project and standard functions can be deleted during configuration or in Runtime. Global Script deletes the entry in the navigation window as well as the associated file. If a deleted function is called by an action, the action is terminated upon calling the function. If a Global Script diagnostic window is open at this time, a message is displayed. The termination of the action is logged in the "WinCC_Sys_xx.log" diagnostic file (xx = consecutive number). This diagnostic file is located in the "Diagnostics" subdirectory of the WinCC installation directory.
Procedure
1. In the Global Script navigation window, call up the shortcut menu for the function or action to be deleted. 2. Select "Delete". 3. Confirm the command by clicking "Yes".
Alternative operation
Instead of using the shortcut menu, you can also delete the selected function or action by using the <DELETE> key. Note If a function is deleted, the entry in the respective header file is deleted as well.
785
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
2.11.8
Introduction
The header must be generated again in the following cases: After you have copied project functions from a different project to the "library" directory in your project path. After you have copied standard functions from another PC to the "aplib" directory (or subdirectory). When the header is generated again, the functions that have been copied are entered into the corresponding header files and are then available to you to use in your project.
Requirement
This function is only available, if all edit windows are closed.
Procedure
1. Click the button in the standard toolbar.
Alternative operation
Alternatively, you can start a generation process as follows: Open the "Options" menu and select "Regenerate Header" or use the corresponding key combination. Note Once the regeneration is finished, the contents of the navigation window are updated. If WinCC is in Runtime, the Runtime system is not influenced by the regeneration of the header.
2.11.9
Introduction
After all manual changes have been made to the header files, all functions must be recompiled. All project, standard and internal functions are compiled automatically. The results of the individual compilations are displayed in the output window as follows: If necessary, the compiler outputs warnings and error messages for each compiled function. In the next line, the path and file name of the compiled function as well as the summary message from the compiler are displayed.
786
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
If functions are called in other functions, errors might occur and error messages might be displayed. The reason for this is that the called functions have not yet been compiled. These functions must then be compiled individually.
Requirement
This function is only available, if all edit windows are closed.
Procedure
1. Open the "Options" menu. 2. Select "Compile All Functions".
Alternative operation
You can compile all functions using the key combination <ALT+U>. Note In a multi-user project, the "Compile All Functions" function is not available. The reason for this is that it is no longer possible to allocate the functions in such projects.
2.11.10
Introduction
All files of the group selected in the navigation window are searched for the specified search term. The result of the search is displayed in the output window as follows: For each found search term, a line is displayed in the output window. This line contains the line number of the line in the code in which the search term was found, plus the path and file name as well as the line of code itself. Standard and project functions as well as actions can be opened by double-clicking the search results. The cursor is positioned at the start of the line in which the search term was found. In the case of internal functions, the function containing the search term is shown in the navigation window and selected.
Procedure
1. Open the shortcut menu for the group to be searched in the Global Script navigation window. 2. Select "Find in Files". 3. In the dialog, enter the search term to be found. 4. Click "Find" to start the search. The result of the search is displayed in the output window.
787
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
2.11.11
See also
How to Print the Project Documentation (Page789) How to Open Page View (Page789) How to Set the Print Parameters (Page788)
Requirement
At least one edit window must be open.
Procedure
1. In the Global Script menu bar, open the "File" menu. 2. Select "Project Documentation Setup..."
788
ANSI-C for Creating Functions and Actions 2.11 The Global Script Editor
3. In the subsequent dialog, adjust the desired settings. 4. Apply the settings by clicking "OK". Note The settings are automatically saved and are not reset when WinCC is restarted.
Procedure
1. In the Global Script menu bar, open the "File" menu. 2. Select "Project Documentation Setup...".
Procedure
1. In the Global Script menu bar, open the "File" menu. 2. Select "Print Project Documentation".
789
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
2.12
2.12.1
Introduction
The system distinguishes between project, standard and internal functions. WinCC is delivered with a broad selection of standard and internal functions. Furthermore, you can create your own project and standard functions or modify standard functions. Please remember, however, that the standard functions included with WinCC are overwritten when WinCC is reinstalled so any modifications are lost. Internal functions cannot be created or edited.
Using Functions
If the same calculation must be performed - with different starting values - in several actions, it would be to your advantage to program a function to perform this calculation. Subsequently you can simply call this function with the current parameters in the actions. This approach has a number of advantages: The code is only programmed once. Modifications are only made at one point, namely in the procedure, not in each action. The action code is shorter and, thus clearer.
790
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
Finding Functions
To access existing functions or create new ones, you can either use the "File" menu in the Global Script navigation window or click the corresponding button in the toolbar. Functions are stored in the file system as follows:
791
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
If you save a function that has not been compiled without errors, the navigation window.
See also
Working in the Edit Window (Page778) How to Use Functions from Other Sources (Page801) How to Rename a Function (Page800) How to Compile and Save a Function (Page799) How to Protect a Function Against Unauthorized Access (Page798) Inserting Additional Function-Related Information (Page797) How to Use Standard and Project Functions (Page796) How to Use Internal Functions (Page795) How to Write Function Code (Page794) How to Create a New Function (Page793) Characteristics of Standard Functions (Page767) Characteristics of Project Functions (Page766)
792
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
2.12.2
Introduction
The procedure is identical for both project and standard functions. In the navigation window, specify the type (project or standard function) and, for standard functions, the group, e.g. "graphics". This also specifies the place where the file is to be saved. Global Script suggests a default name, e.g. "new_function_3", for the new function. This is also the file name of the function. To ensure that the function name is unique, the suggested name includes a sequential number. As a rule, the default name should be replaced with a more informative function name. When the renamed function is first saved, the file name can also be changed. Global Script adds the following information to the function: date created, date modified and version. This information can be viewed in the "Properties" dialog. In the same dialog, you can also assign a password to protect the function against unauthorized modification or viewing. button. To open the dialog, click the Note Please note that only certain characters may be used in function names: characters (with the exception of national special characters), numbers and the underscore.
Procedure
1. In the navigation window, open the shortcut menu for the desired group. 2. Select "New". If a new function is created, the first line of code in the associated edit window contains the type of value returned and the default name of the new function. In the following brackets, you can enter a formal parameter if you wish. The function code is entered between the braces.
Alternative operation
Alternatively, you can also create a new function by clicking the associated button in the toolbar, via the "File" menu or by using the corresponding key combination.
See also
Inserting Additional Function-Related Information (Page797) How to Use "Save As..." (Page784)
793
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
2.12.3
Introduction
The function code is written in the edit window for the function. The programming language is ANSI-C. The code of any project or standard function can call other functions. The called function can be a project, standard, internal or DLL function. To make certain that the called function is known to the calling function, the line #include "apdefap.h" is added as the first line of code in the calling function code. In the navigation window under "Internal Functions", the C-function library is available as "c_bib". The first line of code contains the type of the returned value and the default name of the new function. Parameters can be passed by entering them in the following brackets. The function code is entered between the braces.
Procedure
1. Double-click the function in the navigation window to open it in an edit window. 2. Set the cursor where you wish to begin writing. 3. Enter the desired code.
Alternative operation
You can also open a function as follows: In the navigation window, open the shortcut menu for the desired action and click "Open" or button in the standard toolbar or use the corresponding "File\Open...". You can also click the key combination. Note A maximum of 32 Kbytes of memory is available for local tags (tags defined within the braces of the function code).
794
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
See also
How to Use Standard and Project Functions (Page796) How to Use Internal Functions (Page795) Editing Functions with the Mouse (Page780) Editing Functions with the Keyboard (Page780) Working in the Edit Window (Page778)
2.12.4
Introduction
You can use any of the internal functions as part of your function code. The internal functions are found in the navigation window in the "Internal Functions" group. If you have used the "Assigning Parameters" dialog to add a function, the function's comments show the type of value returned.
Procedure
1. Place the cursor at the point at which the internal function is to be inserted. 2. In the navigation window, open the shortcut menu for the internal function to be added. 3. Select "Assigning Parameters". The "Assigning Parameters" dialog is opened. This dialog has one line for each parameter. In the "Value" column, enter the respective current parameter. 4. In the "Value" column, enter the current value for each of the required parameters. This can be accomplished by either a direct entry from the keyboard, or you can open the menu in the "Value" column (single-click and then click the displayed button). From the menu, you can open the selection dialog for tags, pictures or graphic objects. 5. Confirm your entries with "OK". The parameterized function is inserted in the edit window at the location of the cursor.
Alternative operation
Alternatively you can also open the "Assigning Parameters" dialog for an internal function by double-clicking the function to be added. Note If you close the "Assigning Parameters" dialog with "OK" without entering the current parameter value, the internal function is inserted with its formal parameters. You can then set the parameters in the edit window at a later stage. Instead of using the "Assigning Parameters" dialog, you can also use the keyboard to enter the function.
795
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
2.12.5
Introduction
You can use any project or standard function as part of the function code, if you have first added the line #include "apdefap.h" in the header. The project functions are found in the navigation window in the "Project Functions" group. The standard functions are found in the navigation window in the "Standard Functions" group. Project functions are entered in the "Ap_pbib.h" header file; standard functions are entered in the "Ap_glob.h" header file. These entries are made by the system. The " Ap_glob.h" header file is integrated into the "Ap_pbib.h" header file. The "Ap_pbib.h" header file itself is linked to the "Apdefap.h" header file. Therefore all project and standard functions are declared in the "Apdefap.h" file header. To inform the compiler of the project and standard functions added, add the line #include "apdefap.h" as the first line in the function code. If you have used the "Assigning Parameters" dialog to add a function, the function comments show the type of value returned.
Procedure
1. Place the cursor at the point at which the project or standard function is to be inserted. 2. In the navigation window, open the shortcut menu for the function to be added. 3. Select "Assigning Parameters". The "Assigning Parameters" dialog is opened. This dialog has one line for each parameter. In the "Value" column, enter the respective current parameter. 4. In the "Value" column, enter the current value for each of the required parameters. This can be accomplished by either a direct entry from the keyboard, or you can open the menu in the "Value" column (single-click and then click the displayed button). From the menu, you can open the selection dialog for tags, pictures or graphic objects. 5. Confirm the entries by clicking "OK". Note If the function does not require a parameter, it is added to the function code immediately without opening the "Assigning Parameters" dialog. If you close the "Assigning Parameters" dialog with "OK" without entering the current parameter value, the internal function is inserted with its formal parameters. You can then set the parameters in the edit window at a later stage.
796
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
2.12.6
Introduction
Additional information can be assigned to every function. When a new action is created, the creation date is automatically entered in the function-related information and is unchangeable. In addition, the version number 1.0 is also assigned to the number. The version numbers can be individually assigned when editing a function. When a function is changed and saved, the current date of change is entered automatically and is unchangeable. This dialog can be used to assign a password to protect the function from unauthorized viewing and modification.
Requirement
The function to which the information relates must be open in an edit window.
Procedure
1. Click the button in the editing toolbar. The "Properties" dialog is opened. 2. Select the required entries.
Alternative operation
Alternatively, the "Properties" dialog can be opened as follows: Click the "Edit" menu and select the "Info" option or use the corresponding key combination.
797
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
See also
How to Protect a Function Against Unauthorized Access (Page798) How to Set Different Views (Page783) Working with the Toolbars (Page781)
2.12.7
Introduction
Functions can be protected with a password against unauthorized read and write access. The password is a part of the function-related information.
Requirement
The function to be compiled must be opened in the edit window.
Procedure
1. Click the button in the editing toolbar. The "Properties" dialog is opened. 2. Select the "Password" check box. 3. Click the "Change" button.
4. Enter the password in the "Password" field. 5. Enter the password again in the "Confirmation" field. 6. Confirm the entries by clicking "OK". 7. Click "OK" to close the dialog.
Alternative operation
Alternatively, the "Properties" dialog can be opened as follows: Click the "Edit" menu and select the "Info" option or use the corresponding key combination.
798
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
Note A password-protected function can only be opened in the edit window if the correct password is entered. To deactivate the password protection, clear the "Password" check box.
See also
How to Set Different Views (Page783) Working with the Toolbars (Page781)
2.12.8
Introduction
In order to use a function, it must first be compiled. Only the function in the active edit window is compiled. Errors reported by the compiler are displayed in the lower portion of the window. Each message is displayed on a separate line. The line includes the line number in the source code where the error occurred, a hexadecimal encoded error code and a description of the error. Double-click such a line to select the source code line where the error occurred. It is recommended that you examine the first message error listed, as subsequent ones could be errors resulting from the first one. If the first error is corrected, then the others might disappear after the next compilation. To make the changes permanent, the function must be saved. If you save a function that has not been properly compiled, the navigation window. symbol is shown in the symbol is shown in the
If you save a function that has not been compiled without errors, the navigation window.
Requirement
The function to be compiled must be opened in the edit window.
Procedure
1. Click the button in the editing toolbar. 2. Examine the compiler messages in the lower portion of the edit window. 3. If the compiler reported an error, the function code must be corrected. After this has been done, start again with step 1 in this table.
799
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
4. If the compiler generated warnings, the function source code may require correction. After the code has been corrected, start again with step 1 in this table, otherwise proceed to step 6. 5. Click the button in the standard toolbar.
Alternative operation
Alternatively, the compilation process can be initiated in the following ways: Select "Compile" from the "Edit" menu, select the "Compile" option from the shortcut menu of the edit window or use the corresponding key combination. Saving may also be performed in the following ways: Select "Save" from the "File" menu or use the corresponding key combination.
See also
Runtime Behavior of Actions (Page824)
2.12.9
Introduction
It is recommended that you rename the function, when it is created. The name of the function in the edit window is then changed accordingly. Since this also changes the code, the function must be recompiled. The old function name, displayed in the navigation window, is assigned prefix "*" (asterisk). Afterwards, the modified function must be saved at which time you can change the path and file name. The old function should then be deleted to avoid accumulating a collection of obsolete functions. Note Please note that only certain characters may be used in function names: characters (with the exception of national special characters), numbers and the underscore.
Procedure
1. Change the function name in the edit window. 2. Click the 3. Click the button in the editing toolbar. The function is compiled. button in the standard toolbar to save the function.
4. If desired, enter a different path and/or file name. 5. Confirm your entry by clicking "Save".
800
ANSI-C for Creating Functions and Actions 2.12 Creating and Editing Functions
Alternative operation
Alternatively, the compilation process can be initiated in the following ways: Select "Compile" from the "Edit" menu, select the "Compile" option from the shortcut menu of the edit window or use the corresponding keyboard shortcut. Saving may also be performed in the following ways: Select "Save" from the "File" menu or use the corresponding key combination.
2.12.10
Introduction
Project functions from other WinCC projects and standard functions from other WinCC systems can also be made useable for the current project. To do so they must be brought into the current project. Apart from the location in the file system in which they are saved, there is no difference in the procedure for project or standard functions.
Procedure
1. Copy the functions. Project functions are copied in the "\library" directory for the WinCC project. Standard functions are copied in the "\aplib\..." directory in the WinCC path. The content of the navigation window is updated automatically. 2. Click the button in the standard toolbar. When the header is regenerated, the copied functions are registered so that you can use them in your current project.
Alternative operation
Alternatively, you can start a generation process as follows: Open the "Options" menu and select "Regenerate Header" or use the corresponding key combination. Note In the event that WinCC is reinstalled or upgraded, the standard functions that were modified are deleted or replaced by the unedited standard functions. If WinCC is in Runtime, the Runtime system is not influenced by the regeneration of the header.
801
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
2.13
2.13.1
Introduction
There system distinguishes between global and local actions. In a client-server project, global actions are carried out on all computers in the project, whereas local ones are carried out only on the computer to which they are assigned. A global action can, for instance, be used to perform a calculation on all computers in the project. An example of use for a local action might be to output a log file on a server. The process of creating and editing both action types is identical.
Finding actions
New actions can be created, and existing actions can be accessed through the Global Script navigation window. Actions are stored in the file system as follows:
802
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Display of Actions
If a syntactically incorrect action is stored, it is displayed in the Global Script navigation window with the icon shown to the left.
If a syntactically correct action is stored with no trigger, it is displayed in the Global Script navigation window with the icon shown to the left.
If a syntactically correct action is stored with a trigger, it is displayed in the Global Script navigation window with the icon shown to the left.
Renaming actions
Actions are always displayed with their file names in the navigation window. Renaming an action means renaming the file containing the action code.
803
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Static tags used in the reset actions are reinitialized.
See also
How to Protect an Action Against Unauthorized Access (Page809) How to Use Actions From Other Sources (Page823) How to Rename an Action (Page822) How to Import an Action (Page821) How to Export an Action (Page821) How to Assign Authorizations (Page820) Triggers (Page811) How to Compile and Save an Action (Page810) Inserting Additional Action-Related Information (Page807) How to Edit Actions (Page807) How to Create a New Action (Page806) WinCC Coding Rule (Page805) How to Add Global Script Runtime to a Project's Startup List (Page771) Characteristics of Global Actions (Page770) Characteristics of Local Actions (Page769)
804
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
2.13.2
805
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Calls to functions to read and write tags and the utilization of picture names must then be handled using the defined names: GetTagDWord(ApcTagName1); OpenPicture(ApcPicName1); SetPictureName(ApcPicName2,"PictureWindow1",ApcPicName3);
2.13.3
Introduction
In a client-server project, global actions are carried out on all computers in the project, whereas local ones are carried out only on the computer to which they are assigned. The procedure is identical for both global and local actions. By specifying, in the navigation window, the location in which the action is saved, you specify its type (global or local). Global Script suggests a default name for the new action. A newly created action already contains the instruction #include "apdefap.h". Therefore, all functions are registered within the action. The name of the action is found in the third line. The first three lines cannot be deleted nor modified. This means that every function can be called from each action without requiring any special measures. Furthermore every action has a returned value of type "int" and it is already set to a value of 0. A returned value of an action can be used in conjunction with GSC Runtime for diagnostic purposes. The action code begins with a code framework in the form of comments. If this coding framework is filled out in accordance with the coding rules, the tags and picture names are recognized by CrossReference.
Procedure
1. In the navigation window, open the shortcut menu for the desired action type. 2. Select "New".
Alternative operation
Alternatively, you can also create a new action by clicking the associated button in the toolbar, via the "File" menu or by using the corresponding key combination.
See also
GSC Runtime (Page825) WinCC Coding Rule (Page805)
806
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
2.13.4
Introduction
An action is edited in its own edit window exactly like a function. Only the first three lines cannot be edited. The action must have a return value. The returned value is of the type "int" and is preset to 0. A returned value of an action can be modified and used in conjunction with GSC Runtime for diagnostic purposes. The returned value's type cannot be changed. To execute an action in Runtime, the action must have a trigger.
Procedure
1. Double-click the action in the navigation window to open it in an edit window. 2. Edit the action code.
Alternative operation
You can also open an action as follows: In the navigation window, open the shortcut menu for the desired action and click "Open" or "File\Open...". You can also click the button in the standard toolbar or use the corresponding key combination. Note A maximum of 32 Kbytes of memory is available for local tags (tags defined within the braces of the action code).
See also
GSC Runtime (Page825) How to Write Function Code (Page794)
2.13.5
Introduction
Additional information can be assigned to every action. When a new action is created, the creation date is entered in the action-related information automatically and is unchangeable. The action is also assigned version number 1.0. The version numbers can be individually assigned when editing an action. When an action is changed and saved, the current date of change is entered automatically and is unchangeable.
807
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
This dialog can be used to assign a password to protect the action against unauthorized read and write access.
Requirement
The action to which the information relates must be open in an edit window.
Procedure
1. Click the button in the editing toolbar. The "Properties" dialog is opened. 2. Select the required entries.
Alternative operation
Alternatively, the "Properties" dialog can be opened as follows: Click the "Edit" menu and select the "Info" option or use the corresponding key combination.
808
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
See also
How to Protect an Action Against Unauthorized Access (Page809) How to Set Different Views (Page783) Working with the Toolbars (Page781)
2.13.6
Introduction
Actions can be protected with a password against unauthorized read and write access. The password is a part of the action-related information.
Requirement
The action to be compiled must be opened in the edit window.
Procedure
1. Click the button in the editing toolbar. The "Properties" dialog is opened. 2. Select the "Password" check box. 3. Click the "Change" button.
4. Enter the password in the "Password" field. 5. Enter the password again in the "Confirmation" field. 6. Confirm the entries by clicking "OK". 7. Click "OK" to close the dialog.
Alternative operation
Alternatively, the "Properties" dialog can be opened as follows: Click the "Edit" menu and select the "Info" option or use the corresponding key combination.
809
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Note A password-protected action can only be opened in the edit window if the correct password is entered. To deactivate the password protection, clear the "Password" check box.
See also
How to Set Different Views (Page783) Working with the Toolbars (Page781)
2.13.7
Introduction
In order to use an action, it must first be compiled. Only the action in the active edit window is compiled. Errors reported by the compiler are displayed in the lower portion of the window. Each message is displayed on a separate line. The line includes the line number in the source code where the error occurred, a hexadecimal encoded error code and a description of the error. Double-click such a line to view the source code line where the error occurred. It is recommended that you examine the first message error listed, because subsequent ones could be errors resulting from the first one. If the first error is corrected, then the others might disappear after the next compilation.
Requirement
The action to be compiled must be opened in the edit window.
Procedure
1. Click the button in the editing toolbar. 2. Examine the compiler messages in the lower portion of the edit window. 3. If the compiler reported an error, the action source code must be corrected. After this has been done, start again with step 1 in this table. 4. If the compiler generated warnings, the action source code may require correction. After the code has been corrected, start again with step 1 in this table, otherwise proceed to step 6. 5. Click the button in the standard toolbar.
810
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Alternative operation
Alternatively, the compilation process can be initiated in the following ways: Select "Compile" from the "Edit" menu, select the "Compile" option from the shortcut menu of the edit window or use the corresponding keyboard shortcut. Saving may also be performed in the following ways: Select "Save" from the "File" menu or use the corresponding key combination.
Display of Actions
If a syntactically incorrect action is stored, it is displayed in the Global Script navigation window with the icon shown to the left.
If a syntactically correct action is stored with no trigger, it is displayed in the Global Script navigation window with the icon shown to the left.
If a syntactically correct action is stored with a trigger, it is displayed in the Global Script navigation window with the icon shown to the left.
See also
Runtime Behavior of Actions (Page824)
2.13.8
2.13.8.1
Triggers
Triggers
Trigger Types
The following trigger types are available:
811
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Acyclic Triggers
These consist of a specified date and time. The action specified by such a trigger is performed once at the date and time specified.
Cyclic Triggers
These consist of a specified time interval and starting point. The following types of cyclic triggers are available: Default cycle. The start of the first time interval coincides with the start of Runtime. The length of the interval is determined by the cycle. Hourly. The start of the interval is specified as minutes and seconds. The length of the interval is an hour. Daily. The start of the interval is specified by the time (hours, minutes and seconds). The length of the interval is a day. Weekly. The start of the interval is specified by the day of the week (Monday, Tuesday, etc.) and the time. The length of the interval is a week. Monthly. The start of the interval is specified by the day and time. The length of the interval is a month. Annually. The start of the interval is specified by the day, month and time. The length of the interval is a year.
Tag Triggers
These consist of the specification of one or more tags. The action associated with such a trigger is performed each time a change in the value of one of these tags is detected. How the tag values are queried may be customized for each tag. Either cyclic polling with a specified period or a reaction as soon as the system detects a change in the tag value may be selected. Depending on the choice of query method, it is possible that the tag changes but the system does not detect this. In this case the action is not performed.
812
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
The tag trigger only causes the action to be performed if the value of the trigger tag has changed. This is done to reduce the system load ( = action is performed).
The values of tags contained in the trigger are already known when the action begins. The GetTag() call can be used to access the value directly. Processing is much faster than for trigger tags than for those not contained in the trigger whose values must be obtained via GetTag() requests.
Display of Actions
If a syntactically incorrect action is stored, it is displayed in the Global Script navigation window with the icon shown to the left.
If a syntactically correct action is stored with no trigger, it is displayed in the Global Script navigation window with the icon shown to the left.
If a syntactically correct action is stored with a trigger, it is displayed in the Global Script navigation window with the icon shown to the left.
813
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
See also
How to Delete a Trigger (Page818) How to Change a Trigger (Page817) How to Add a New Trigger of the "Tag" Type (Page815) How to Add a New Trigger of the "Timer" Type (Page814)
2.13.8.2
Introduction
Triggers are used to execute actions in Runtime. To do t his, a trigger is linked to an action, forming the triggering event for calling the action. Actions without triggers are not executed. "Timer" type triggers can be cyclic or acyclic triggers. Acyclic triggers consist of a specified date and time. The action specified by such a trigger is performed once at the date and time specified. Cyclic triggers consist of a specified time interval and starting point. The following types of cyclic triggers are available: Default cycle. The start of the first time interval coincides with the start of the Runtime system. The length of the interval is determined by the cycle. Hourly. The start of the interval is specified as minutes and seconds. The length of the interval is an hour. Daily. The start of the interval is specified by the time (hours, minutes and seconds). The length of the interval is a day. Weekly. The start of the interval is specified by the day of the week (Monday, Tuesday, etc.) and the time. The length of the interval is a week. Monthly. The start of the interval is specified by the day and time. The length of the interval is a month. Annually. The start of the interval is specified by the day, month and time. The length of the interval is a year.
Requirement
The action to be linked with a trigger must be open in the active edit window.
Procedure
1. Click the button in the editing toolbar. The "Properties" dialog is opened. 2. Select the "Trigger" tab. 3. Select the trigger source "Timer" and click the "Add" button.
814
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
4. Select "Single" to add an acyclic trigger or select a cycle to add a cyclical trigger.
5. Complete the required details in the dialog. 6. Confirm the entries by clicking "OK". 7. Close the "Properties" dialog by clicking "OK".
Alternative operation
Alternatively, the "Properties" dialog can be opened as follows: In the "Edit" menu, select "Info", select "Info / Trigger" in the shortcut menu of the edit window, or use the corresponding key combination.
2.13.8.3
Introduction
Triggers are used to execute actions in Runtime. To do this, a trigger is linked to an action, forming the triggering event for calling the action. Actions without triggers are not executed. Tag triggers consist of one or more specified tags. The action associated with such a trigger is performed each time a change in the value of one of these tags is detected. How the tag values are queried may be customized for each tag. Either cyclic polling with a specified period or a reaction as soon as the system detects a change in the tag value may be selected.
815
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Depending on the choice of query method, it is possible that the tag changes while the system fails to detect this. In this case the action is not performed.
Requirement
The action to be linked with a trigger must be open in the active edit window.
Procedure
1. Click the button in the editing toolbar. The "Properties" dialog is opened. 2. Select the "Trigger" tab. 3. Select the trigger source "Tag" and click the "Add" button. The "Add Tags" dialog is opened.
4.
Click the button to open the tag selection dialog, select a tag and confirm your selection by clicking "OK".
5. In the "Add Trigger" dialog, open the shortcut menu in the "Standard cycle" column and then select the desired monitoring cycle. Selecting "After Every Change" results continuous monitoring. 6. Repeat steps 4 and 5, if you want add more tags. 7. Confirm the entries by clicking "OK". 8. Close the "Properties" dialog by clicking "OK".
816
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Alternative operation
Alternatively, the "Properties" dialog can be opened as follows: In the "Edit" menu, select "Info", select "Info / Trigger" in the shortcut menu of the edit window, or use the corresponding key combination. In the "Add Trigger" dialog, you can also enter a tag name directly and insert the tag in the "Trigger Name" column by clicking "Add". With this approach, the system does however not check whether the tag exists.
2.13.8.4
Introduction
Triggers that have been defined can be changed at any time. They can also be changed in Runtime.
Requirement
The relevant action must be opened in the edit window.
817
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Procedure
1. Click the button in the editing toolbar. The "Properties" dialog is opened. 2. Select the "Trigger" tab and select the trigger you wish to change.
3. Click the "Change" button to open the "Change Trigger" dialog. 4. Make the desired changes. 5. Confirm the entries by clicking "OK". 6. Close the "Properties" dialog by clicking "OK".
Alternative operation
Alternatively, the "Properties" dialog can be opened as follows: In the "Edit" menu, select "Info", select "Info / Trigger" in the shortcut menu of the edit window, or use the corresponding key combination.
2.13.8.5
Introduction
Triggers that have been defined can be deleted at any time. They can also be deleted in Runtime.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
818
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
If a trigger is deleted in Runtime, it only takes effect after the action is saved.
Requirement
The relevant action must be opened in the edit window.
Procedure
1. Click the button in the editing toolbar. The "Properties" dialog is opened. 2. Select the "Trigger" tab and select the trigger you wish to delete.
3. Delete the selected trigger by clicking "Delete". 4. Close the "Properties" dialog by clicking "OK".
Alternative operation
Alternatively, the "Properties" dialog can be opened as follows: In the "Edit" menu, select "Info", select "Info / Trigger" in the shortcut menu of the edit window, or use the corresponding key combination.
819
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
2.13.9
Introduction
With the Global Script - Runtime diagnostic tool, you can influence the processing of actions in Runtime. Each action can be assigned an authorization. This authorization only effects the operation in the Global Script - Runtime window.
Requirement
The relevant action must be opened in the edit window.
Procedure
1. Select the "Operator authorization" command in the "Edit" menu. The "Authorizations" dialog box is opened. 2. Select an authorization.
See also
GSC Runtime (Page825)
820
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
2.13.10
Introduction
Use export and import to move actions between projects. The triggers linked to the actions are retained in the process.
Requirement
The action to be exported must be opened in the edit window.
Procedure
1. Click the button in the editing toolbar. The "Save As" dialog is opened. 2. Select the path and file name for the action that you wish to export.
Alternative operation
Alternatively, you can start the export as follows: In the "Edit" menu, select "Export", select "Export" in the shortcut menu of the edit window, or use the corresponding key combination.
2.13.11
Introduction
Use export and import to move actions between projects. The triggers linked to the actions are retained in the process.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
821
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
The action in the active edit window is replaced by the imported action.
Procedure
1. Click the button in the editing toolbar. The "Open" dialog is opened. 2. Select the path and file name of the action that you wish to import.
Alternative operation
Alternatively, you can start the import as follows: In the "Edit" menu, select "Import", select "Import" in the shortcut menu of the edit window, or use the corresponding key combination.
2.13.12
Introduction
You may rename an action at any time. The action is thereby assigned a different file name.
Requirement
The action to be renamed may not be open in the edit window.
822
ANSI-C for Creating Functions and Actions 2.13 Creating and Editing Actions
Procedure
1. Open the shortcut menu of the action to be renamed. 2. Select "Rename". 3. Enter a new name with the file extension ".pas".
Alternative operation
Alternatively, click the action name twice to complete the renaming. Note If you do not enter the file extension ".pas", the action name remains unchanged.
2.13.13
Introduction
You have two options for using actions from other sources in your project: Importing exported actions Copy the file with the desired action into the corresponding path in your project. The path for local actions is "<Computer_name>\Pas" in the project path. The path for global actions is "\Pas" in the project path. To show the copied actions in the navigation window, you must refresh the display. This can be accomplished by quitting and then restarting Global Script. If Runtime is active, imported actions are only executed, after they have been opened in Global Script Editor and then saved.
823
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
Note Actions can include calls to project and standard functions. These can in turn have calls to project and standard functions etc. Therefore, when importing actions from other sources, you must make sure that the current project has all necessary functions. Particular attention is called for whenever the actions were imported from a different computer. Since standard functions can be customized by the user, it is possible that the standard functions called in the action have a different functionality on the source computer than the ones with the same names on the target computer.
See also
How to Import an Action (Page821) How to Export an Action (Page821)
2.14
2.14.1
See also
GSC Diagnose (Page830) GSC Runtime (Page825)
824
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
2.14.2
2.14.2.1
GSC Runtime
GSC Runtime
Statuses of actions
Possible statuses of actions: Action was started. Action was ended. Action was stopped. Action is running.
825
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
Error during start of action! Error during execution of action!
Error messages
Possible error messages: No error occurred. The application is already connected to the script control. No additional connection setup is possible. There is no connection to the script control. Possibly no connection setup took place. An error occurred during interprocess communication. The cause of the error is unknown. Undefined error. The parameter assignment is wrong. Some necessary parameters may be missing. Script control is not started. Check has whether WinCC has been started. Time-out occurred. Check the connection or increase the monitoring time. Script control was terminated. The service channel could not be installed. An unknown job number was used for the EndAct job. The action could not be executed without error. The returned results are invalid. An error occurred in the server application. The maximum number of connections to the script control has been reached. The transaction is unknown. An attempt was made to terminate a transaction that was not logged on previously. A pre-compiled header file cannot be generated from a pre-compiled header file. There is no access to the action. The module is being used presently. The program is invalid. The action is invalid. The script control could not set up the file. The script interpreter does not have enough memory. The file format is invalid for the script control. The script control could not open the file. The program is presently locked by the script control. No further access is possible. The action has already been given to the script control for processing. In this action, a conflict has occurred with another action. The script control could not find the action. The script control could not find the function. The specified line information is invalid.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
826
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
The specified symbol is outside the valid range. The provided memory is too small for the script interpreter. The script interpreter does not recognize the specified type. The specified symbol was not found. Load project functions. A stack overflow has occurred in the script interpreter during execution. Further execution of the action is being canceled. Division by 0 occurred during execution of an action. The action is being canceled. Within the action, a reference was made during execution to a symbol that does not exist. Within the action, an attempt was made during execution to access an undefined memory area. The script interpreter ran into a breakpoint. The script interpreter was advanced in the debugger by one processing step. The action contains no interpreter code. The action has the wrong data format. The return value of the action cannot be represented as a variant. There is insufficient memory to execute this operation. An error has occurred within the transaction. For more information, see the AP_ACT_KEYs. An error occurred while executing the action. For more information, see the AP_ACT_KEYs. An error occurred while executing the action. For more information, see the AP_ACT_KEYs. There is no update capability for the existing data format. The action cannot be read.
827
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
You can determine for each action individually, whether or not the popup menu can be opened without a password. To use GSC Runtime, you must first add an application window of the GSC Runtime type in a process picture. Using the GSC Runtime attributes, you can determine the appearance of the GSC Runtime window. Note Updating the GSC Runtime window increases the load on the system resources. The system load depends on how many actions are visible in the window. The system load can be lowered by reducing the height of the window so that fewer lines are visible.
See also
How to Edit Actions (Page829) Attributes of GSC Runtime (Page829) How to Place GSC Runtime in a Process Picture (Page828) How to Assign Authorizations (Page820)
2.14.2.2
Introduction
To use GSC Runtime, you must add GSC Runtime to a process picture. This process picture can be an existing picture or a picture that just serves diagnostic purposes. GSC Runtime cannot be added to the process picture directly, rather it must be added as an application in an application window. The application window is itself part of the process picture. The measures described must be performed in Graphics Designer.
Requirement
Graphics Designer has been started and the process picture is open.
Procedure
1. In the Object palette, select "Smart Object\Application Window". 2. In the drawing area, open the application window. 3. In the "Window Contents" dialog select "Global Script". 4. Confirm the entries by clicking "OK". 5. In the "Template" dialog, select "GSC Runtime". 6. Click "OK" to confirm your selection.
828
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
See also
Attributes of GSC Runtime (Page829)
2.14.2.3
2.14.2.4
Introduction
Each of the actions in your project will be displayed on its own line in the GSC Runtime window. You can open an action in the GSC Runtime window and then edit it using Global Script Editor. After the edited action is saved, it is used in Runtime.
Procedure
1. Open the shortcut menu for the desired action. 2. Select "Edit".
See also
How To Create and Edit Actions (Page802)
829
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
2.14.3
2.14.3.1
GSC Diagnose
GSC Diagnose
Description of Functions
GSC Diagnose outputs the printf instructions (contained in the actions) in the order in which they are called in the Diagnose window. This also applies to the printf instructions in functions that are called in actions. Through a well thought out use of printf instructions, for example to output the values of tags, it is possible to follow the action's flow and that of the called functions. Even error conditions, which result in a call to the OnErrorExecute function, are displayed in the GSC Diagnose window.
Figure 2-2
To use GSC Diagnose, you must first add an application window of the GSC Diagnose type in a process picture. Using the GSC Diagnose attributes, you can determine the appearance of the GSC Diagnose window. When the picture is changed, the contents in the GSC Diagnose window is deleted. Note A printf() may contain maximum 360 characters.
830
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
See also
The Toolbar of GSC Diagnose (Page832) Attributes of GSC Runtime (Page829) How to Place GSC Diagnose in a Process Picture? (Page831)
2.14.3.2
Introduction
To use GSC Diagnose, you must add GSC Diagnose to a process picture. This process picture can be an existing picture or a picture that just serves diagnostic purposes. GSC Diagnose cannot be added as an application to the process picture directly, rather it must be added as an application in an application window. The application window is itself part of the process picture. The measures described must be performed in Graphics Designer.
Requirement
Graphics Designer has been started and the process picture is open.
Procedure
1. In the Object palette, select "Smart Object\Application Window". 2. In the drawing area, open the application window. 3. In the "Window Contents" dialog select "Global Script". 4. Confirm the entries by clicking "OK". 5. In the "Template" dialog, select "GSC Diagnose". 6. Click "OK" to confirm your selection.
See also
Attributes of GSC Runtime (Page829) The Toolbar of GSC Diagnose (Page832)
831
ANSI-C for Creating Functions and Actions 2.14 Runtime Behavior of Actions
2.14.3.3
2.14.3.4
Toolbar Functions
The toolbar of GSC Diagnose includes buttons for the control the output in the Diagnose window as well as for saving, printing and opening the contents of the window.
832
ANSI-C for Creating Functions and Actions 2.15 ANSI-C function descriptions
2.15
833
"lpszPictureName"
"lpszPictureName" is the name of the picture. If you configure an action on a property or a "Mouse-click" event in WinCC, the name of the picture is provided as "lpszPictureName" in the action. The picture name has the following structure: <BASE PICTURE NAME>.<PICTURE WINDOW NAME>:<PICTURE NAME>. ... .<Picture window name>:<Picture name>. The "BASE PICTURE NAME" and the "PICTURE NAME" are provided without the file extension ".PDL". This enables you to identify the object's picture path. You can also address specific picture windows, if a process picture is opened more than once for example. Note You must not change the text in "lpszPictureName". This would be possible using the "strcat()" function for example.
3.2
3.2.1
Standard functions
Standard functions - short description
The system provides standard functions. You can modify these functions to adapt them to your personal needs. Furthermore, you can create your own standard functions. The basic system provides you with standard functions. They are divided into the following function groups: Alarm Graphics Report
835
3.2.2
3.2.2.1 Function
Alarm
AcknowledgeMessage
Acknowledges the message with the number that has been sent as a parameter in the message system.
Syntax
void AcknowledgeMessage(DWORD MsgNr)
Parameters MsgNo
Message to be acknowledged Note Make sure a configured message exists for the transferred message number. To use the function on a client with its own project, a standard server for alarms has to be configured on the client. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
836
See also
AcknowledgeMessage example (Page1471)
3.2.2.2 Function
AXC_SetFilter
External message window operation This function sets a filter for WinCC Alarm Control to show a portion of the existing messages according to the filter criterion.
Syntax
BOOL AXC_SetFilter(char* lpszPictureName, char* lpszObjectName, LPMSG_FILTER_STRUCT lpMsgFilter, LPCMN_ERROR, lpError)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the WinCC Alarm Control name
lpMsgFilter
Pointer to the structure containing the filter criterion
lpError
Pointer to the structure of the error description
FALSE
An error has occurred.
837
See also
Structure definition CMN_ERROR (Page1546) Structure definition MSG_FILTER_STRUCT (Page1552) ResetFilter example (Page1510) AXC_SetFilter example (Page1473)
3.2.2.3 Function
GCreateMyOperationMsg
The "GCreateMyOperationMsg" standard function makes it possible to trigger your own operator input message in the message system. The message with the "dwMsgNum" message number must have already been configured as the operator input message.
Syntax
int GCreateMyOperationMsg( DWORD dwFlags, DWORD dwMsgNum, char* lpszPictureName, char* lpszObjectName, DWORD dwMyTextID, double doValueOld, double doValueNew, char* pszComment)
Parameters dwFlags
The message form can be selected using the "dwFlags" parameter.
Name FLAG_COMMENT_PARAMETER Value 0x00000001 Description The text is entered as a comment directly into the message in Runtime, without its own comment dialog. The pointer to the comment must not equal "NULL." A comment dialog appears. The comment entered there is transferred to the message. The text ID of a text from the TextLibrary is provided as the accompanying process value of the message.
FLAG_COMMENT_DIALOG FLAG_TEXTID_PARAMETER
0x00000003 0x00000100
838
dwMsgNum
WinCC message number of a self-created operator input message.
lpszPictureName
Pointer to the picture name of the picture from which the function is called.
lpszObjectName
Pointer to the WinCC tag name to which the old values and new values belong. The name is forwarded as the instance name of the operator input message and entered in the accompanying process value "1".
dwMyTextID
Text ID of a text from the TextLibrary. When the "FLAG_TEXTID_PARAMETER" is set, the text ID is provided as the numeric accompanying process value "8" of the message and is displayed as a number in process value block 8. So that the language-dependent text from the TextLibrary is displayed in the message, you must enter format statement "@8%s@" in the message text block.
doValueOld
Numeric old value of the WinCC tags with the name specified in "lpszObjectName". "doValueOld" is entered in the accompanying process value "2" of the message. The function itself has no option of reading a tag value before the action. For this, use the provided "GetTag..." feature.
doValueNew
Numeric new value of the WinCC tags with the name specified in "lpszObjectName". "doValueNew" is entered in the accompanying proces value "3" of the message. The function itself has no option of reading a tag value after the action. For this, use the provided "GetTag..." feature.
pszComment
Comment text or empty string. When "FLAG_COMMENT_PARAMETER" is set, the text is entered directly into the message in Runtime as a comment. The message does not need a separate comment dialog.
839
Return value
Value 0 -101 -201 -301 Description The function has been completed without any errors. The message editing could not be started. An error occurred when calling the "MSRTGetComment()" feature. An error occurred when calling the "MSRTCreateMsgInstanceWithComment()" feature.
3.2.2.4 Function
GMsgFunction
This function provides the message data. It is a global function for single messages. It is called for each message for which the "Triggers an action" parameter has been set. Evaluation of the message data is best made in a project function called from GMsgFunction.
Syntax
BOOL GMsgFunction(char* pszMsgData)
Parameters pszMsgData
Pointer to a string whose data are mapped with scanf to the MSG_RTDATA_STRUCT structure. The "MSG_RTDATA_STRUCT" string contains the following data, which are separated from each other with "#": 1. Telegram time 2. Process values 3. Instance 4. User
840
FALSE
An error has occurred. Note Please note that modified standard functions are overwritten by a WinCC installation so that the changes will be lost.
See also
Structure definition MSG_RTDATA_STRUCT (Page1556)
3.2.3
3.2.3.1
Graphics
Graphics - short description
The Graphics group contains functions for programming the graphic system. Note Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well.
841
3.2.3.2 Function
GetLinkedVariable
Syntax
char* GetLinkedVariable(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName);
Parameters lpszPictureName
Pointer to the picture
lpszObjectName
Pointer to the object
lpszPropertyName
Pointer to the object property
Return value
Pointer to the name of the tag linked to a certain object property.
See also
GetLinkedVariable example (Page1483)
3.2.3.3 Function
GetLocalPicture
Provides a pointer to the name of the picture. The picture name is the file name without the ".PDL" extension.
Syntax
char* GetLocalPicture(char* lpszPictureName);
842
Parameters lpszPictureName
Pointer to the picture
Return value
Pointer on the name of the picture. Note The passed call parameter lpszPictureName must have the structure provided by the graphics system for the picture paths: <Basic picture name>.<Picture window name>:<Picture name>. ... .<Picture window name>[:<Picture name>] where <Basic picture name> and <Picture name> go without the ".PDL" file extension.
Example:
In a basic picture "AAA" there is a picture window "bbb" in which a picture "CCC" is called which itself contains a picture window "ddd" in which a picture "EEE" is called. Then the function call GetLocalPicture(lpszPictureName) returns the pointer to the picture name: "EEE" if the functions is called in the picture "EEE"; "CCC" if the functions is called in the picture "CCC"; "AAA" if the functions is called in the picture "AAA".
See also
GetLocalPicture example (Page1483)
3.2.3.4 Function
GetParentPicture
Provides a pointer to the name of the picture. The picture name is the file name without the ".PDL" extension.
843
Syntax
char* GetParentPicture(char* lpszPictureName);
Parameters lpszPictureName
Pointer to the picture
Return value
Name of the current picture if the function is called in the basic picture Name path of the higher-level picture if the function is called in a picture window Note The passed call parameter lpszPictureName must have the structure provided by the graphics system for the picture paths: <Basic picture name>.<Picture window name>:<Picture name>. ... .<Picture window name>[:<Picture name>] where <Basic picture name> and <Picture name> go without the ".PDL" file extension.
See also
GetParentPicture example (Page1485)
3.2.3.5 Function
GetParentPictureWindow
Syntax
char* GetParentPictureWindow(char* lpszPictureName);
Parameters lpszPictureName
Pointer to the picture
844
Return value
Pointer to the name of the picture window if the function is called in a picture displayed in a picture window of a higher-level picture Call parameter lpszPictureName unchanged if the function is called in the basic picture Note The passed call parameter lpszPictureName must have the structure provided by the graphics system for the picture paths: <Basic picture name>.<Picture window name>:<Picture name>. ... .<Picture window name>[:<Picture name>] where <Basic picture name> and <Picture name> go without the ".PDL" file extension.
Example:
In a basic picture "Picture_1" there is a picture window "Picture_window_1" in which a picture "Picture_2" is called. In the picture "Picture_2" there is a picture window "Picture_window_2" in which a picture "Picture_3" is called. Then the function call GetParentPictureWindow(lpszPictureName) returns the pointer to the picture window name: "Picture_2" if the function is called in the picture "Picture_3"; "Picture_window_1" if the function is called in the picture "Picture_2"; "Picture_1" if the function is called in the picture "Picture_1".
3.2.3.6 Function
OpenPicture
Changes the specified basic picture. On the client and in case of a picture name with server prefix a picture change is performed in the picture window.
Syntax
void OpenPicture(Picture PictureName)
845
3.2.3.7 Function
Registry2
This function manages a list of string pairs (String0, String1). It knows the following types of calls controlled by the mode parameter: Registry2("set", "String0", "String1"); Includes the passed string pair into the list. Registry2("get", "String0", NULL); Returns the first string pair partner String1 which belongs to the passed String0 and then deletes the string pair from the list. Registry2("reset", NULL, NULL); Deletes all string pairs from the list. Registry2("display", NULL, NULL); Shows the string pairs currently stored in the list in a Global Script diagnostics window.
Syntax
char* Registry2(char* mode, char* String0, char* String1);
Parameters mode
Defines the working principle of the function. set get Incorporation of the string pair into the list Determination of the first sting pair partner for String0 and deletion of the string pair from the list reset Deletion of all string pairs display Display of the string pairs in a Global Script diagnostics window
String0
The parameter supply depends on the working principle of the function.
846
String1
The parameter supply depends on the working principle of the function.
Return value
In the mode=get mode a pointer to the first string pair partner is returned. Note This function is used in conjunction with the picture module technology. If you work with the "Create faceplate as type" and "Create instance(s) in the process picture" wizards in the "Faceplates" tab of the Dynamic Wizard, using the "Registry2" function is not permitted!
3.2.4
3.2.4.1
Report
Report - short description
The Report group contains functions with which to start the print preview of a print job or the printout itself. Note Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well.
3.2.4.2 Function
RPTJobPreview
Syntax
BOOL RPTJobPreview(LPSTR lpJobName)
847
Parameters lpJobName
Pointer to the name of the print job
FALSE
An error has occurred.
See also
RPTJobPreview example (Page1511)
3.2.4.3 Function
RPTJobPrint
Syntax
BOOL RPTJobPrint(LPSTR lpJobName)
Parameters lpJobName
Pointer to the name of the print job
848
FALSE
An error has occurred.
See also
RPTJobPrint example (Page1511)
3.2.4.4 Function
RptShowError
This function provides an error decription for a failed print job. The function is already integrated into the RptJobPrint and RptJobPreview standard functions and does not have to be called separately. The error description is displayed in a Global Script diagnostics window. Note As RptShowError is a standard function the output type and form can be changed if required. Please note that modified standard functions are overwritten by a WinCC installation so that the changes will be lost.
Syntax
void RptShowError ( LPCSTR pszFailedFunction, CMN_ERRORA* pCmnErrorA )
Parameters pszFailedFunction
Pointer to the name of the failed function. If this pointer is NULL there will be no output of the function name.
pCmnErrorA
Pointer to the error structure of the failed function. If this pointer is NULL there will be no output of the error structure. STRUCTURES_TABLES_ERROR_STRUCTURE
849
3.2.5
3.2.5.1
WinCC
WinCC - short description
The WinCC group contains functions which affect the entire WinCC system. Note Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well.
3.2.5.2 Function
GetHWDiag
This function realizes the direct start of diagnosis at runtime triggered by an event, which must be configured, exercised on an object. If the event occurs, the hardware diagnostics function is started from STEP7 for the associated PLC. The following conditions must be fulfilled in order to use the function: The WinCC project, with the picture from which access should occur, and the STEP7 project must be on the same computer. The WinCC project must be stored as a subdirectory of the STEP7 project (STEP7 Projekt \wincproj\WinCC Projekt). The S7 tags have been mapped to WinCC.
Syntax
BOOL GetHWDiag(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpProperties)
Parameters lpszPictureName
Name of the picture (PDL file) that contains the tag that will be used for the entry point for the hardware diagnostics Since the name "lpszPictureName" stands for the current picture, entries are only required here in cases where it is necessary to access an object tag in a different picture.
850
lpszObjectName
Name of the object in the picture that connected with the tag that will be used for the entry point for the hardware diagnostics Since the name "lpszObjectName" stands for the current object entries are only required here in cases where it is necessary to access a tag in a different object.
lpProperties
Name of the attribute that is connected with the tag that will be used for the entry point for the hardware diagnostics If multiple attribute are entered, they must be separated by semicolons (";").
FALSE
An error has occurred.
3.2.5.3 Function
GetHWDiagLevel
Checks the logged-in user's authorization on the basis of the User Administrator function number in dwLevel. Then, diagnostics is started directly during runtime and is triggered by an event, which has to be configured, occurring on an object. If the event occurs, the hardware diagnostics function is started from STEP7 for the associated PLC. The following conditions must be fulfilled in order to use the function: The WinCC project, with the picture from which access should occur, and the STEP7 project must be on the same computer. The WinCC project must be stored as a subdirectory of the STEP7 project (STEP7 Projekt \wincproj\WinCC Projekt). The S7 tags have been mapped to WinCC. In order for the user logged into WinCC to edit the hardware diagnostics dialog, the user must have a WinCC user authorization matching the number passed by the function call in the parameter "dwLevel".
851
Syntax
BOOL GetHWDiagLevel(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpProperties, DWORD dwLevel)
Parameters lpszPictureName
Name of the picture (PDL file) that contains the tag that will be used for the entry point for the hardware diagnostics Since the name "lpszPictureName" stands for the current picture, entries are only required here in cases where it is necessary to access an object tag in a different picture.
lpszObjectName
Name of the object in the picture that connected with the tag that will be used for the entry point for the hardware diagnostics Since the name "lpszObjectName" stands for the current object entries are only required here in cases where it is necessary to access a tag in a different object.
lpProperties
Name of the attribute that is connected with the tag that will be used for the entry point for the hardware diagnostics If multiple attribute are entered, they must be separated by semicolons (";").
dwLevel
Level number for STEP7 write permissions. This can be defined in User Administrator.
FALSE
An error has occurred.
852
3.2.5.4 Function
GetKopFupAwl
This function performs the network entry jump of WinCC into the STEP7 Editor "KFA". When executing this function two tasks are performed: Determination of the required date for the network entry jump from WinCC. Transfer of the data to Step7 and finding the places of use of the operand in a STEP7 program by means of AUTAPI.
Syntax
BOOL GetKopFupAwl(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpProperties)
Parameters lpszPictureName
Name of the picture (PDL file) that contains the tag that will be used for the network entry jump Since the name "lpszPictureName" stands for the current picture, entries are only required here in cases where it is necessary to access an object tag in a different picture.
lpszObjectName
Name of the object in the picture that connected with the tag that will be used for the network entry jump Since the name "lpszObjectName" stands for the current object entries are only required here in cases where it is necessary to access a tag in a different object.
lpProperties
Name of the attrribute that is connected with the tag that will be used for the network entry jump If multiple attribute are entered, they must be separated by semicolons (";").
853
FALSE
An error has occurred.
3.2.5.5 Function
GetKopFupAwlLevel
Checks the active user's authorization on the basis of the User Administrator function number in dwLevel and then performs the entry jump into the STEP7 Editor "KFA". When executing this function three tasks are performed: Determination of the required date for the network entry jump from WinCC. Authorization check for the active user within WinCC. Transfer of the data to STEP7 and finding the places of use of the operand in a STEP7 program by means of AUTAPI. Note Depending on the result of the authorization check in WinCC the user has either only reading rights in STEP7 or is authorized to change S7 data.
Syntax
BOOL GetKopFupAwlLevel(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName,LPCTSTR lpProperties, DWORD dwLevel)
Parameters lpszPictureName
Name of the picture (PDL file) that contains the tag that will be used for the network entry jump Since the name "lpszPictureName" stands for the current picture, entries are only required here in cases where it is necessary to access an object tag in a different picture.
lpszObjectName
Name of the object in the picture that connected with the tag that will be used for the network entry jump Since the name "lpszObjectName" stands for the current object entries are only required here in cases where it is necessary to access a tag in a different object.
lpProperties
Name of the attrribute that is connected with the tag that will be used for the network entry jump
854
dwLevel
Level number for STEP7 write permissions. This can be defined in User Administrator.
FALSE
An error has occurred.
3.2.5.6 Function
OnDeactivateExecute
This function is called when terminating WinCC Runtime. As this is a standard function, you can insert instructions which are then executed. Note Concerning the instructions it must be taken into account that the Runtime is terminating and therefore not all functionalities are available. Please note that modified standard functions are overwritten by a WinCC installation so that the changes will be lost.
Syntax
void OnDeactivateExecute()
3.2.5.7 Function
OnErrorExecute
OnErrorExecute is called by the system when an error occurred upon executing an action or a function. This allows you to determine the precise error cause.
855
Syntax
void OnErrorExecute(CCAPErrorExecute ErrorExecute)
Parameters ErrorExecute
Structure informing about the error that has occurred
Diagnostic information
These information are displayed in a Global Script diagnostics window. SystemTime dwErrorCode1 dwErrorCode2 szErrorText bCycle szApplicationName szFunctionName szTagName dwCycle szErrorTextTagName status lpszPictureName lpszObjectName lpszPropertyName dwParamSize szErrorText Time (UTC) at which the error occurred The error codes and their meaning are to be found in the structure definition The error codes and their meaning are to be found in the structure definition Text description of the error cause Cycle type Error-triggering application FunctionID Tag name Cycle type Text description of the tag status Tag status Picture in which the error occurred Object in which the error occurred Object property in which the error occurred only used internally Text description of the error cause returned by the error structure "pError"
856
See also
Structure definition CCAPErrorExecute (Page1544)
3.2.5.8 Function
OnTime
OnTime is exclusively called by the system. The function returns the runtime of all actions or determines the actions running longer than the specified time. Time measurement can be enabled/disabled via APDIAG. As this function is available as a standard function the output type can be influenced by changing the function code. Note Please note that modified standard functions are overwritten by a WinCC installation so that the changes will be lost.
Syntax
void OnTime(CCAPTime time)
Parameters time
Result structure STRUCTURES_TABLES_CCAPTIME
3.2.6
3.2.6.1
Windows
Windows - short description
The Windows group contains the ProgramExecute function. This function can be used to execute any program. Note Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well.
857
3.2.6.2 Function
ProgramExecute
Syntax
unsigned int ProgramExecute(char* Program_Name)
Parameters Program_Name
Pointer to the program name
Return value
If the return value is greater than 31, the function has been completed without any errors. In case of an error, the return value contains one of the following error codes: 0 2 3 11 out of memory Specified file could not be found. Specified path could not be found. Program could not be started.
See also
ProgramExecute example (Page1510)
3.2.7
3.2.7.1
Obsolete functions
Alarm
AXC_OnBtnAlarmHidingList Function
This function displays the list of hidden messages in a message window.
858
Syntax
BOOL AXC_OnBtnAlarmHidingList(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
AXC_OnBtnArcLong Function
This function displays the messages stored in a long-term archive list in a message window.
Syntax
BOOL AXC_OnBtnArcLong (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
859
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
AXC_OnBtnArcShort Function
This function displays the messages stored in a short-term archive list in a message window.
Syntax
BOOL AXC_OnBtnArcShort(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
860
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
AXC_OnBtnComment Function
External message window operation This function displays the comment of the previously selected messages.
Syntax
BOOL AXC_OnBtnComment (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
861
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
AXC_OnBtnEmergAckn Function
External message window operation This function opens the acknowledgement dialog (emergency acknowledgement/reset).
Syntax
BOOL AXC_OnBtnEmergAckn(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
862
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
AXC_OnBtnHideDlg Function
This function opens the display options dialog for defining the messages that are to be displayed in the message window. The options are "All messages", "Shown messages" or "Hidden messages".
Syntax
BOOL AXC_OnBtnHideDlg(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
863
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
AXC_OnBtnHideUnhideMsg Function
The function hides the selected message or displays again the hidden message.
Syntax
BOOL AXC_OnBtnHideUnhideMsg(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
864
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
AXC_OnBtnHit Function
This function displays the messages stored in the hit list in a message window.
Syntax
BOOL AXC_OnBtnHit (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
865
See also
AXC_OnBtnMsgFirst example (Page1471)
AXC_OnBtnHornAckn Function
External message window operation This function acknowledges the horn signal.
Syntax
BOOL AXC_OnBtnHornAckn (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
866
AXC_OnBtnInfo Function
External message window operation This function displays the information text.
Syntax
BOOL AXC_OnBtnInfo (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
867
AXC_OnBtnLock Function
External message window operation This function opens the "Set the Lock List Parameters" dialog.
Syntax
BOOL AXC_OnBtnLock (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
868
AXC_OnBtnLockUnlock Function
This function locks the selected message in the message window. This message will then no longer be archived. This function unlocks the selected message in the lock list.
Syntax
BOOL AXC_OnBtnLockUnlock (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
869
AXC_OnBtnLockWin Function
External message window operation. This function calls the lock list.
Syntax
BOOL AXC_OnBtnLockWin (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
870
AXC_OnBtnLoop Function
External message window operation This function triggers the "LoopInAlarm" function of the selected message.
Syntax
BOOL AXC_OnBtnLoop (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
871
AXC_OnBtnMsgFirst Function
External message window operation This function switches to the beginning of the message list.
Syntax
BOOL AXC_OnBtnMsgFirst (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
872
AXC_OnBtnMsgLast Function
External message window operation This function switches to the beginning of the message list.
Syntax
BOOL AXC_OnBtnMsgLast (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
Beispiel AXC_OnBtnMsgLast (Page1472)
873
AXC_OnBtnMsgNext Function
External message window operation This function switches to the next message in the message list.
Syntax
BOOL AXC_OnBtnMsgNext (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
874
AXC_OnBtnMsgPrev Function
External message window operation This function switches to the previous message in the message list.
Syntax
BOOL AXC_OnBtnMsgPrev (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
875
AXC_OnBtnMsgWin Function
External message window operation This function calls the message list. Note The message list contains the currently pending and unacknowledged messages.
Syntax
BOOL AXC_OnBtnMsgWin (char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
876
AXC_OnBtnPrint Function
External message window operation All messages fulfilling the selection criterion set in the Alarm Control are output to the printer.
Syntax
BOOL AXC_OnBtnPrint(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
877
AXC_OnBtnProtocol Function
External message window operation Printing of the current view of the Alarm Control is started. All messages fulfilling the selection criterion set in the Alarm Control are output to the printer.
Syntax
BOOL AXC_OnBtnProtocol(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
AXC_OnBtnScroll Function
External message window operation This function activates the horizontal and vertical scroll functions.
878
Syntax
BOOL AXC_OnBtnScroll(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnScroll example (Page1472)
AXC_OnBtnSelect Function
External message window operation This function opens the "Specify Selection" dialog for the displayed list.
Syntax
BOOL AXC_OnBtnSelect(char* lpszPictureName, char* lpszObjectName)
879
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
AXC_OnBtnSinglAckn Function
External message window operation This function acknowledges the currently selected message.
Syntax
BOOL AXC_OnBtnSinglAckn(char* lpszPictureName, char* lpszObjectName)
880
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnSinglAckn example (Page1472)
AXC_OnBtnSortDlg Function
External operation of the message window This function opens the dialog for setting a user-defined sorting of the displayed messages for the displayed list.
Syntax
BOOL AXC_OnBtnSortDlg(char* lpszPictureName, char* lpszObjectName)
881
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
AXC_OnBtnTimeBase Function
External operation of the message window This function opens the dialog for setting the time base for the times shown in the messages.
Syntax
BOOL AXC_OnBtnTimeBase(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
882
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
AXC_OnBtnVisibleAckn Function
External message window operation All visible messages in the message window are acknowledged (group acknowledgement).
Syntax
BOOL AXC_OnBtnVisibleAckn(char* lpszPictureName, char* lpszObjectName)
Parameters lpszPictureName
Pointer to the name of the picture in which the WinCC Alarm Control is located
lpszObjectName
Pointer to the object name of the WinCC Alarm Control
883
FALSE
An error has occurred. Note The standard function is no longer supported for the new WinCC AlarmControl as of WinCC V7.0.
See also
AXC_OnBtnMsgFirst example (Page1471)
Report
Depending on the value of the lpMethod Name parameter a print job or the preview for a print job is started.
Syntax
void ReportJob(LPSTR lpJobName, LPSTR lpMethodName)
Parameters lpJobName
Pointer to the name of the print job
884
lpMethodName
PRINTJO Print job is started B PREVIE Preview of the print job is started W
Note This function is replaced by the RPTJobPreview and RPTJobPrint functions and should no longer be used.
3.2.7.3
TagLog
Syntax
BOOL TlgTableWindowPressEditRecordButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
885
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
TlgTableWindowPressFirstButton Function
Displays the first data records of the display area in the table window. The number of displayed data records depends on the configured time range.
Syntax
BOOL TlgTableWindowPressFirstButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
886
TlgTableWindowPressHelpButton Function
Displays the online help for the table window.
Syntax
BOOL TlgTableWindowPressHelpButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTableWindowPressInsertRecordButton Syntax
BOOL TlgTableWindowPressInsertRecordButton(char* lpszWindowName)
887
TlgTableWindowPressLastButton Function
Displays the last data records of the display area in the table window. The number of displayed data records depends on the configured time range.
Syntax
BOOL TlgTableWindowPressLastButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
888
TlgTableWindowPressNextButton Function
The data records following the current display area are displayed in the table window. The number of displayed data records depends on the configured time range.
Syntax
BOOL TlgTableWindowPressNextButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTableWindowPressNextItemButton Function
The columns of the table window are moved one column to the left, the left column taking the position of the right column.
889
Syntax
BOOL TlgTableWindowPressNextItemButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTableWindowPressOpenArchiveVariableSelectionDlgButton Function
Opens the dialog for connecting table columns to archives and tags.
Syntax
BOOL TlgTableWindowPressOpenArchiveVariableSelectionDlgButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
890
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTableWindowPressOpenDlgButton Function
Opens the dialog for online configuration of the table window.
Syntax
BOOL TlgTableWindowPressOpenDlgButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
891
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressOpenDlgButton example (Page1534)
TlgTableWindowPressOpenItemSelectDlgButton Function
Opens the dialog for selecting the visible columns and the first column of the table window.
Syntax
BOOL TlgTableWindowPressOpenItemSelectDlgButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
892
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTableWindowPressOpenTimeSelectDlgButton Function
Opens the dialog for setting the time range to be displayed in the table columns.
Syntax
BOOL TlgTableWindowPressOpenTimeSelectDlgButton(char* lpszWindowNumber)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTableWindowPressPrevButton Function
The data records preceding the current display area are displayed in the table window. The number of displayed data records depends on the configured time range.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
893
Syntax
BOOL TlgTableWindowPressPrevButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTableWindowPressPrevItemButton Function
The columns of the table window are moved one column to the right, the right column taking the position of the left column.
Syntax
BOOL TlgTableWindowPressPrevItemButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
894
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTableWindowPressStartStopButton Function
Updating of the table window is switched on or off (toggle function).
Syntax
BOOL TlgTableWindowPressStartStopButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Table Control
FALSE
An error has occurred.
895
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressFirstButton Function
Displays the first data records of the display area in the trend window. The number of displayed data records depends on the configured time range.
Syntax
BOOL TlgTrendWindowPressFirstButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
896
TlgTrendWindowPressHelpButton Function
Displays the online help for the trend window.
Syntax
BOOL TlgTableWindowPressNextButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressLastButton Function
Displays the last data records of the display area in the trend window. The number of displayed data records depends on the configured time range.
Syntax
BOOL TlgTrendWindowPressLastButton(char* lpszWindowName)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
897
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressLinealButton Function
The ruler of the trend window is shown or hidden (toggle function). The ruler can be moved by means of the "cursor left" and "cursor right" buttons.
Syntax
BOOL TlgTableWindowPressNextButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
898
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressNextButton Function
The data records following the current display area are displayed in the trend window. The number of displayed data records depends on the configured time range.
Syntax
BOOL TlgTrendWindowPressNextButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
899
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressNextItemButton Function
Brings all trends in the trend window one layer to the front. The trend in the foreground is moved into the background.
Syntax
BOOL TlgTrendWindowPressNextItemButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
900
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressOneToOneButton Function
Restores the standard size (1:1) in the trend window.
Syntax
BOOL TlgTrendWindowPressOneToOneButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressOpenArchiveVariableSelectionDlgButton Function
Opens the dialog for connecting trends to archives and tags.
901
Syntax
BOOL TlgTrendWindowPressOpenArchiveVariableSelectionDlgButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressOpenDlgButton Function
Opens the dialog for online configuration of the trend window.
Syntax
BOOL TlgTrendWindowPressOpenDlgButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
902
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressOpenItemSelectDlgButton Function
Opens the dialog for selecting the visible trends and the trend which is to be in the foreground.
Syntax
BOOL TlgTrendWindowPressOpenItemSelectDlgButton(char* lpszWindowNumber)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred.
903
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressOpenTimeSelectDlgButton Function
Opens the dialog for setting the time range to be displayed.
Syntax
BOOL TlgTrendWindowPressOpenTimeSelectDlgButton(char* lpszWindowNumber)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
904
TlgTrendWindowPressPrevButton Function
The data records preceding the current display area are displayed in the trend window. The number of displayed data records depends on the configured time range.
Syntax
BOOL TlgTrendWindowPressPrevButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressPrevItemButton Function
Brings all trends in the trend window one layer to the back. The trend in the background is moved to the foreground.
905
Syntax
BOOL TlgTrendWindowPressPrevItemButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressPrintButton Function
The current view of the trends is output in accordance with the display configured for the WinCC Trend Control.
Syntax
BOOL TlgTrendWindowPressPrintButton(char* lpszWindowName)
906
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
TlgTableWindowPressRemoveRecordButton Syntax
BOOL TlgTableWindowPressRemoveRecordButton(char* lpszWindowName) Note This function is no longer supported. A similar function exists in the User Archives runtime functions.
TlgTrendWindowPressReportSaveButton Function
The displayed Online Trend Control data is saved in a text file.
Syntax
BOOL TlgTrendWindowPressReportSaveButton (????)
Parameters
?????
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
907
FALSE
An error has occurred.
TlgTrendWindowPressStartStopButton Function
Updating of the trend window is switched on or off (toggle function).
Syntax
BOOL TlgTrendWindowPressStartStopButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
908
TlgTrendWindowPressStatsResultButton Function
Starts the evaluation of data in the selected time area. The statistic values minimum, maximum, average and standard deviation are calculated.
Syntax
BOOL TlgTrendWindowPressStatsResultButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressStatsSelectRangeButton Function
To select the time range for the statistics function, the rulers for start and end time are displayed.
Syntax
BOOL TlgTrendWindowPressStatsSelectRangeButton(char* lpszWindowName)
909
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressStartStopButton example (Page1534)
TlgTrendWindowPressZoomInButton Function
The zoom in the trend window is activated. The zoom range can only be selected with the mouse.
Syntax
BOOL TlgTrendWindowPressZoomInButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
910
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressZoomInButton example (Page1535)
TlgTrendWindowPressZoomOutButton Function
The trend window is restored to the state in which it was before the zoom was activated. The zoom is deactivated. The zoom range can only be selected with the mouse (also see TlgTrendWindowPressZoomInButton).
Syntax
BOOL TlgTrendWindowPressZoomOutButton(char* lpszWindowName)
Parameters lpszWindowName
Pointer to the window title of the WinCC Online Trend Control
911
FALSE
An error has occurred. Note All functions of this group have the same parameter and application.
See also
TlgTrendWindowPressZoomOutButton example (Page1535)
Syntax
int TlgGetNumberOfColumns(char* lpszTemplate)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Table Control
Return value
Number of colums in a table window
TlgGetNumberOfRows Function
Provides the number of lines in the table window. The window title of the corresponding WinCC Online Table Control is passed with the lpszTemplate parameter.
912
Syntax
int TlgGetNumberOfRows(char* lpszTemplate)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Table Control
Return value
Number of lines in the table window
See also
TlgGetNumberOfRows example (Page1532)
TlgGetNumberOfTrends Function
Provides the number of trends in the trend window. The window title of the corresponding WinCC Online Trend Control is passed with the lpszTemplate parameter.
Syntax
int TlgGetNumberOfTrends(char* lpszTemplate)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Trend Control
Return value
Number of trends in the trend window
913
TlgGetRowPosition Function
Provides the current position of the line pointer in the table window. The window title of the corresponding WinCC Online Table Control is passed with the lpszTemplate parameter.
Syntax
int TlgGetRowPosition(char* lpszTemplate)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Table Control
Return value
Current position of the line pointer in the table window
TlgGetRulerArchivNameTrend Function
Provides the archive name of the trend with the nTrend number in the trend window at the ruler position. The window title of the corresponding WinCC Online Trend Control is passed with the lpszTemplate parameter.
Syntax
char* TlgGetRulerArchivNameTrend(char* lpszTemplate, int nTrend)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Trend Control
nTrend
Number of the trend
914
Return value
Archive name of the trend with the nTrend number in the trend window at the ruler position
See also
TlgGetRulerVariableNameTrend example (Page1533)
TlgGetRulerTimeTrend Function
Provides the time of the trend with the nTrend number in the trend window at the ruler position. The window title of the corresponding WinCC Online Trend Control is passed with the lpszTemplate parameter.
Syntax
SYSTEMTIME TlgGetRulerTimeTrend(char* lpszTemplate, int nTrend)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Trend Control
nTrend
Number of the trend (0 <= nTrend <= Number of visible trends - 1)
Return value
Time of the trend with the nTrend number in the trend window at the ruler position
See also
TlgGetRulerTimeTrend example (Page1532)
915
TlgGetRulerValueTrend Function
Provides the value of the trend with the nTrend number in the trend window at the ruler position. The window title of the corresponding WinCC Online Trend Control is passed with the lpszTemplate parameter.
Syntax
double TlgGetRulerValueTrend(char* lpszTemplate, int nTrend)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Trend Control
nTrend
Number of the trend (0 <= nTrend <= Number of visible trends - 1)
Return value
Value of the trend with the nTrend number in the trend window at the ruler position
TlgGetRulerVariableNameTrend Function
Provides the tag name of the trend with the nTrend number in the trend window. The window title of the corresponding WinCC Online Trend Control is passed with the lpszTemplate parameter.
Syntax
char* TlgGetRulerVariableNameTrend(char* lpszTemplate, int nTrend)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Trend Control
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
916
nTrend
Number of the trend (0 <= nTrend <= Number of visible trends - 1)
Return value
The tag name of the trend with the nTrend number in the trend window.
See also
TlgGetRulerVariableNameTrend example (Page1533)
TlgGetTextAtPos Function
Provides the content of a cell of the table window as text for process value archives and user archives. The cell is specified by nColumn and nLine. The window title of the corresponding WinCC Online Table Control is passed with the lpszTemplate parameter.
Syntax
char* TlgGetTextAtPos(char* lpszTemplate, int nColumn, int nLine)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Table Control
nColumn
Number of the column
nLine
Number of the line
Return value
Content of the cell of a table window as text
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
917
See also
TlgGetRulerVariableNameTrend example (Page1533)
TlgGetColumnPosition Function
Provides the current position of the column pointer in the table window as column index.
Syntax
int TlgGetColumnPosition(char* lpszTemplate)
Parameters lpszTemplate
Pointer to the window title of the WinCC Online Table Control
Return value
Current position of the column pointer in a table window
See also
TlgGetNumberOfColumns example (Page1531)
TlgTrendWindowActivateCurve Function
Activates a certain trend in WinCC Online Trend Control via the configured name of the trend. This function is executed independently of the visibility or foreground position of the trend.
Syntax
BOOL TlgTrendWindowActivateCurve(char* lpszPictureName, char* lpszObjectName, char* szValue)
Parameters lpszPictureName
Picture name
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
918
lpszObjectName
Name of Trend Control
szValue
Name of the curve
FALSE
An error has occurred.
3.3
3.3.1
Internal functions
Internal functions - short description
Internal functions are used to make graphic objects and archives dynamic and in project functions, standard functions and global script actions. Internal funtions are recognized throughout a project. They can be neither be newly created nor can existing internal functions be modified. Internal functions are divided into the following groups:
allocate
Functions to reserve and release working memory space
c_bib
Functions from the standard C-library
graphics
Functions to read and set properties of graphical objects
tag
Functions to read and write tags
919
wincc
Functions for changing languages, deactivating Runtime and ending WinCC
3.3.2
3.3.2.1 Function
allocate
SysFree
Releases the memory area previously reserved with the SysMalloc function.
Syntax
void SysFree(void* lpFree);
Parameters lpFree
Pointer to the memory area reserved with the SysMalloc function
3.3.2.2 Function
SysMalloc
Reserves memory space for an action. The memory area is assigned to the action. When the action has been completed and the result transferred, the system releases the memory again. The SysFree function can be used to release reserved memory space.
Syntax
void* SysMalloc(unsigned long int size);
Parameters size
Size of the memory area in bytes.
920
3.3.3
3.3.3.1
c_bib
c_bib - short description
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
3.3.3.2 isahum
ctype
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio
921
isalpha
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output
922
isdigit
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
923
isgraph
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
islower
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
924
isprint
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
925
ispunct
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
isspace
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
926
isupper
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
927
isxdigit
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
928
tolower
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
toupper
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
929
3.3.3.3 acos
math
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
930
asin
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
atan
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
931
atan2
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
932
ceil
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
933
cos
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
cosh
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
934
exp
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
935
fabs
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
floor
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
936
fmod
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
937
frexp
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
938
ldexp
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
log
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
939
log10
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
940
modf
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
pow
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
941
sin
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
942
sinh
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
943
sqrt
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
tan
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
944
tanh
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
945
3.3.3.4 memchr
memory
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
946
memcmp
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
memcpy
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
947
memmove
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
948
memset
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
949
stdio
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
fgets
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
950
fputc
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
951
fputs
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
getc
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
952
putc
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
953
ungetc
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
954
Directio fread
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
fwrite
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
955
Error clearerr
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
956
feof
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
ferror
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
957
File fclose
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
958
fflush
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
959
fopen
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
freopen
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
960
remove
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
961
rename
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
setbuf
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
962
setvbuf
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
963
tmpfile
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
964
tmpnam
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
File_pos fgetpos
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
965
fseek
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
966
fsetpos
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
ftell
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
967
rewind
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
968
Output vfprintf
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
969
vsprintf
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
970
3.3.3.6 abort
stdlib
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
abs
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
971
atof
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
972
atoi
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
atol
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
973
bsearch
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
974
calloc
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
975
div
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
exit
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
976
free
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
977
getenv
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
labs
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
978
ldiv
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
979
malloc
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
980
qsort
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
rand
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
981
realloc
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
982
srand
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
strtod
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
983
strtol
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
984
strtoul
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
985
system
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
3.3.3.7 strcat
string
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
986
strchr
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
987
strcmp
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
strcpy
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
988
strcspn
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
989
strerror
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
990
strlen
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
strncat
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
991
strncmp
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
992
strncpy
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
strpbrk
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
993
strrchr
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
994
strspn
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
995
strstr
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
strtok
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
996
3.3.3.8 asctime
time
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
997
clock
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
ctime
The function group c_bib contains C functions from the C library and is divided into: ctype math
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
998
difftime
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file
999
gmtime
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
1000
localtime
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
mktime
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into:
1001
strftime
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature.
1002
time
The function group c_bib contains C functions from the C library and is divided into: ctype math memory stdio stdlib string time stdio itself is further divided into: char_io directio error file file_pos output You can find a description of this function in related technical literature. Note The function localtime reacts as follows in respect of date output: Numbering of the months begins with 0. The years are counted from 1900, beginning with 0. The C-library functions printf(), sprintf(), fprintf() can only process 360 characters in WinCC.
1003
3.3.4
3.3.4.1
graphics
Graphics - short description
The functions of the Graphics group allow to modify or query graphical properties of WinCC objects. Note Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well. Note If the function is called for the picture object, set the parameter lpszObjectName = ZERO.
3.3.4.2 axes
get
GetAlignment Function
When using bar objects, it indicates whether the text is to the right or left of the bar.
Syntax
BOOL GetAlignment(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1004
FALSE
Text is to the left of the bar
See also
Beispiel GetScaling (Page1490)
GetAxisSection Function
When using bar objects, it specifies the difference between the values of two neighboring axis labels.
Syntax
double GetAxisSection(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Difference between the values of two neighboring axis labels
GetExponent Function
When using bar objects, it specifies whether the axis label corresponds to the decimal or exponential form.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1005
Syntax
BOOL GetExponent(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Axis label in decimal form
See also
Beispiel GetScaling (Page1490)
GetLeftComma Function
When using bar objects, it specifies the number of integers in the axis label.
Syntax
long int GetLeftComma(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1006
lpszObjectName
Object name
Return value
The number of integers in the axis label
GetLongStrokesBold Function
When using bar objects, it specifies whether the main division lines on the scale are bold or regular.
Syntax
BOOL GetLongStrokesBold(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
The main division lines on the graph scale are regular
See also
Beispiel GetScaling (Page1490)
1007
GetLongStrokesOnly Function
When using bar objects, it specifies whether intermediate division lines are used on the scale.
Syntax
BOOL GetLongStrokesOnly(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Both main and intermediate division lines are used on the bar graph scale.
See also
Beispiel GetScaling (Page1490)
GetLongStrokesSize Function
When using bar objects, it specifies the length of the main division lines.
Syntax
long int GetLongStrokesSize(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1008
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Length of the main division lines as numeric value
GetLongStrokesTextEach Function
When using bar objects, it specifies the interval between the main division lines being assigned a label.
Syntax
long int GetLongStrokesTextEach(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Label of the main division lines as numeric value
Example:
Return value = 1 -> Every main division line is assigned a label. Return value = 2 -> Every 2nd main division line is assigned a label. etc.
1009
GetRightComma Function
When using bar objects, it specifies the number of decimal places in the axis label.
Syntax
long int GetRightComma(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
The number of decimal places in the axis label
GetScaleTicks Function
When using bar objects, it specifies the scale marks as number of scale sections. A scale section is a part of the scale bounded by two main tick marks.
Syntax
long int GetScaleTicks(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1010
Return value
Scale marks as number of scale sections Note The number of scale sections is given as 0, if the bar object itself calculates a suitable scale unit.
GetScaling Function
When using bar objects, it specifies whether the scale is activated or deactivated.
Syntax
BOOL GetScaling(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Display without scale
See also
Beispiel GetScaling (Page1490)
1011
GetScalingType Function
When using bar objects, it specifies the type of bar scaling.
Syntax
long int GetScalingType(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Type of bar scaling as numeric value STRUCTURES_TABLES_BAR_SCALING
See also
Bar Scaling (Page1535)
1012
GetBackColor Function
Specifies the background color of the object as a numeric value.
Syntax
long int GetBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Background color of the object as a numeric value Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
Color chart (Page1538) GetBackColor example (Page1474)
GetBackColor2 Function
When using bar objects, it specifies the color of the bar as a numeric value.
Syntax
long int GetBackColor2(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1013
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetBackColor3 Function
When using bar objects, it specifies the background color of the bar as a numeric value.
Syntax
long int GetBackColor3(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar background color STRUCTURES_TABLES_COLOR_CHART
1014
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetBackColorBottom Function
Specifies the background color of the slider objects at the bottom right.
Syntax
long int GetBackColorBottom(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the background color of the slider objects at the bottom right STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetBackColorTop Function
Specifies the background color of the slider objects at the top left.
Syntax
long int GetBackColorTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1015
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the background color of the slider objects at the top left STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetBorderBackColor Function
Specifies the background color of the lines or borders.
Syntax
long int GetBorderBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the background color of the lines or borders STRUCTURES_TABLES_COLOR_CHART
1016
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetBorderColor Function
Specifies the line or border color as a numeric value.
Syntax
long int GetBorderColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the color of lines or borders STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetBorderColorBottom Function
Specifies the 3D border color at the bottom.
Syntax
long int GetBorderColorBottom(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1017
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the 3D border color at the bottom STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetBorderColorTop Function
Specifies the 3D border color at the top.
Syntax
long int GetBorderColorTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the 3D border color at the top STRUCTURES_TABLES_COLOR_CHART
1018
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetButtonColor Function
Specifies the button color of slider objects.
Syntax
long int GetButtonColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the button color of slider objects STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorBottom Function
When using slider objects, it specifies the color of the bottom limit.
Syntax
long int GetColorBottom(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1019
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the color of the bottom limit of slider objects STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorTop Function
When using slider objects, it specifies the color of the top limit.
Syntax
long int GetColorTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the color of the top limit of slider objects STRUCTURES_TABLES_COLOR_CHART
1020
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetFillColor Function
Specifies the color of the fill pattern.
Syntax
long int GetFillColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value of the fill color Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
Color chart (Page1538) GetBackColor example (Page1474)
GetForeColor Function
Specifies the color of the font.
1021
Syntax
long int GetForeColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the font color STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetGridColor Function
Specifies the grid color of Graphics Designer.
Syntax
long int GetGridColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1022
Return value
Numeric value defining the grid color of Graphics Designer STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetItemBorderBackColor Function
Specifies the background color of the dividing line for the "text list" object.
Syntax
long int GetItemBorderBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the background color of the dividing line for the "text list" object STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
1023
GetItemBorderColor Function
Specifies the color of the dividing line for the "text list" object.
Syntax
long int GetItemBorderColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the dividing line color for the "text list" object STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetScaleColor Function
Specifies the scale color for bar objects.
Syntax
long int GetScaleColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1024
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value of the scale color for bar objects STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetSelBGColor Function
Specifies the background color of the selected entry for the "text list" object.
Syntax
long int GetSelBGColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the background color of the selected entry STRUCTURES_TABLES_COLOR_CHART
1025
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetSelTextColor Function
Specifies the font color of the selected entry for the "text list" object.
Syntax
long int GetSelTextColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the font color of the selected entry STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetTrendColor Function
Specifies the trend color of bar objects.
Syntax
long int GetTrendColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1026
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the trend color of bar objects STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetUnselBGColor Function
Specifies the background color of the non-selected entries for the "text list" object.
Syntax
long int GetUnselBGColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the background color of the non-selected entries STRUCTURES_TABLES_COLOR_CHART
1027
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetUnselTextColor Function
Specifies the font color of the non-selected entries for the "text list" object.
Syntax
long int GetUnselTextColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the font color of the non-selected entries STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
1028
GetFilling Function
Specifies whether dynamic filling with background color is activated.
Syntax
BOOL GetFilling(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Dynamic filling with background color is not activated.
See also
GetFilling example (Page1475)
1029
GetFillingIndex Function
Specifies the current fill level.
Syntax
long int GetFillingIndex(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Current fill level as a numeric value (0 - 100)
See also
GetFillingIndex example (Page1476)
1030
GetBackFlashColorOff Function
Specifies the background flash color for the deactivated status.
Syntax
long int GetBackFlashColorOff(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Background flash color for the deactivated status as a numeric value STRUCTURES_TABLES_COLOR_CHART
See also
GetFlashBackColorOn example (Page1478)
GetBackFlashColorOn Function
Specifies the background flash color for the activated status.
Syntax
long int GetBackFlashColorOn(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1031
lpszObjectName
Object name
Return value
Background flash color for the activated status as a numeric value STRUCTURES_TABLES_COLOR_CHART
See also
GetFlashBackColorOn example (Page1478) Color chart (Page1538)
GetBorderFlashColorOff Function
Specifies the border or line flashing color for the deactivated status.
Syntax
long int GetBorderFlashColorOff(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Border or line flashing color for the deactivated status as a numeric value STRUCTURES_TABLES_COLOR_CHART
See also
GetFlashBackColorOn example (Page1478) Color chart (Page1538)
1032
GetBorderFlashColorOn Function
Specifies the border or line flashing color for the activated status.
Syntax
long int GetBorderFlashColorOn(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Border or line flashing color for the activated status as a numeric value STRUCTURES_TABLES_COLOR_CHART
See also
GetFlashBackColorOn example (Page1478) Color chart (Page1538)
GetFlashBackColor Function
Specifies whether flashing of the background is activated or not.
Syntax
BOOL GetFlashBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1033
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Flashing background is not activated.
See also
GetFlashBackColor example (Page1477)
GetFlashBorderColor Function
Specifies whether flashing of the border or line is activated or not.
Syntax
BOOL GetFlashBorderColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1034
FALSE
Flashing of the border or line is not activated.
See also
GetFlashBackColor example (Page1477)
GetFlashForeColor Function
Specifies whether flashing of the font is activated or not.
Syntax
BOOL GetFlashForeColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Flashing of the font is not activated.
1035
See also
GetFlashBackColor example (Page1477)
GetFlashRateBackColor Function
Specifies the flash frequency of the background.
Syntax
long int GetFlashRateBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Flash frequency of the background STRUCTURES_TABLES_FLASH_FREQUENCIES
See also
GetFlashBackColorOn example (Page1478) Flash frequencies (Page1536)
GetFlashRateBorderColor Function
Specifies the flash frequency of the line or border.
Syntax
long int GetFlashRateBorderColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1036
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Flash frequency of the line or border STRUCTURES_TABLES_FLASH_FREQUENCIES
See also
GetFlashBackColorOn example (Page1478) Flash frequencies (Page1536)
GetFlashRateForeColor Function
Specifies the flash frequency of the font.
Syntax
long int GetFlashRateForeColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Flash frequency of the font STRUCTURES_TABLES_FLASH_FREQUENCIES
1037
See also
GetFlashBackColorOn example (Page1478) Flash frequencies (Page1536)
GetForeFlashColorOff Function
Specifies the font flash color for the deactivated status.
Syntax
long int GetForeFlashColorOff(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Font flash color for the deactivated status as a numeric value STRUCTURES_TABLES_COLOR_CHART
See also
GetFlashBackColorOn example (Page1478) Color chart (Page1538)
GetForeFlashColorOn Function
Specifies the font flash color for the activated status.
Syntax
long int GetForeFlashColorOn(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1038
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Font flash color for the activated status as a numeric value STRUCTURES_TABLES_COLOR_CHART
See also
GetFlashBackColorOn example (Page1478) Color chart (Page1538)
Get_Focus Function
Specifies the name of the object currently or last focussed.
Syntax
char *Get_Focus();
1039
Return value
Name of the object currently or last focussed.
See also
GetFocus example (Page1479)
GetAlignmentLeft Function
Specifies the horizontal text alignment (left, centered, right).
Syntax
long int GetAlignmentLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Horizontal text alignment as a numeric value STRUCTURES_TABLES_TEXT_ALIGNMENT
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1040
See also
Text alignment (Page1543) GetFontSize example (Page1480)
GetAlignmentTop Function
Specifies the vertical text alignment (top, centered, bottom).
Syntax
long int GetAlignmentTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Vertical text alignment as a numeric value STRUCTURES_TABLES_TEXT_ALIGNMENT
See also
GetFontSize example (Page1480) Text alignment (Page1543)
GetFontBold Function
Specifies whether the font is bold or not.
Syntax
BOOL GetFontBold(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1041
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Bold font off
See also
GetFontBold example (Page1479)
GetFontItalic Function
Specifies whether the font is italic or not.
Syntax
BOOL GetFontItalic(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1042
FALSE
Italic font off
See also
GetFontBold example (Page1479)
GetFontName Function
Indicates the current font name.
Syntax
char* GetFontName(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Pointer to the name of the font currently seleted
See also
GetText example (Page1507)
1043
GetFontSize Function
Specifies the font size.
Syntax
long int GetFontSize(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Current font size
See also
GetFontSize example (Page1480)
GetFontUnderline Function
Specifies whether the font is underlined or not.
Syntax
BOOL GetFontUnderline(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1044
lpszObjectName
Object name
FALSE
Underlined font off
See also
GetFontBold example (Page1479)
GetOrientation Function
Specifies the text orientation (vertical/horizontal).
Syntax
BOOL GetOrientation(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1045
FALSE
Horizontal text orientation
See also
GetFontBold example (Page1479)
GetText Function
Specifies the value of the "text" property for objects like static text, check box or radio box.
Syntax
char* GetText(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Pointer to a text Note In case of check and radio boxes the element to be determined must be defined with the SetIndex function before actually activating this function.
See also
GetText example (Page1507)
1046
Syntax
long int GetLayer(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Picture layer in which the object is located
GetActualPointLeft Function
Specifies the X value of the current position in a polygon or polygon line.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1047
Syntax
long int GetActualPointLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
X value for the current point of a polygon or polygon line Note The current point of the polygon can be set using the SetIndex function.
See also
GetLeft example (Page1482)
GetActualPointTop Function
Specifies the Y value of the current position in a polygon or polygon line.
Syntax
long int GetActualPointTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1048
Return value
Y value for the current point of a polygon or polygon line Note The current point of the polygon can be set using the SetIndex function.
See also
GetTop example (Page1508)
GetBoxCount Function
Specifies the number of fields for check boxes and radio boxes.
Syntax
long int GetBoxCount(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Number of fields in a check box or radio box.
GetDirection Function
Specifies the bar direction for bar objects.
Syntax
long int GetDirection(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1049
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Bar direction of bar objects as numeric value STRUCTURES_TABLES_BAR_DIRECTION
See also
Bar direction (Page1535)
GetEndAngle Function
Specifies the end angle of circle and ellipse segments and circle and elliptical arcs.
Syntax
long int GetEndAngle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
End angle of circle and ellipse segments as well as circle and ellipse arcs
1050
GetGrid Function
Specifies whether the grid is activated in the graphics area of Graphics Designer.
Syntax
BOOL GetGrid(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Grid in Graphics Designer is deactivated.
GetGridHeight Function
Specifies the height of the grid in the graphics area of Graphics Designer.
Syntax
long int GetGridHeight(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1051
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Height of the grid in Graphics Designer
GetGridWidth Function
Specifies the width of the grid in the graphics area of Graphics Designer.
Syntax
long int GetGridWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Width of the grid in Graphics Designer
GetHeight Function
Specifies the height of the rectangle framing an object.
1052
Syntax
long int GetHeight(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Height of the rectangle framing an object Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
GetHeight example (Page1480)
GetLeft Function
Specifies the X position of the upper left corner of the rectangle framing an object.
Syntax
long int GetLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1053
lpszObjectName
Object name
Return value
Current X value of the upper left corner of the rectangle framing an object
See also
GetLeft example (Page1482)
GetPointCount Function
Specifies the number of corners of a polygon or in a polygon line.
Syntax
long int GetPointCount(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Number of corners of a polygon or in a polyline
GetRadius Function
Specifies the radius of a circle, circle segment or arc.
Syntax
long int GetRadius(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1054
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Radius of a circle, circle segment or arc
See also
GetHeight example (Page1480)
GetRadiusHeight Function
Specifies the radius of an ellipse, ellipse segment or elliptical arc in a vertical direction.
Syntax
long int GetRadiusHeight(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Radius of an ellipse, ellipse segment or elliptical arc in a vertical direction
See also
GetHeight example (Page1480)
1055
GetRadiusWidth Function
Specifies the radius of an ellipse, ellipse segment or elliptical arc in a horizontal direction.
Syntax
long int GetRadiusWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Radius of an ellipse, ellipse segment or elliptical arc in a horizontal direction
See also
GetHeight example (Page1480)
GetReferenceRotationLeft Function
Specifies the X value of the rotation reference (central axis about which the object can be rotated) for lines, polygons and polylines.
Syntax
long int GetReferenceRotationLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1056
lpszObjectName
Object name
Return value
X value of the rotation reference for lines, polygons and polygon lines
See also
GetLeft example (Page1482)
GetReferenceRotationTop Function
Specifies the Y value of the rotation reference (central axis about which the object can be rotated) for lines, polygons and polylines.
Syntax
long int GetReferenceRotationTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Y value of the rotation reference for lines, polygons and polygon lines
See also
GetTop example (Page1508)
1057
GetRotationAngle Function
Specifies the angle of rotation about the central axis for lines, polygons and polylines.
Syntax
long int GetRotationAngle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Angle of rotation about the central axis
See also
GetHeight example (Page1480)
GetRoundCornerHeight Function
Specifies the radius of the rounded corner of a rectangle vertically.
Syntax
long int GetRoundCornerHeight(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1058
lpszObjectName
Object name
Return value
Vertical radius of the rounded corner of a rectangle
See also
GetHeight example (Page1480)
GetRoundCornerWidth Function
Specifies the radius of the rounded corner of a rectangle horizontally.
Syntax
long int GetRoundCornerWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Horizontal radius of the corner of the rounded corner of a rectangle
See also
GetWidth example (Page1509)
GetStartAngle Function
Specifies the start angle of circle and ellipse segments and circle and elliptical arcs.
1059
Syntax
long int GetStartAngle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Start angle of circle and ellipse segments as well as circle and elliptical arcs
See also
GetHeight example (Page1480)
GetTop Function
Specifies the Y position of the upper left corner of the rectangle framing an object.
Syntax
long int GetTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Current Y value of the upper left corner of the rectangle framing an object
1060
See also
GetTop example (Page1508)
GetWidth Function
Specifies the width of the rectangle framing an object.
Syntax
long int GetWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Width of the rectangle framing an object Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
GetWidth example (Page1509)
GetZeroPoint Function
When using bar objects, it indicates the zero point.
1061
Syntax
long int GetZeroPoint(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Zero point for bar objects
See also
GetHeight example (Page1480)
GetAssignments Function
Assignment of text to the value range of lists
Syntax
char* GetAssignments(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1062
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
The assignment of text to the value range depends on the list type. STRUCTURES_TABLES_LIST_TYPES
See also
List types (Page1541)
GetAssumeOnExit Function
Specifies for I/O fields whether the entered value is assumed upon exiting the field.
Syntax
BOOL GetAssumeOnExit(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1063
FALSE
No value application upon exiting the field.
GetAssumeOnFull Function
Specifies for I/O fields whether the entered value is assumed on completion of input.
Syntax
BOOL GetAssumeOnFull(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
No value application on completion of input.
GetBitNumber Function
Specifies the relevant bit in the output value for the "bit" list type.
Syntax
long int GetBitNumber(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1064
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Indication of the relevant bit in the output value for the "bit" list type STRUCTURES_TABLES_LIST_TYPES
See also
GetHiddenInput example (Page1481) List types (Page1541)
GetClearOnError Function
Specifies for I/O fields whether deletion of the content in case of input errors is activated.
Syntax
BOOL GetClearOnError(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1065
FALSE
Deletion of the content in case of input errors is not activated
GetClearOnNew Function
Specifies for I/O fields whether deletion of the content on new input is activated.
Syntax
BOOL GetClearOnNew(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Deletion of the content on new input is not activated.
1066
GetDataFormat Function
Specifies the data type of the field content for I/O fields.
Syntax
long int GetDataFormat(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Data type of the field content as numeric value STRUCTURES_TABLES_IO_FIELD_DATA_TYPE_OF_FIELD_CONTENT
See also
GetHiddenInput example (Page1481) I/O field, data type of the field content (Page1537)
GetHiddenInput Function
Specifies whether hidden input is activated for I/O fields.
Syntax
BOOL GetHiddenInput(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1067
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Hidden input is not activated
See also
GetHiddenInput example (Page1481)
GetInputValueChar Function
Specifies the input value in the data type "char" for I/O fields.
Syntax
char* GetInputValueChar(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1068
Return value
Pointer to the input value in the data type "char"
GetInputValueDouble Function
Specifies the input value in the data type "double" for I/O fields.
Syntax
double GetInputValueDouble(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Input value in the data type "double"
GetListType Function
Specifies the list type for the "text list" object.
Syntax
long int GetListType(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1069
lpszObjectName
Object name
Return value
List type for the "text list" object STRUCTURES_TABLES_LIST_TYPES
See also
GetHiddenInput example (Page1481) List types (Page1541)
GetNumberLines Function
Specifies the number of visible lines for the "text list" object.
Syntax
long int GetNumberLines(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Number of visible lines for the "text list" object Note If the amount of configured text is larger than the number of visible lines, the "text list" object receives a vertical scroll bar.
1070
See also
GetHiddenInput example (Page1481)
GetOutputFormat Function
Specifies the output format for I/O fields.
Syntax
char* GetOutputFormat(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Pointer to the output format STRUCTURES_TABLES_IA_FIELD_OUTPUT_FORMAT
See also
I/O field, data type of the field content (Page1537)
GetOutputValueChar Function
Determines the output value in the data type "char" for I/O fields. This function should only be used if the field content of the I/O field is of the "string" data type.
Syntax
char* GetOutputValueChar(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1071
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Pointer to the output value in the data type "char"
GetOutputValueDouble Function
Determines the output value in the data type "double" for I/O fields. This function should only be used if the field content of the I/O field is not of the "string" data type.
Syntax
double GetOutputValueDouble(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Output value in the data type "double"
See also
GetOutputValueDouble example (Page1485)
1072
GetAlarmHigh Function
Specifies the upper alarm limit for bar objects.
Syntax
double GetAlarmHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Upper alarm limit for bar objects
See also
GetAlarmHigh example (Page1474)
1073
GetAlarmLow Function
Specifies the lower alarm limit for bar objects.
Syntax
double GetAlarmLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Lower alarm limit for bar objects
See also
GetAlarmHigh example (Page1474)
GetCheckAlarmHigh Function
When using bar objects, it specifies whether the upper alarm limit is monitored.
Syntax
BOOL GetCheckAlarmHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1074
lpszObjectName
Object name
FALSE
In case of bar objects the upper alarm limit is not monitored.
See also
GetMarker example (Page1484)
GetCheckAlarmLow Function
When using bar objects, it specifies whether the lower alarm limit is monitored.
Syntax
BOOL GetCheckAlarmLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1075
FALSE
In case of bar objects the lower alarm limit is not monitored.
See also
GetMarker example (Page1484)
GetCheckLimitHigh4 Function
When using bar objects, it specifies whether the upper limit value reserve 4 is monitored.
Syntax
BOOL GetCheckLimitHigh4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the upper limt value reserve 4 is not monitored.
See also
GetMarker example (Page1484)
1076
GetCheckLimitHigh5 Function
When using bar objects, it specifies whether the upper limit value reserve 5 is monitored.
Syntax
BOOL GetCheckLimitHigh5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the upper limt value reserve 5 is not monitored.
See also
GetMarker example (Page1484)
GetCheckLimitLow4 Function
When using bar objects, it specifies whether the lower limit value reserve 4 is monitored.
Syntax
BOOL GetCheckLimitLow4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1077
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the lower limt value reserve 4 is not monitored.
See also
GetMarker example (Page1484)
GetCheckLimitLow5 Function
When using bar objects, it specifies whether the lower limit value reserve 5 is monitored.
Syntax
BOOL GetCheckLimitLow5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1078
FALSE
In case of bar objects the lower limt value reserve 5 is not monitored.
See also
GetMarker example (Page1484)
GetCheckToleranceHigh Function
When using bar objects, it specifies whether the upper tolerance limit is monitored.
Syntax
BOOL GetCheckToleranceHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the upper tolerance limit is not monitored.
1079
See also
GetMarker example (Page1484)
GetCheckToleranceLow Function
When using bar objects, it specifies whether the lower tolerance limit is monitored.
Syntax
BOOL GetCheckToleranceLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the lower tolerance limit is not monitored.
See also
GetMarker example (Page1484)
GetCheckWarningHigh Function
When using bar objects, it specifies whether the upper warning limit is monitored.
1080
Syntax
BOOL GetCheckWarningHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the upper warning limit is not monitored.
See also
GetMarker example (Page1484)
GetCheckWarningLow Function
When using bar objects, it specifies whether the lower warning limit is monitored.
Syntax
BOOL GetCheckWarningLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1081
lpszObjectName
Object name
FALSE
In case of bar objects the lower warning limit is not monitored.
See also
GetMarker example (Page1484)
GetColorAlarmHigh Function
Specifies the bar color for bar objects upon reaching the upper alarm limit.
Syntax
long int GetColorAlarmHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the upper alarm limit STRUCTURES_TABLES_COLOR_CHART
1082
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorAlarmLow Function
Specifies the bar color for bar objects upon reaching the lower alarm limit.
Syntax
long int GetColorAlarmLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the lower alarm limit STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorLimitHigh4 Function
Specifies the bar color for bar objects upon reaching the upper limit reserve 4.
Syntax
long int GetColorLimitHigh4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1083
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the upper limit reserve 4 STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorLimitHigh5 Function
Specifies the bar color for bar objects upon reaching the upper limit reserve 5.
Syntax
long int GetColorLimitHigh5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the upper limit reserve 5 STRUCTURES_TABLES_COLOR_CHART
1084
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorLimitLow4 Function
Specifies the bar color for bar objects upon reaching the lower limit reserve 4.
Syntax
long int GetColorLimitLow4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the lower limit reserve 4 STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorLimitLow5 Function
Specifies the bar color for bar objects upon reaching the lower limit reserve 5.
Syntax
long int GetColorLimitLow5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1085
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the lower limit reserve 5 STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorToleranceHigh Function
Specifies the bar color for bar objects upon reaching the upper tolerance limit.
Syntax
long int GetColorToleranceHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the upper tolerance limit STRUCTURES_TABLES_COLOR_CHART
1086
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorToleranceLow Function
Specifies the bar color for bar objects upon reaching the lower tolerance limit.
Syntax
long int GetColorToleranceLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the lower tolerance limit STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorWarningHigh Function
Specifies the bar color for bar objects upon reaching the upper warning limit limit.
Syntax
long int GetColorWarningHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1087
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the upper warning limit STRUCTURES_TABLES_COLOR_CHART
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetColorWarningLow Function
Specifies the bar color for bar objects upon reaching the lower warning limit.
Syntax
long int GetColorWarningLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the bar color upon reaching the lower warning limit STRUCTURES_TABLES_COLOR_CHART
1088
See also
GetBackColor example (Page1474) Color chart (Page1538)
GetLimitHigh4 Function
Specifies the upper limit value for reserve 4 for bar objects.
Syntax
double GetLimitHigh4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
High limit value for reserve 4 for bar objects
See also
GetAlarmHigh example (Page1474)
GetLimitHigh5 Function
Specifies the upper limit value for reserve 5 for bar objects.
Syntax
double GetLimitHigh5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1089
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
High limit value for reserve 5 for bar objects
See also
GetAlarmHigh example (Page1474)
GetLimitLow4 Function
Specifies the low limit value for reserve 4 for bar objects.
Syntax
double GetLimitLow4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Low limit value for reserve 4 for bar objects
See also
GetAlarmHigh example (Page1474)
1090
GetLimitLow5 Function
Specifies the low limit value for reserve 5 for bar objects.
Syntax
double GetLimitLow5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Low limit value for reserve 5 for bar objects
See also
GetAlarmHigh example (Page1474)
GetLimitMax Function
Specifies the upper limit value for I/O fields.
Syntax
double GetLimitMax(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1091
lpszObjectName
Object name
Return value
High limit value for I/O fields
See also
GetAlarmHigh example (Page1474)
GetLimitMin Function
Specifies the low limit value for I/O fields.
Syntax
double GetLimitMin(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Low limit value for I/O fields
See also
GetAlarmHigh example (Page1474)
GetMarker Function
When using bar objects, it specifies whether the limit marker is displayed.
1092
Syntax
BOOL GetMarker(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Limit marker for bar objects is not displayed.
See also
GetMarker example (Page1484)
GetToleranceHigh Function
Specifies the upper tolerance limit for bar objects.
Syntax
double GetToleranceHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1093
lpszObjectName
Object name
Return value
Upper tolerance limit for bar objects
See also
GetAlarmHigh example (Page1474)
GetToleranceLow Function
Specifies the lower tolerance limit for bar objects.
Syntax
double GetToleranceLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Lower tolerance limit for bar objects
See also
GetAlarmHigh example (Page1474)
1094
GetTypeAlarmHigh Function
Specifies for bar objects whether the upper alarm limit is given in percentages or absolute terms.
Syntax
BOOL GetTypeAlarmHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the upper alarm limit is given in absolute terms.
See also
GetMarker example (Page1484)
GetTypeAlarmLow Function
Specifies for bar objects whether the lower alarm limit is given in percentages or absolute terms.
Syntax
BOOL GetTypeAlarmLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1095
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the lower alarm limit is given in absolute terms.
See also
GetMarker example (Page1484)
GetTypeLimitHigh4 Function
Specifies for bar objects whether the upper limit reserve 4 is given in percentages or absolute terms.
Syntax
BOOL GetTypeLimitHigh4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1096
FALSE
In case of bar objects the upper limit reserve 4 is given in absolute terms.
See also
GetMarker example (Page1484)
GetTypeLimitHigh5 Function
Specifies for bar objects whether the upper limit reserve 5 is given in percentages or absolute terms.
Syntax
BOOL GetTypeLimitHigh5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the upper limit reserve 5 is given in absolute terms.
1097
See also
GetMarker example (Page1484)
GetTypeLimitLow4 Function
Specifies for bar objects whether the lower limit reserve 4 is given in percentages or absolute terms.
Syntax
BOOL GetTypeLimitLow4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the lower limit reserve 4 is given in absolute terms.
See also
GetMarker example (Page1484)
GetTypeLimitLow5 Function
Specifies for bar objects whether the lower limit reserve 5 is given in percentages or absolute terms.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1098
Syntax
BOOL GetTypeLimitLow5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the lower limit reserve 5 is given in absolute terms.
See also
GetMarker example (Page1484)
GetTypeToleranceHigh Function
Specifies for bar objects whether the upper tolerance limit is given in percentages or absolute terms.
Syntax
BOOL GetTypeToleranceHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1099
lpszObjectName
Object name
FALSE
In case of bar objects the upper tolerance limit is given in absolute terms.
See also
GetMarker example (Page1484)
GetTypeToleranceLow Function
Specifies for bar objects whether the lower tolerance limit is given in percentages or absolute terms.
Syntax
BOOL GetTypeToleranceLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1100
FALSE
In case of bar objects the lower tolerance limit is given in absolute terms.
See also
GetMarker example (Page1484)
GetTypeWarningHigh Function
Specifies for bar objects whether the upper warning limit is given in percentages or absolute terms.
Syntax
BOOL GetTypeWarningHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the upper warning limit is given in absolute terms.
See also
GetMarker example (Page1484)
1101
GetTypeWarningLow Function
Specifies for bar objects whether the lower warning limit is given in percentages or absolute terms.
Syntax
BOOL GetTypeWarningLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
In case of bar objects the lower warning limit is given in absolute terms.
See also
GetMarker example (Page1484)
GetWarningHigh Function
Specifies the upper warning limit for bar objects.
Syntax
double GetWarningHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1102
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Upper warning limit for bar objects
See also
GetAlarmHigh example (Page1474)
GetWarningLow Function
Specifies the lower warning limit for bar objects.
Syntax
double GetWarningLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Lower warning limit for bar objects
See also
GetAlarmHigh example (Page1474)
1103
GetLink Function
Specifies the current tag connection of object properties.
Syntax
BOOL GetLink(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName, LPLINKINFO *pLink);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Object property
pLink
Pointer to a structure of the type: LINKINFO
1104
FALSE
An error has occurred.
See also
Structure definition LINKINFO (Page1551) GetLink example (Page1482)
GetAdaptBorder Function
Specifies for static texts, I/O fields, check boxes and radio boxes whether the border of the field is to be dynamically adapted to the text size.
Syntax
BOOL GetAdaptBorder(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1105
lpszObjectName
Object name
FALSE
Border is not adapted
See also
GetVisible example (Page1508)
GetAdaptPicture Function
Specifies for picture windows whether the picture is to be adapted to the window size.
Syntax
BOOL GetAdaptPicture(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1106
FALSE
Picture is not adapted
See also
GetVisible example (Page1508)
GetAdaptSize Function
Specifies for picture windows whether the window is to be adapted.
Syntax
BOOL GetAdaptSize(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Window is not adapted
See also
GetVisible example (Page1508)
1107
GetAverage Function
When using bar objects, it specifies whether value averaging is activated.
Syntax
BOOL GetAverage(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Averaging is not activated for bar objects
See also
GetVisible example (Page1508)
GetBoxType Function
Specifies the field type (input field, output field, input/output field) for I/O fields.
Syntax
long int GetBoxType(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1108
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Field type of an I/O field STRUCTURES_TABLES_IO_FIELD_TYPE
See also
I/O field, field type (Page1537)
GetCaption Function
Specifies whether a picture or application window has a title.
Syntax
BOOL GetCaption(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1109
FALSE
Picture/application window has no title
See also
GetVisible example (Page1508)
GetCloseButton Function
When using a picture window, it specifies whether the window can be closed.
Syntax
BOOL GetCloseButton(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Picture window cannot be closed
See also
GetVisible example (Page1508)
1110
GetColorChangeType Function
When using bar objects, it specifies whether the color change upon reaching a limit value only affects a bar segment or the entire bar.
Syntax
BOOL GetColorChangeType(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Color change applies to the entire bar
See also
GetVisible example (Page1508)
GetCursorControl Function
Specifies whether cursor control is activated for I/O fields.
Syntax
BOOL GetCursorControl(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1111
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Cursor control for I/O fields is disabled.
See also
GetVisible example (Page1508)
GetCursorMode Function
Specifies whether the cursor mode for the picture is alpha cursor or tab order cursor.
Syntax
BOOL GetCursorMode(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1112
FALSE
Cursor mode for the picture is "tab order cursor"
See also
GetVisible example (Page1508)
GetEditAtOnce Function
Specifies whether the "Immediate input" property is activated for I/O fields.
Syntax
BOOL GetEditAtOnce(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
"Immediate input" property is deactivated
1113
See also
GetVisible example (Page1508)
GetExtendedOperation Function
Specifies whether the "Extended operation" property is activated for slider objects.
Syntax
BOOL GetExtendedOperation(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
"Extended operation" property is deactivated
See also
GetVisible example (Page1508)
GetHotkey Function
Specifies the key combination for check boxes.
1114
Syntax
long int GetHotkey(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Key code for key combinations for check boxes
GetHysteresis Function
When using bar objects, it specifies whether the display appears with or without hysteresis.
Syntax
BOOL GetHysteresis(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1115
FALSE
Display without hysteresis for bar objects
See also
GetVisible example (Page1508)
GetHysteresisRange Function
Specifies the hysteresis value in the display for bar objects.
Syntax
double GetHysteresisRange(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Hysteresis in the display for bar objects
GetLanguageSwitch Function
Specifies fot the "Text list" object whether the assignment texts are to be stored in the text library or in the object itself.
Syntax
BOOL GetLanguageSwitch(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1116
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Assignment texts are stored in the text list object
See also
GetVisible example (Page1508)
GetLastChange Function
Specifies the date when the picture was last changed.
Syntax
char* GetLastChange(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1117
Return value
Date of the last change of the picture
See also
GetPictureName example (Page1486)
GetMax Function
Specifies the maximum value for bar and slider objects.
Syntax
double GetMax(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Maximum value for bar and slider objects.
GetMaximizeButton Function
Specifies for picture or application windows whether the window can be maximized.
Syntax
BOOL GetMaximizeButton(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1118
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Picture or application window cannot be maximized
See also
GetVisible example (Page1508)
GetMin Function
Specifies the minimum value for bar and slider objects.
Syntax
double GetMin(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1119
Return value
Minimum value for bar and slider objects
GetMoveable Function
Specifies for picture or application windows whether the window can be moved.
Syntax
BOOL GetMoveable(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Picture or application window is not movable
See also
GetVisible example (Page1508)
GetOffsetLeft Function
Specifies the horizontal picture distance from the left window border for picture windows.
1120
Syntax
long int GetOffsetLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Horizontal picture distance from the left window border for picture windows
GetOffsetTop Function
Specifies the vertical picture distance from the upper window border for picture windows.
Syntax
long int GetOffsetTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Vertical picture distance from the upper window border for picture windows
1121
GetOnTop Function
Specifies for picture or application windows whether the window is always in the foreground.
Syntax
BOOL GetOnTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Picture or application window can be overlapped by other windows.
See also
GetVisible example (Page1508)
GetOperation Function
Specifies whether the object can be operated.
Syntax
BOOL GetOperation(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1122
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Object is not operable Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
GetVisible example (Page1508)
GetOperationMessage Function
Specifies for I/O fields, check boxes, radio boxes or sliders whether a message is output following operation.
Syntax
BOOL GetOperationMessage(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1123
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Upon operation no message is issued
See also
GetVisible example (Page1508)
GetOperationReport Function
Specifies for all objects except application and picture windows and OLE control whether the reason for the operation is logged.
Syntax
BOOL GetOperationReport(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1124
FALSE
Reason for the operation is not logged. Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
GetVisible example (Page1508)
GetPasswordLevel Function
Specifies the authorization level for the operation of the object for all objects except application and picture windows and OLE control.
Syntax
long int GetPasswordLevel(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Authorization level for the operation of the object
1125
GetPictureName Function
Returns the name of the picture currently displayed in the picture window.
Syntax
char* GetPictureName(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Name of the picture window
Return value
Pointer to the name of the currently displayed picture Note If both parameters are NULL, a pointer appears indicating the name of the basic screen.
See also
GetPictureName example (Page1486)
GetProcess Function
Specifies the default setting value for the process value to be displayed for bar and slider objects.
1126
Syntax
double GetProcess(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
For bar and slider objects: Default setting value for the process value to be displayed For check and radio boxes: In a 32-bit word each field is represented by a bit (field 1 corrsponds to the bit value 0). Selected fields are marked by a set bit. Non-existing are assigned 0.
GetScrollBars Function
Specifies for picture windows whether the window has a scroll bar.
Syntax
BOOL GetScrollBars(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1127
FALSE
Picture window has no scroll bar
See also
GetVisible example (Page1508)
GetServerName Function
Specifies the default setting for the process value to be displayed for OLE control and OLE object.
Syntax
char* GetServerName(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Name of the object (OLE control and OLE object) under which it is registered in WINDOWS.
See also
GetPictureName example (Page1486)
1128
GetSizeable Function
Specifies for application or picture windows whether the window size can be changed.
Syntax
BOOL GetSizeable(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Application or picture window is not sizeable
See also
GetVisible example (Page1508)
GetSmallChange Function
Specifies the number of steps for slider objects by which the slider is shifted by a mouse click.
Syntax
long int GetSmallChange(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1129
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Number of steps by which the slider is shifted by a mouse click
GetTagPrefix Function
Returns the tag prefix of a picture window.
Syntax
char* GetTagPrefix(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Tag prefix of the picture window
See also
GetTagPrefix example (Page1501)
1130
GetTrend Function
When using bar objects, it specifies whether the trend display is activated.
Syntax
BOOL GetTrend(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Trend display is not activated for a bar object
See also
GetVisible example (Page1508)
GetUpdateCycle Function
Specifies the update cycle for the entire picture.
Syntax
long int GetUpdateCycle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1131
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the update cycle
See also
Structure definition LINKINFO (Page1551)
GetVisible Function
Specifies whether the object is displayed.
Syntax
BOOL GetVisible(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1132
FALSE
Object is not displayed Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
GetVisible example (Page1508)
GetWindowBorder Function
Specifies for application or picture windows whether the object is displayed with a border.
Syntax
BOOL GetWindowBorder(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Application or picture window is displayed without a border.
1133
See also
GetVisible example (Page1508)
GetZeroPointValue Function
Specifies the absolute value of the zero point for bar objects.
Syntax
double GetZeroPointValue(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Absolute value of the zero point for the bar display
GetZoom Function
Specifies the scaling factor for picture windos.
Syntax
long int GetZoom(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1134
lpszObjectName
Object name
Return value
Scaling factor of a picture window
GetPosition Function
Specifies the position of the slider for OCX slider objects.
Syntax
long int GetPosition(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Slider position of the OCX slider object as numeric value
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1135
See also
GetPosition example (Page1488)
GetRangeMax Function
Specifies the adjustment range "Max" for OCX slider objects.
Syntax
long int GetRangeMax(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Adjustment range "Max" of the OCX slider object as numeric value
See also
GetRangeMax example (Page1489)
GetRangeMin Function
Specifies the adjustment range "Min" for OCX slider objects.
Syntax
long int GetRangeMin(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1136
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Adjustment range "Min" of the OCX slider object as numeric value
See also
GetRangeMin example (Page1490)
GetPicDeactReferenced Function
Specifies whether the picture for the "deactivated" status is referenced for round buttons.
Syntax
BOOL GetPicDeactReferenced(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1137
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
The picture assigned to the "deactivated" status was stored in the object.
GetPicDeactTransparent Function
Specifies the transparent color for the "deactivated" status of round buttons.
Syntax
long int GetPicDeactTransparent(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the transparent color for the "deactivated" status
1138
See also
Color chart (Page1538) GetBackColor example (Page1474)
GetPicDeactUseTransColor Function
Specifies whether the transparent color for the "deactivated" status is used for round buttons.
Syntax
BOOL GetPicDeactUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Transparent color for "deactivated" status is not used
1139
GetPicDownReferenced Function
Specifies whether the picture for the "On/pressed" status is referenced for round buttons.
Syntax
BOOL GetPicDownReferenced(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
The picture assigned to the "On/pressed" status was stored in the object.
GetPicDownTransparent Function
Specifies the transparent color for the "On/pressed" status of round buttons.
Syntax
long int GetPicDownTransparent(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1140
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the transparent color for the "On/pressed" status Note This function only applies to Bitmap graphics (*.bmp).
See also
Color chart (Page1538) GetPictureDown example (Page1486)
GetPicDownUseTransColor Function
Specifies whether the transparent color for the "On/pressed" status is used for round buttons.
Syntax
BOOL GetPicDownUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1141
FALSE
Transparent color for "On/pressed" status is not used
GetPicReferenced Function
When using graphic objects, it specifies whether the picture is referenced.
Syntax
BOOL GetPicReferenced(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
The assigned picture was stored in the object.
1142
GetPicTransColor Function
Specifies the transparent color for a background picture for graphic objects.
Syntax
long int GetPicTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the background picture of a graphic object Note This function only applies to Bitmap graphics (*.bmp).
See also
Color chart (Page1538) GetBackColor example (Page1474)
GetPictureDeactivated Function
Specifies the picture name for the "deactivated" status of round buttons.
Syntax
char* GetPictureDeactivated(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1143
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Picture name for "deactivated" status Note Bitmap files (*.bmp, *.dib) as well as metafiles (*.emf, *.wmf) can be integrated.
GetPictureDown Function
Specifies the picture name for the "On/pressed" status of round buttons.
Syntax
char* GetPictureDown(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Picture name for the "On/pressed" status
1144
See also
GetPictureDown example (Page1486)
GetPictureUp Function
Specifies the picture name for the "Off/not pressed" status of round buttons.
Syntax
char* GetPictureUp(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Picture name for the "Off/not pressed" status Note Bitmap files (*.bmp, *.dib) as well as metafiles (*.emf, *.wmf) can be integrated.
See also
GetPictureUp example (Page1487)
1145
GetPicUpReferenced Function
Specifies whether the picture for the "Off/not pressed" status is referenced for round buttons.
Syntax
BOOL GetPicUpReferenced(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
The picture assigned to the "Off/not pressed" status was stored in the object.
GetPicUpTransparent Function
Specifies the transparent color for the "Off/not pressed" status of round buttons.
Syntax
long int GetPicUpTransparent(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1146
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the transparent color for the "Off/not pressed" status Note This function only applies to Bitmap graphics (*.bmp).
See also
Color chart (Page1538) GetBackColor example (Page1474)
GetPicUpUseTransColor Function
Specifies whether the transparent color for the "Off/not pressed" status is used for round buttons.
Syntax
BOOL GetPicUpUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1147
FALSE
Transparent color for "Off/not pressed" status is not used
GetPicUseTransColor Function
When using graphic objects, it specifies whether the transparent color is used for a background picture.
Syntax
BOOL GetPicUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Transparent color is not used for a background picture.
1148
GetPropBOOL Function
Specifies the current status of a property of the data type "BOOL".
Syntax
BOOL GetPropBOOL(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName)
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
Return value
Value of the attribute in the data type "BOOL"
See also
GetPropBOOL example (Page1488)
1149
GetPropChar Function
Specifies the current status of a property of the data type "char".
Syntax
char* GetPropChar(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName)
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
Return value
Pointer to a character string containing the value of the object property
See also
GetPropChar example (Page1489)
GetPropDouble Function
Specifies the current status of a property of the data type "double".
Syntax
double GetPropDouble(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName)
1150
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
Return value
Value of the attribute in the data type "double"
GetPropWord Function
Specifies the current status of a property of the data type "long".
Syntax
long GetPropWord(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName)
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
1151
Return value
Value of the attribute in the type "long"
GetBasePicReferenced Function
Specifies whether the basic picture is referenced for the status display.
Syntax
BOOL GetBasePicReferenced(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1152
FALSE
The basic picture was stored in the object.
GetBasePicTransColor Function
Specifies the transparent color of the basic picture for the status display.
Syntax
long int GetBasePicTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Transparent color of the basic picture as numeric value Note This function only applies to Bitmap graphics (*.bmp).
See also
Color chart (Page1538) GetBackColor example (Page1474)
GetBasePicture Function
Specifies the basic picture name fur the status display.
1153
Syntax
char* GetBasePicture(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Basic picture name for the status display
GetBasePicUseTransColor Function
When using the status display, it specifies whether the transparent color is used for the basic picture.
Syntax
BOOL GetBasePicUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1154
FALSE
Transparent color is not used for the basic picture.
GetFlashFlashPicture Function
Specifies whether the flash picture of the status display is animated dynamically or statically.
Syntax
BOOL GetFlashFlashPicture(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
The flash picture is animated statically.
GetFlashPicReferenced Function
Specifies whether the flash picture is referenced for the status display.
Syntax
BOOL GetFlashPicReferenced(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1155
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
The flash picture was stored in the object.
GetFlashPicTransColor Function
Specifies the transparent color of the flash picture for the status display.
Syntax
long int GetFlashPicTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Transparent color of the flash picture as numeric value
1156
See also
Color chart (Page1538) GetBackColor example (Page1474)
GetFlashPicture Function
Specifies the flash picture name for the status display.
Syntax
char* GetFlashPicture(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Flash picture name (file name of the graphic)
GetFlashPicUseTransColor Function
When using the status display, it specifies whether the transparent color is used for the flash picture.
Syntax
BOOL GetFlashPicUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1157
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Transparent color is not used for the flash picture.
GetFlashRateFlashPic Function
Specifies the flash frequency of the flash picture for the status display.
Syntax
long int GetFlashRateFlashPic(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Flash frequency of a flash picture as numeric value
1158
See also
Flash frequencies (Page1536) GetFlashRateFlashPic example (Page1478)
GetIndex Function
Specifies the index of the current position in a polygon or polygon line. Specifies the index of the current field for check boxes and radio boxes.
Syntax
long int GetIndex(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Index of the current point or field
1159
GetBackBorderWidth Function
Specifies the frame width of 3D frames and slider objects.
Syntax
long int GetBackBorderWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value for the frame width of 3D frames and slider objects
See also
GetBorderStyle example (Page1475)
GetBorderEndStyle Function
Specifies the type of line end.
Syntax
long int GetBorderEndStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1160
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Type of line end as numeric value STRUCTURES_TABLES_LINE_ENDS
See also
GetBorderStyle example (Page1475) Line end style (Page1541)
GetBorderStyle Function
Specifies the line or border style.
Syntax
long int GetBorderStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the line or border style STRUCTURES_TABLES_LINE_STYLES
1161
See also
GetBorderStyle example (Page1475) Line styles (Page1541)
GetBorderWidth Function
Specifies the line or border line width.
Syntax
long int GetBorderWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Line or border line width as numeric value
See also
GetBorderStyle example (Page1475)
GetBoxAlignment Function
Specifies the arrangement of controls (left or right justified) in check boxes or radio boxes.
Syntax
long int GetBoxAlignment(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1162
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the arrangement of controls in check boxes or radio boxes STRUCTURES_TABLES_TEXT_ALIGNMENT
See also
GetBorderStyle example (Page1475) Text alignment (Page1543)
GetFillStyle Function
Specifies the type of fill pattern.
Syntax
long int GetFillStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Type of fill pattern as numeric value
1163
See also
Fill pattern (Page1539) GetFillStyle example (Page1476)
GetFillStyle2 Function
Specifies the bar fill pattern for a bar graph.
Syntax
long int GetFillStyle2(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Bar fill pattern as numeric value
See also
Fill pattern (Page1539) GetFillStyle example (Page1476)
1164
GetItemBorderStyle Function
Specifies the dividing line style for the "text list" object.
Syntax
long int GetItemBorderStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Dividing line style for the "text list" object STRUCTURES_TABLES_LINE_STYLES
See also
GetBorderStyle example (Page1475) Line styles (Page1541)
GetItemBorderWidth Function
Specifies the dividing line width for the "text list" object.
Syntax
long int GetItemBorderWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1165
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
Return value
Numeric value defining the dividing line width for the "text list" object
See also
GetBorderStyle example (Page1475)
GetPressed Function
Specifies for round buttons whether the switch setting is "pressed" or "not pressed".
Syntax
BOOL GetPressed(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1166
FALSE
Switch setting is "not pressed"
GetToggle Function
Specifies for round buttons whether the switch is latchable or not.
Syntax
BOOL GetToggle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
Switch is not latchable
GetWindowsStyle Function
Specifies whether buttons are to be displayed in Windows style.
Syntax
BOOL GetWindowsStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
1167
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
FALSE
The apperance of the button is defined by the user.
3.3.4.3 axes
set
SetAlignment Function
When using bar objects, it indicates whether the text is to the right or left of the bar.
1168
Syntax
BOOL SetAlignment(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bAlignment);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bAlignment
Text alignment TRUE Text is to the right of the bar FALSE Text is to the left of the bar
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetAxisSection Function
When using bar objects, it specifies the axis section, i.e. the difference between the values of two neighboring axis labels.
1169
Syntax
BOOL SetAxisSection(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dAxisSection);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dAxisSection
Axis section
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetExponent Function
Sets the axis label display for bar objects (exponential/decimal).
Syntax
BOOL SetExponent(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bExponent);
1170
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bExponent
Axis labeling TRUE Axis label in exponential form FALSE Axis label in decimal form
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetLeftComma Function
When using bar objects, it specifies the number of integers in the axis label.
Syntax
BOOL SetLeftComma(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lLeftComma);
1171
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lLeftComma
Number of integers
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetLongStrokesBold Function
When using bar objects, it specifies whether the main division lines are bold or regular.
Syntax
BOOL SetLongStrokesBold(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bLongStrokesBold);
Parameters lpszPictureName
Picture name
1172
lpszObjectName
Object name
bLongStrokesBold
Main division lines on the bar graph scale TRUE bold FALSE normal
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetLongStrokesOnly Function
When using bar objects, it specifies whether intermediate or only main division lines are used on the scale.
Syntax
BOOL SetLongStrokesOnly(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bLongStrokesOnly);
Parameters lpszPictureName
Picture name
1173
lpszObjectName
Object name
bLongStrokesOnly
Only main division lines yes/no
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetLongStrokesSize Function
When using bar objects, it specifies the length of the main division lines on the bar graph scale.
Syntax
BOOL SetLongStrokesSize(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lLongStrokesSize);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1174
lLongStrokesSize
Length of the main division marks in pixels
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetRightComma Function
When using bar objects, it specifies the number of decimal places in the axis label.
Syntax
BOOL SetRightComma(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRightComma);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lRightComma
Number of decimal places
1175
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetScaleTicks Function
When using bar objects, it specifies the scale marks as number of scale sections. A scale section is a part of the scale bounded by two main tick marks.
Syntax
BOOL SetScaleTicks(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lScaleTicks);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lScaleTicks
Number of scale sections
1176
FALSE
An error has occurred. Note If the number of scale sections is given as 0, the bar object itself calculates a suitable scale unit.
See also
SetScaling example (Page1522)
SetScaling Function
Switches the bar graph scale of bar objects on or off.
Syntax
BOOL SetScaling(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bScaling);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bScaling
Scale on/off.
1177
FALSE
An error has occurred.
See also
SetScaling example (Page1522)
SetScalingType Function
When using bar objects, it specifies the type of bar scaling.
Syntax
BOOL SetScalingType(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lScalingType);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lScalingType
Type of bar scaling as numeric value
FALSE
An error has occurred.
1178
See also
Bar Scaling (Page1535) SetScaling example (Page1522)
SetBackColor Function
Sets the background color of the object.
Syntax
BOOL SetBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBackColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBackColor
Background color of the object as a numeric value
1179
FALSE
An error has occurred. Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBackColor2 Function
Sets the bar color for bar objects.
Syntax
BOOL SetBackColor2(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBackColor2);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBackColor2
Numeric value defining the bar color
1180
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBackColor3 Function
Sets the bar background color for bar objects.
Syntax
BOOL SetBackColor3(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBackColor3);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBackColor3
Numeric value defining the bar background color
1181
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBackColorBottom Function
Sets the background color of the slider objects at the bottom right.
Syntax
BOOL SetBackColorBottom(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBackColorBottom);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBackColorBottom
Numeric value defining the background color of slider objects
1182
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBackColorTop Function
Sets the background color of the slider objects at the top left.
Syntax
BOOL SetBackColorTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBackColorTop);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBackColorTop
Numeric value defining the background color of slider objects
1183
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBorderBackColor Function
Sets the background color of the lines or borders.
Syntax
BOOL SetBorderBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderBackColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderBackColor
Background color of the lines or borders
1184
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBorderColor Function
Sets the color of the lines or borders.
Syntax
BOOL SetBorderColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderColor
Numeric value defining the color of lines or borders
1185
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBorderColorBottom Function
Sets the 3D border color at the bottom.
Syntax
BOOL SetBorderColorBottom(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderColorBottom);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderColorBottom
Numeric value defining the 3-D border color at the bottom
1186
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBorderColorTop Function
Sets the 3D border color at the top.
Syntax
BOOL SetBorderColorTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderColorTop);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderColorTop
Numeric value defining the 3-D border color at the top
1187
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetButtonColor Function
Sets the button color of slider objects.
Syntax
BOOL SetButtonColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lButtonColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lButtonColor
Numeric value defining the button color of slider objects
1188
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorBottom Function
When using slider objects, it sets the color of the bottom limit.
Syntax
BOOL SetColorBottom(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorBottom);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorBottom
Numeric value defining the color of the bottom limit of slider objects
1189
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorTop Function
When using slider objects, it sets the color of the top limit.
Syntax
BOOL SetColorTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorTop);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorTop
Numeric value defining the color of the top limit of slider objects
1190
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetFillColor Function
Sets the color of the fill pattern.
Syntax
BOOL SetFillColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFillColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFillColor
Numeric value of the fill color
1191
FALSE
An error has occurred. Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetForeColor Function
Sets the font color.
Syntax
BOOL SetForeColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lForeColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lForeColor
Numeric value defining the font color
1192
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetItemBorderBackColor Function
Sets the background color of the separating line for the "text list" object.
Syntax
BOOL SetItemBorderBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lItemBorderBackColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lItemBorderBackColor
Background color of the dividing line as a numeric value
1193
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetItemBorderColor Function
Sets the color of the dividing line for the "text list" object.
Syntax
BOOL SetItemBorderColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lItemBorderColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lItemBorderColor
Numeric value defining the dividing line color
1194
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetScaleColor Function
Sets the scale color for bar objects.
Syntax
BOOL SetScaleColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lScaleColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lScaleColor
Numeric value of the scale color for bar objects
1195
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetSelBGColor Function
Sets the background color of the selected entry for the "text list" object.
Syntax
BOOL SetSelBGColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lSelBGColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lSelBGColor
Numeric value defining the background color in the selected entry
1196
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetSelTextColor Function
Sets the font color of a selected entry for the "text list" object.
Syntax
BOOL SetSelTextColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lSelTextColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lSelTextColor
Numeric value defining the font color in the selected entry
1197
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetTrendColor Function
Sets the trend color for bar objects.
Syntax
BOOL SetTrendColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lTrendColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lTrendColor
Numeric value defining the trend color
1198
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetUnselBGColor Function
Sets the background color of non-selected entries for the "text list" object.
Syntax
BOOL SetUnselBGColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lUnselBGColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lUnselBGColor
Numeric value defining the background color for non-selected entries
1199
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetUnselTextColor Function
Sets the font color of non-selected entries for the "text list" object.
Syntax
BOOL SetUnselTextColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lUnselTextColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lUnselTextColor
Numeric value defining the font color for non-selected entries
1200
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetFilling Function
Activates or deactivates dynamic filling with background color.
Syntax
BOOL SetFilling(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFilling);
Parameters lpszPictureName
Picture name
1201
lpszObjectName
Object name
bFilling
Dynamic filling with background color on/off
FALSE
An error has occurred.
See also
SetFilling example (Page1514)
SetFillingIndex Function
Sets the fill level.
Syntax
BOOL SetFillingIndex(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFillingIndex);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1202
lFillingIndex
Fill level as a numeric value (0 - 100)
FALSE
An error has occurred.
See also
SetFillingIndex example (Page1514)
SetBackFlashColorOff Function
Sets the background flash color for the deactivated status.
Syntax
BOOL SetBackFlashColorOff(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBackFlashColorOff);
1203
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBackFlashColorOff
Background flash color for the deactivated status as a numeric value
FALSE
An error has occurred.
See also
Color chart (Page1538) SetFlashBackColorOn example (Page1515)
SetBackFlashColorOn Function
Sets the background flash color for the activated status.
Syntax
BOOL SetBackFlashColorOn(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBackFlashColorOn);
1204
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBackFlashColorOn
Background flash color for the activated status as a numeric value
FALSE
An error has occurred.
See also
Color chart (Page1538) SetFlashBackColorOn example (Page1515)
SetBorderFlashColorOff Function
Sets the border or line flashing color for the deactivated status.
Syntax
BOOL SetBorderFlashColorOff(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderFlashColorOff);
1205
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderFlashColorOff
Border or line flashing color for the deactivated status as a numeric value
FALSE
An error has occurred.
See also
SetFlashBackColorOn example (Page1515) Color chart (Page1538)
SetBorderFlashColorOn Function
Sets the border or line flashing color for the activated status.
Syntax
BOOL SetBorderFlashColorOn(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderFlashColorOn);
1206
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderFlashColorOn
Border or line flashing color for the activated status as a numeric value
FALSE
An error has occurred.
See also
Color chart (Page1538) SetFlashBackColorOn example (Page1515)
SetFlashBackColor Function
Activates or deactivates background flashing.
Syntax
BOOL SetFlashBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFlashBackColor);
1207
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bFlashBackColor
Flashing background on/off
FALSE
An error has occurred.
See also
SetFlashBackColor example (Page1515)
SetFlashBorderColor Function
Activates or deactivates flashing of the border or line.
Syntax
BOOL SetFlashBorderColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFlashBorderColor);
Parameters lpszPictureName
Picture name
1208
lpszObjectName
Object name
bFlashBorderColor
Flashing of the border or line on/off
FALSE
An error has occurred.
See also
SetFlashBackColor example (Page1515)
SetFlashForeColor Function
Activates or deactivates font flashing.
Syntax
BOOL SetFlashForeColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFlashForeColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1209
bFlashForeColor
Flashing of the font on/off
FALSE
An error has occurred.
See also
SetFlashBackColor example (Page1515)
SetFlashRateBackColor Function
Sets the flash frequency of the background.
Syntax
BOOL SetFlashRateBackColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFlashRateBackColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFlashRateBackColor
Flash frequency of the background
1210
FALSE
An error has occurred.
See also
Flash frequencies (Page1536) SetFlashBackColor example (Page1515)
SetFlashRateBorderColor Function
Sets the flash frequency of the line or border.
Syntax
BOOL SetFlashRateBorderColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFlashRateBorderColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFlashRateBorderColor
Flash frequency of the line or border
1211
FALSE
An error has occurred.
See also
Flash frequencies (Page1536) SetFlashBackColor example (Page1515)
SetFlashRateForeColor Function
Sets the flash frequency of the font.
Syntax
BOOL SetFlashRateForeColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFlashRateForeColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFlashRateForeColor
Flash frequency of the font
1212
FALSE
An error has occurred.
See also
Flash frequencies (Page1536) SetFlashBackColor example (Page1515)
SetForeFlashColorOff Function
Sets the font flash color for the deactivated status.
Syntax
BOOL SetForeFlashColorOff(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lForeFlashColorOff);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lForeFlashColorOff
Font flash color for the deactivated status as a numeric value
1213
FALSE
An error has occurred.
See also
Color chart (Page1538) SetFlashBackColorOn example (Page1515)
SetForeFlashColorOn Function
Sets the font flash color for the activated status.
Syntax
BOOL SetForeFlashColorOn(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lForeFlashColorOn);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lForeFlashColorOn
Font flash color for the activated status as a numeric value
1214
FALSE
An error has occurred.
See also
Color chart (Page1538) SetFlashBackColorOn example (Page1515)
Set_Focus Function
Sets the focus on the specified object.
Syntax
BOOL Set_Focus(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName);
Parameters lpszPictureName
Picture name
1215
lpszObjectName
Object name
FALSE
An error has occurred.
See also
SetFocus example (Page1516)
SetAlignmentLeft Function
Sets the horizontal text alignment (left, centered, right).
Syntax
BOOL SetAlignmentLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lAlignmentLeft);
1216
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lAlignmentLeft
Horizontal text alignment as a numeric value
FALSE
An error has occurred.
See also
Text alignment (Page1543) SetFontSize example (Page1516)
SetAlignmentTop Function
Sets the vertical text alignment (top, centered, bottom).
Syntax
BOOL SetAlignmentTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lAlignmentTop);
1217
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lAlignmentTop
Vertical text alignment as a numeric value
FALSE
An error has occurred.
See also
Text alignment (Page1543) SetFontSize example (Page1516)
SetFontBold Function
Switches the bold font on or off.
Syntax
BOOL SetFontBold(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFontBold);
1218
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bFontBold
Bold font on/off
FALSE
An error has occurred.
See also
SetFontBold example (Page1516)
SetFontItalic Function
Switches the italic font on or off.
Syntax
BOOL SetFontItalic(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFontItalic);
Parameters lpszPictureName
Picture name
1219
lpszObjectName
Object name
bFontItalic
Italic font on/off
FALSE
An error has occurred.
See also
SetFontBold example (Page1516)
SetFontName Function
Sets a font.
Syntax
BOOL SetFontName(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, char* szFontName);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1220
szFontName
Pointer to name of font
FALSE
An error has occurred.
See also
SetText example (Page1529)
SetFontSize Function
Sets the font size.
Syntax
BOOL SetFontSize(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFontSize);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFontSize
Font Size
1221
FALSE
An error has occurred.
See also
SetFontSize example (Page1516)
SetFontUnderline Function
Switches the underlined font on or off.
Syntax
BOOL SetFontUnderline(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFontUnderline);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bFontUnderline
Underlined font on/off
1222
FALSE
An error has occurred.
See also
SetFontBold example (Page1516)
SetOrientation Function
Defines the text orientation (vertical/horizontal).
Syntax
BOOL SetOrientation(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bOrientation);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bOrientation
Text orientation TRUE vertical FALSE Horizontal
FALSE
An error has occurred.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1223
See also
SetFontBold example (Page1516)
SetText Function
Sets the value of the "text" property for objects like static text, check box or radio box.
Syntax
BOOL SetText(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, char* szText);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
szText
Pointer to a text
FALSE
An error has occurred. Note In case of check and radio boxes the element to be changed must be defined with the SetIndex function before actually activating this function.
1224
See also
SetText example (Page1529)
SetActualPointLeft Function
Sets the X value for the current point of a polygon or polygon line.
Syntax
BOOL SetActualPointLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lActualPointLeft);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lActualPointLeft
X value for the current point of a polygon or polygon line
1225
FALSE
An error has occurred. Note The current point of the polygon can be set using the SetIndex function.
See also
SetLeft example (Page1517)
SetActualPointTop Function
Sets the Y value for the current point of a polygon or polygon line.
Syntax
BOOL SetActualPointTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lActualPointTop);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lActualPointTop
Y value for the current point of a polygon or polygon line
1226
FALSE
An error has occurred. Note The current point of the polygon can be set using the SetIndex function.
See also
SetTop example (Page1529)
SetBoxCount Function
Sets the number of fields in a check box or radio box.
Syntax
BOOL SetBoxCount(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBoxCount);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBoxCount
Number of fields in a check box or radio box.
1227
FALSE
An error has occurred.
SetDirection Function
Sets the bar direction for bar objects.
Syntax
BOOL SetDirection(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lDirection);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lDirection
Numeric value defining the bar direction
FALSE
An error has occurred.
1228
See also
Bar direction (Page1535) SetTop example (Page1529)
SetEndAngle Function
Sets the end angle of circle and ellipse segments and circle and elliptical arcs.
Syntax
BOOL SetEndAngle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lEndAngle);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lEndAngle
End angle of circle and ellipse segments as well as circle and ellipse arcs
FALSE
An error has occurred.
See also
SetTop example (Page1529)
1229
SetHeight Function
Sets the height of the rectangle framing an object.
Syntax
BOOL SetHeight(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lHeight);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lHeight
Height of the framing rectangle
FALSE
An error has occurred. Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
SetHeight example (Page1516)
1230
SetLeft Function
Sets the X value of the upper left corner of the rectangle framing an object
Syntax
BOOL SetLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lLeft);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lLeft
X value of the upper left corner of the framing rectangle
FALSE
An error has occurred.
See also
SetLeft example (Page1517)
SetPointCount Function
Sets the number of corners of a polygon or in a polygon line.
1231
Syntax
BOOL SetPointCount(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lPointCount);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lPointCount
Number of corner points
FALSE
An error has occurred.
See also
SetLeft example (Page1517)
SetRadius Function
Sets the radius of a circle, circle segment or arc.
Syntax
BOOL SetRadius(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRadius);
1232
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lRadius
Radius
FALSE
An error has occurred.
See also
SetHeight example (Page1516)
SetRadiusHeight Function
Sets the radius of an ellipse, ellipse segment or elliptical arc in vertical direction.
Syntax
BOOL SetRadiusHeight(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRadiusHeight);
Parameters lpszPictureName
Picture name
1233
lpszObjectName
Object name
lRadiusHeight
Radius in vertical direction
FALSE
An error has occurred.
See also
SetHeight example (Page1516)
SetRadiusWidth Function
Sets the radius of an ellipse, ellipse segment or elliptical arc in horizontal direction.
Syntax
BOOL SetRadiusWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRadiusWidth);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1234
lRadiusWidth
Radius in horizontal direction
FALSE
An error has occurred.
See also
SetWidth example (Page1530)
SetReferenceRotationLeft Function
Sets the X value of the rotation reference (central axis about which the object can be rotated) for lines, polygons and polylines.
Syntax
BOOL SetReferenceRotationLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lReferenceRotationLeft);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lReferenceRotationLeft
X value of the rotation reference
1235
FALSE
An error has occurred.
See also
SetLeft example (Page1517)
SetReferenceRotationTop Function
Sets the Y value of the rotation reference (central axis about which the object can be rotated) for lines, polygons and polylines.
Syntax
BOOL SetReferenceRotationTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lReferenceRotationTop);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lReferenceRotationTop
Y value of the rotation reference
1236
FALSE
An error has occurred.
See also
SetTop example (Page1529)
SetRotationAngle Function
Sets the angle of rotation about the central axis for lines, polygons and polylines.
Syntax
BOOL SetRotationAngle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRotationAngle);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lRotationAngle
Angle of rotation
FALSE
An error has occurred.
1237
See also
SetLeft example (Page1517)
SetRoundCornerHeight Function
Specifies the radius of the rounded corner of a rectangle vertically.
Syntax
BOOL SetRoundCornerHeight(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRoundCornerHeight);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lRoundCornerHeight
Vertical radius
FALSE
An error has occurred.
See also
SetHeight example (Page1516)
1238
SetRoundCornerWidth Function
Specifies the radius of the rounded corner of a rectangle horizontally.
Syntax
BOOL SetRoundCornerWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRoundCornerWidth);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lRoundCornerWidth
Horizontal radius
FALSE
An error has occurred.
See also
SetWidth example (Page1530)
SetStartAngle Function
Sets the start angle of circle and ellipse segments and circle and elliptical arcs.
1239
Syntax
BOOL SetStartAngle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lStartAngle);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lStartAngle
Starting angle
FALSE
An error has occurred.
See also
SetHeight example (Page1516)
SetTop Function
Sets the Y value of the upper left corner of the rectangle framing an object.
Syntax
BOOL SetTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lTop);
1240
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lTop
Y value of the upper left corner of the framing rectangle
FALSE
An error has occurred.
See also
SetTop example (Page1529)
SetWidth Function
Sets the width of the rectangle framing an object.
Syntax
BOOL SetWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lWidth);
Parameters lpszPictureName
Picture name
1241
lpszObjectName
Object name
lWidth
Width of the framing rectangle
FALSE
An error has occurred. Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
SetWidth example (Page1530)
SetZeroPoint Function
Sets the zero point for bar objects.
Syntax
BOOL SetZeroPoint(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lZeroPoint);
Parameters lpszPictureName
Picture name
1242
lpszObjectName
Object name
lZeroPoint
Zero point
FALSE
An error has occurred.
See also
SetTop example (Page1529)
SetAssumeOnExit Function
Specifies for I/O fields whether the entered value is assumed upon exiting the field.
Syntax
BOOL SetAssumeOnExit(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bAssumeOnExit);
1243
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bAssumeOnExit
Value application upon exiting the field yes/no
FALSE
An error has occurred.
See also
SetHiddenInput example (Page1517)
SetAssumeOnFull Function
Specifies for I/O fields whether the entered value is assumed on completion of input.
Syntax
BOOL SetAssumeOnFull(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bAssumeOnFull);
Parameters lpszPictureName
Picture name
1244
lpszObjectName
Object name
bAssumeOnFull
Value application on completion of input yes/no
FALSE
An error has occurred.
See also
SetHiddenInput example (Page1517)
SetBitNumber Function
Sets the relevant bit in the output value for the "bit" list type.
Syntax
BOOL SetBitNumber(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBitNumber);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1245
lBitNumber
Relevant bit in the output value for the "bit" list type
FALSE
An error has occurred.
See also
List types (Page1541)
SetClearOnError Function
Specifies for I/O fields whether deletion of the content in case of input errors is activated.
Syntax
BOOL SetClearOnError(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bClearOnError);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bClearOnError
Deletion of the entry in case of input errors yes/no
1246
FALSE
An error has occurred.
See also
SetHiddenInput example (Page1517)
SetClearOnNew Function
Specifies the deletion of the content in case of new inputs for I/O fields.
Syntax
BOOL SetClearOnNew(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bClearOnNew);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bClearOnNew
Deletion of content in case of new input yes/no
1247
FALSE
An error has occurred.
See also
SetHiddenInput example (Page1517)
SetHiddenInput Function
Controls the hidden input for I/O fields.
Syntax
BOOL SetHiddenInput(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bHiddenInput);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bHiddenInput
Hidden input yes/no
FALSE
An error has occurred.
1248
See also
SetHiddenInput example (Page1517)
SetNumberLines Function
Sets the number of visible lines lines for the "text list" object.
Syntax
BOOL SetNumberLines(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lNumberLines);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lNumberLines
Number of visible lines
FALSE
An error has occurred. Note If the amount of configured text is larger than the number of visible lines, the "text list" object receives a vertical scroll bar.
1249
SetOutputValueChar Function
Sets a pointer to the output value for I/O fields
Syntax
BOOL SetOutputValueChar(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, char* szOutputValueChar);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
szOutputValueChar
Pointer to the output value
FALSE
An error has occurred.
SetOutputValueDouble Function
Sets the output value for I/O fields.
Syntax
BOOL SetOutputValueDouble(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dOutputValueDouble);
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1250
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dOutputValueDouble
Output value
FALSE
An error has occurred.
See also
SetOutputValueDouble example (Page1519)
1251
SetAlarmHigh Function
Sets the upper alarm limit for bar objects.
Syntax
BOOL SetAlarmHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dAlarmHigh);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dAlarmHigh
Upper alarm limit
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
SetAlarmLow Function
Sets the lower alarm limit for bar objects.
1252
Syntax
BOOL SetAlarmLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dAlarmLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dAlarmLow
Lower alarm limit
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
SetCheckAlarmHigh Function
Controls the monitoring of the upper alarm limit for bar objects.
Syntax
BOOL SetCheckAlarmHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckAlarmHigh);
1253
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCheckAlarmHigh
Monitoring yes/no
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetCheckAlarmLow Function
Controls the monitoring of the lower alarm limit for bar objects.
Syntax
BOOL SetCheckAlarmLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckAlarmLow);
Parameters lpszPictureName
Picture name
1254
lpszObjectName
Object name
bCheckAlarmLow
Monitoring yes/no
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetCheckLimitHigh4 Function
Controls the monitoring of the upper limit value reserve 4 for bar objects.
Syntax
BOOL SetCheckLimitHigh4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckLimitHigh4);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1255
bCheckLimitHigh4
Monitoring yes/no
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetCheckLimitHigh5 Function
Controls the monitoring of the upper limit value reserve 5 for bar objects.
Syntax
BOOL SetCheckLimitHigh5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckLimitHigh5);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCheckLimitHigh5
Monitoring yes/no
1256
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetCheckLimitLow4 Function
Controls the monitoring of the lower limit value reserve 4 for bar objects.
Syntax
BOOL SetCheckLimitLow4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckLimitLow4);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCheckLimitLow4
Monitoring yes/no.
1257
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetCheckLimitLow5 Function
Controls the monitoring of the lower limit value reserve 5 for bar objects.
Syntax
BOOL SetCheckLimitLow5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckLimitLow5);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCheckLimitLow5
Monitoring yes/no
FALSE
An error has occurred.
1258
See also
SetMarker example (Page1518)
SetCheckToleranceHigh Function
Controls the monitoring of the upper tolerance limit for bar objects.
Syntax
BOOL SetCheckToleranceHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckToleranceHigh);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCheckToleranceHigh
Monitoring yes/no
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
1259
SetCheckToleranceLow Function
Controls the monitoring of the lower tolerance limit for bar objects.
Syntax
BOOL SetCheckToleranceLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckToleranceLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCheckToleranceLow
Monitoring yes/no
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetCheckWarningHigh Function
Controls the monitoring of the upper warning limit for bar objects.
1260
Syntax
BOOL SetCheckWarningHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckWarningHigh);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCheckWarningHigh
Monitoring yes/no
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetCheckWarningLow Function
Controls the monitoring of the lower warning limit for bar objects.
Syntax
BOOL SetCheckWarningLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCheckWarningLow);
1261
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCheckWarningLow
Monitoring yes/no
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetColorAlarmHigh Function
Sets the bar color for bar objects upon reaching the upper alarm limit.
Syntax
BOOL SetColorAlarmHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorAlarmHigh);
Parameters lpszPictureName
Picture name
1262
lpszObjectName
Object name
lColorAlarmHigh
Numeric value defining the bar color
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorAlarmLow Function
Sets the bar color for bar objects upon reaching the lower alarm limit.
Syntax
BOOL SetColorAlarmLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorAlarmLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1263
lColorAlarmLow
Numeric value defining the bar color
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorLimitHigh4 Function
Sets the bar color for bar objects upon reaching the upper limit reserve 4.
Syntax
BOOL SetColorLimitHigh4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorLimitHigh4);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorLimitHigh4
Numeric value defining the bar color
1264
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorLimitHigh5 Function
Sets the bar color for bar objects upon reaching the upper limit reserve 5.
Syntax
BOOL SetColorLimitHigh5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorLimitHigh5);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorLimitHigh5
Numeric value defining the bar color
1265
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorLimitLow4 Function
Sets the bar color for bar objects upon reaching the lower limit reserve 4.
Syntax
BOOL SetColorLimitLow4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorLimitLow4);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorLimitLow4
Numeric value defining the bar color
1266
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorLimitLow5 Function
Sets the bar color for bar objects upon reaching the lower limit reserve 5.
Syntax
BOOL SetColorLimitLow5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorLimitLow5);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorLimitLow5
Numeric value defining the bar color
1267
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorToleranceHigh Function
Sets the bar color for bar objects upon reaching the upper tolerance limit.
Syntax
BOOL SetColorToleranceHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorToleranceHigh);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorToleranceHigh
Numeric value defining the bar color
1268
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorToleranceLow Function
Sets the bar color for bar objects upon reaching the lower tolerance limit.
Syntax
BOOL SetColorToleranceLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorToleranceLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorToleranceLow
Numeric value defining the bar color
1269
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorWarningHigh Function
Sets the bar color for bar objects upon reaching the upper warning limit.
Syntax
BOOL SetColorWarningHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorWarningHigh);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorWarningHigh
Numeric value defining the bar color
1270
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetColorWarningLow Function
Sets the bar color for bar objects upon reaching the lower warning limit.
Syntax
BOOL SetColorWarningLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lColorWarningLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lColorWarningLow
Numeric value defining the bar color
1271
FALSE
An error has occurred.
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetLimitHigh4 Function
Sets the high limit value for reserve 4 for bar objects.
Syntax
BOOL SetLimitHigh4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dLimitHigh4);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dLimitHigh4
High limit value for reserve 4
1272
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
SetLimitHigh5 Function
Sets the high limit value for reserve 5 for bar objects.
Syntax
BOOL SetLimitHigh5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dLimitHigh5);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dLimitHigh5
High limit value for reserve 5
1273
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
SetLimitLow4 Function
Sets the low limit value for reserve 4 for bar objects.
Syntax
BOOL SetLimitLow4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dLimitLow4);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dLimitLow4
Low limit value for reserve 4
FALSE
An error has occurred.
1274
See also
SetAlarmHigh example (Page1511)
SetLimitLow5 Function
Sets the low limit value for reserve 5 for bar objects.
Syntax
BOOL SetLimitLow5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dLimitLow5);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dLimitLow5
Low limit value for reserve 5
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
1275
SetLimitMax Function
Sets the high limit value for I/O fields.
Syntax
BOOL SetLimitMax(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dLimitMax);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dLimitMax
High limit value
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
SetLimitMin Function
Sets the low limit value for I/O fields.
1276
Syntax
BOOL SetLimitMin(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dLimitMin);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dLimitMin
Lower limit
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
SetMarker Function
Controls the limit marker display for bar objects.
Syntax
BOOL SetMarker(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bMarker);
1277
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bMarker
Limit marker on/off
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetToleranceHigh Function
Sets the upper tolerance limit for bar objects.
Syntax
BOOL SetToleranceHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dToleranceHigh);
Parameters lpszPictureName
Picture name
1278
lpszObjectName
Object name
dToleranceHigh
Upper tolerance limit
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
SetToleranceLow Function
Sets the lower tolerance limit for bar objects.
Syntax
BOOL SetToleranceLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dToleranceLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1279
dToleranceLow
Lower tolerance limit
FALSE
An error has occurred.
See also
SetAlarmHigh example (Page1511)
SetTypeAlarmHigh Function
Specifies for bar objects whether the upper alarm limit is given in percentages or absolute terms.
Syntax
BOOL SetTypeAlarmHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeAlarmHigh);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeAlarmHigh
Upper alarm limit
1280
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeAlarmLow Function
Specifies for bar objects whether the lower alarm limit is given in percentages or absolute terms.
Syntax
BOOL SetTypeAlarmLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeAlarmLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeAlarmLow
Lower alarm limit TRUE Specification in percent FALSE Absolute specification
1281
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeLimitHigh4 Function
Specifies for bar objects whether the upper limit for reserve 4 is given in percentages or absolute terms.
Syntax
BOOL SetTypeLimitHigh4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeLimitHigh4);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeLimitHigh4
High limit TRUE Specification in percent FALSE Absolute specification
1282
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeLimitHigh5 Function
Specifies for bar objects whether the upper limit for reserve 5 is given in percentages or absolute terms.
Syntax
BOOL SetTypeLimitHigh5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeLimitHigh5);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeLimitHigh5
High limit TRUE Specification in percent FALSE Absolute specification
1283
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeLimitLow4 Function
Specifies for bar objects whether the lower limit for reserve 4 is given in percentages or absolute terms.
Syntax
BOOL SetTypeLimitLow4(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeLimitLow4);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeLimitLow4
Low limit TRUE Specification in percent FALSE Absolute specification
1284
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeLimitLow5 Function
Specifies for bar objects whether the lower limit for reserve 5 is given in percentages or absolute terms.
Syntax
BOOL SetTypeLimitLow5(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeLimitLow5);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeLimitLow5
Low limit TRUE Specification in percent FALSE Absolute specification
1285
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeToleranceHigh Function
Specifies for bar objects whether the high tolerance limit is given in percentages or absolute terms.
Syntax
BOOL SetTypeToleranceHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeToleranceHigh);
Parameter lpszPictureName
Picture name
lpszObjectName
Object name
bTypeToleranceHigh
High tolerance limit TRUE Specification in percent FALSE Absolute specification
1286
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeToleranceLow Function
Specifies for bar objects whether the lower tolerance limit is given in percentages or absolute terms.
Syntax
BOOL SetTypeToleranceLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeToleranceLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeToleranceLow
Lower tolerance limit TRUE Specification in percent FALSE Absolute specification
1287
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeWarningHigh Function
Specifies for bar objects whether the upper warning limit is given in percentages or absolute terms.
Syntax
BOOL SetTypeWarningHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeWarningHigh);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeWarningHigh
Upper warning limit TRUE Specification in percent FALSE Absolute specification
1288
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetTypeWarningLow Function
Specifies for bar objects whether the lower warning limit is given in percentages or absolute terms.
Syntax
BOOL SetTypeWarningLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTypeWarningLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bTypeWarningLow
Lower warning limit TRUE Specification in percent FALSE Absolute specification
1289
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetWarningHigh Function
Sets the upper warning limit for bar objects.
Syntax
BOOL SetWarningHigh(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dWarningHigh);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dWarningHigh
Upper warning limit
1290
FALSE
An error has occurred.
See also
SetMarker example (Page1518)
SetWarningLow Function
Sets the lower warning limit for bar objects.
Syntax
BOOL SetWarningLow(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dWarningLow);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dWarningLow
Lower warning limit
FALSE
An error has occurred.
1291
See also
SetMarker example (Page1518)
SetLink Function
Creating a tag connection of object properties
Syntax
BOOL SetLink(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName, LPLINKINFO *pLink);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
pLink
Pointer to a structure of the type: LINKINFO
1292
FALSE
An error has occurred.
See also
Structure definition LINKINFO (Page1551) SetLink example (Page1518)
SetAverage Function
Controls the averaging of bar objects.
Syntax
BOOL SetAverage(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bAverage);
Parameters lpszPictureName
Picture name
1293
lpszObjectName
Object name
bAverage
Averaging yes/no
FALSE
An error has occurred.
See also
SetVisible example (Page1530)
SetBoxType Function
Specifies the field type (input field, output field, input/output field) for an I/O object.
Syntax
BOOL SetBoxType(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBoxType);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1294
lBoxType
Field type
FALSE
An error has occurred.
See also
I/O field, field type (Page1537)
SetColorChangeType Function
When using bar objects, it defines whether the color change upon reaching a limit value only affects a bar segment or the entire bar.
Syntax
BOOL SetColorChangeType(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bColorChangeType);
Parameter lpszPictureName
Picture name
lpszObjectName
Object name
bColorChangeType
Type of color change
1295
FALSE
An error has occurred.
See also
SetVisible example (Page1530)
SetCursorControl Function
Sets the cursor control for I/O fields.
Syntax
BOOL SetCursorControl(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCursorControl);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCursorControl
Cursor control on/off
1296
FALSE
An error has occurred.
See also
SetVisible example (Page1530)
SetCursorMode Function
Sets the cursor control for pictures.
Syntax
BOOL SetCursorMode(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bCursorMode);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bCursorMode
Cursor Mode TRUE Tab order FALSE Alpha-Cursor
1297
FALSE
An error has occurred.
See also
Example - SetCursorMode (Page1513)
SetEditAtOnce Function
Specifies whether the "Immediate input" property is activated for I/O fields.
Syntax
BOOL SetEditAtOnce(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bEditAtOnce);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bEditAtOnce
Immediate input yes/no
1298
FALSE
An error has occurred.
See also
SetVisible example (Page1530)
SetExtendedOperation Function
Controls the "Extended operation" property of slider objects.
Syntax
BOOL SetExtendedOperation(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bExtendedOperation);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bExtendedOperation
Extended operation yes/no
FALSE
An error has occurred.
1299
See also
SetVisible example (Page1530)
SetHysteresis Function
When using bar objects, it specifies whether the display appears with or without hysteresis.
Syntax
BOOL SetHysteresis(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bHysteresis);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bHysteresis
Display with/without hysteresis
FALSE
An error has occurred.
See also
SetVisible example (Page1530)
1300
SetHysteresisRange Function
Sets the hysteresis value in the display for bar objects.
Syntax
BOOL SetHysteresisRange(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dHysteresisRange);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dHysteresisRange
Hysteresis value
FALSE
An error has occurred.
SetMax Function
Sets the maximum value for bar and slider objects.
Syntax
BOOL SetMax(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dMax);
1301
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dMax
Maximum value
FALSE
An error has occurred.
SetMin Function
Sets the minimum value for bar and slider objects.
Syntax
BOOL SetMin(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dMin);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1302
dMin
Minimum value
FALSE
An error has occurred.
SetOffsetLeft Function
Sets the horizontal picture distance from the left window border for picture windows.
Syntax
BOOL SetOffsetLeft(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lOffsetLeft);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lOffsetLeft
Picture distance
1303
FALSE
An error has occurred.
SetOffsetTop Function
Sets the vertical picture distance from the upper window border for picture windows.
Syntax
BOOL SetOffsetTop(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lOffsetTop);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lOffsetTop
Picture distance
FALSE
An error has occurred.
SetOperation Function
Controls the operability of the objects.
1304
Syntax
BOOL SetOperation(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bOperation);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bOperation
Object operable, yes/no
FALSE
An error has occurred. Note If the function is called for the picture object, set the parameter lpszObjectName = NULL.
See also
SetVisible example (Page1530)
SetOperationMessage Function
Controls the output of a message when operating the objects "I/O field", "Check box", "Radio box" and "Slider".
1305
Syntax
BOOL SetOperationMessage(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bOperationMessage);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bOperationMessage
Message output for yes/no operation
FALSE
An error has occurred.
See also
SetVisible example (Page1530)
SetOperationReport Function
Controls the logging of the operating reason for all objects except application and picture windows and OLE control.
Syntax
BOOL SetOperationReport(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bOperationReport);
1306
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bOperationReport
Logging operating reason yes/no
FALSE
An error has occurred. Note If the function is called for the picture object, set the parameter lpszObjectName = NULL.
See also
SetVisible example (Page1530)
SetPasswordLevel Function
Defines the authorization level for operating objects for all objects except application and picture windows and OLE control.
Syntax
BOOL SetPasswordLevel(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lPasswordLevel);
1307
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lPasswordLevel
Authorization level
FALSE
An error has occurred. Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
SetPictureName Function
Sets the name of the picture, which should be shown in a picture window or in a graphic object.
Syntax
BOOL SetPictureName(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, char* szPictureName);
1308
Parameters lpszPictureName
Picture name
lpszObjectName
Name of the picture window or graphic object
szPictureName
Pointer to the picture name
FALSE
An error has occurred.
See also
SetPictureName example (Page1519)
SetProcess Function
Specifies the default setting of the value to be displayed for bar and slider objects. Sets the selected fields for check boxes and radio boxes.
Syntax
BOOL SetProcess(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dProcess);
1309
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dProcess
In case of bar and slider objects, this value is used in Runtime when the associated tag cannot be connected or updated when a picture is started. For check boxes and radio boxes the selected fields are specified. In the 32-bit word each field is represented by a bit (field 1 corrsponds to the bit value 0). Selected fields are marked by a set bit. Non-existing are assigned 0.
FALSE
An error has occurred.
SetSmallChange Function
Sets the number of steps for slider objects by which the slider is shifted by a mouse click.
Syntax
BOOL SetSmallChange(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lSmallChange);
Parameters lpszPictureName
Picture name
1310
lpszObjectName
Object name
lSmallChange
Number of setting steps
FALSE
An error has occurred.
SetTagPrefix Function
This function sets the tag prefix of a picture window: In a picture window the "temperature" tag is requested on an object. If a "Motor1." tag prefix is assigned to the picture window, the tag "Motor1.Temperature" is requested. The setting of the tag prefix only becomes effective when newly supplying the picture name. This means you must either set the prefix before picture selection or newly supply the picture name if the picture is not changed.
Syntax
BOOL SetTagPrefix(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName,char* szTagPrefix);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1311
szTagPrefix
Tag prefix to be set
FALSE
An error has occurred. Note If the tag prefix is set for a picture window, the tag prefix is added to all tags contained in the picture to be displayed. This also applies if the request takes place in a function. If a tag needs to be read without the tag prefix, you must add "@NOTP::" to the tag name. Using a tag prefix greatly simplifies the picture module technology.
See also
SetTagPrefix example (Page1526)
SetTrend Function
Controls the trend display for bar objects.
Syntax
BOOL SetTrend(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bTrend);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
1312
bTrend
Trend display yes/no
FALSE
An error has occurred.
See also
SetVisible example (Page1530)
SetVisible Function
Controls the display of an object.
Syntax
BOOL SetVisible(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bVisible);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bVisible
Object display yes/no
1313
FALSE
An error has occurred. Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = NULL.
See also
SetVisible example (Page1530)
SetZeroPointValue Function
Sets the absolute value of the zero point for bar objects.
Syntax
BOOL SetZeroPointValue(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, double dZeroPointValue);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
dZeroPointValue
Absolute value of the zero point
1314
FALSE
An error has occurred.
SetZoom Function
Sets the scaling factor for a picture window.
Syntax
BOOL SetZoom(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lZoom);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lZoom
Scaling factor
FALSE
An error has occurred.
1315
SetPosition Function
Sets the slider position of the OCX slider object.
Syntax
BOOL SetPosition(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lPosition);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lPosition
Slider position of the OCX slider object
1316
FALSE
An error has occurred.
See also
SetPosition example (Page1520)
SetRangeMax Function
Defines the adjustment range "Max" of the OCX slider object.
Syntax
BOOL SetRangeMax(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRangeMax);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lRangeMax
Adjustment range "Max" of the OCX slider object
FALSE
An error has occurred.
1317
See also
SetRangeMax example (Page1521)
SetRangeMin Function
Defines the adjustment range "Min" of the OCX slider object.
Syntax
BOOL SetRangeMin(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lRangeMin);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lRangeMin
Adjustment range "Min" of the OCX slider object
FALSE
An error has occurred.
See also
SetRangeMin example (Page1521)
1318
SetPicDeactTransparent Function
Sets the transparent color for the "deactivated" status of a round button.
Syntax
BOOL SetPicDeactTransparent(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lPicDeactTransparent);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lPicDeactTransparent
Transparent color for "deactivated" status
1319
FALSE
An error has occurred. Note This function only applies to Bitmap graphics (*.bmp).
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetPicDeactUseTransColor Function
Controls the transparent color for the "deactivated" status of a round button.
Syntax
BOOL SetPicDeactUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bPicDeactUseTransColor);
Parameter lpszPictureName
Picture name
lpszObjectName
Object name
bPicDeactUseTransColor
Transparent color yes/no
1320
FALSE
An error has occurred.
SetPicDownTransparent Function
Sets the transparent color for the "On/pressed" status of a round button.
Syntax
BOOL SetPicDownTransparent(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lPicDownTransparent);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lPicDownTransparent
Transparent color for "On/pressed" status
FALSE
An error has occurred. Note This function only applies to Bitmap graphics (*.bmp).
1321
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetPicDownUseTransColor Function
Controls the transparent color for the "On/pressed" status of a round button.
Syntax
BOOL SetPicDownUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bPicDownUseTransColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bPicDownUseTransColor
Transparent color yes/no
FALSE
An error has occurred.
1322
SetPicTransColor Function
Sets the transparent color of the background picture of a graphic object.
Syntax
BOOL SetPicTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lPicTransColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lPicTransColor
Transparent color of the background picture
FALSE
An error has occurred. Note This function only applies to Bitmap graphics (*.bmp).
See also
Color chart (Page1538) SetBackColor example (Page1512)
1323
SetPictureDeactivated Function
Specifies the picture name for the "deactivated" status of a round button.
Syntax
BOOL SetPictureDeactivated(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, char* szPictureDeactivated);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
szPictureDeactivated
Picture name for "deactivated" status
FALSE
An error has occurred. Note Bitmap files (*.bmp, *.dib) as well as metafiles (*.emf, *.wmf) can be integrated.
See also
SetPictureDown example (Page1519)
1324
SetPictureDown Function
Specifies the picture name for the "On/pressed" status of a round button.
Syntax
BOOL SetPictureDown(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, char* szPictureDown);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
szPictureDown
Picture name for "On/pressed" status
FALSE
An error has occurred. Note Bitmap files (*.bmp, *.dib) as well as metafiles (*.emf, *.wmf) can be integrated.
See also
SetPictureDown example (Page1519)
1325
SetPictureUp Function
Specifies the picture name for the "Off/not pressed" status of a round button.
Syntax
BOOL SetPictureUp(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, char* szPictureUp);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
szPictureUp
Picture name for "Off/not pressed" status
FALSE
An error has occurred. Note Bitmap files (*.bmp, *.dib) as well as metafiles (*.emf, *.wmf) can be integrated.
See also
SetPictureUp example (Page1520)
1326
SetPicUpTransparent Function
Sets the transparent color for the "Off/not pressed" status of a round button.
Syntax
BOOL SetPicUpTransparent(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lPicUpTransparent);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lPicUpTransparent
Transparent color for "Off/not pressed" status
FALSE
An error has occurred. Note This function only applies to Bitmap graphics (*.bmp).
See also
Color chart (Page1538) SetBackColor example (Page1512)
1327
SetPicUpUseTransColor Function
Controls the transparent color for the "Off/not pressed" status of a round button.
Syntax
BOOL SetPicUpUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bPicUpUseTransColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bPicUpUseTransColor
Transparent color yes/no
FALSE
An error has occurred.
SetPicUseTransColor Function
Controls the transparent color of the background picture of a graphic object.
Syntax
BOOL SetPicUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bPicUseTransColor);
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1328
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bPicUseTransColor
Transparent color yes/no
FALSE
An error has occurred.
SetPropBOOL Function
Sets a property with the value "bValue".
1329
Syntax
BOOL SetPropBOOL(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName, BOOL bValue)
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
bValue
Value in BOOL data format
FALSE
An error has occurred. Note If the function is called for the picture object, set the parameter lpszObjectName = NULL.
See also
SetPropBOOL example (Page1520)
1330
SetPropChar Function
Sets a property with the value the pointer "szValue" points to.
Syntax
BOOL SetPropChar(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName, char* szValue)
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
szValue
Pointer to the value
FALSE
An error has occurred. Note If the function is called for the picture object, set the parameter lpszObjectName = NULL.
1331
See also
GetPropChar example (Page1489)
SetPropDouble Function
Sets a property with the value "dValue".
Syntax
BOOL SetPropDouble(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName, double dValue)
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
dValue
Value in "double" data format
FALSE
An error has occurred.
1332
SetPropWord Function
Sets a property with the value "IValue".
Syntax
BOOL SetPropWord(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, LPCTSTR lpszPropertyName, long lValue)
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lpszPropertyName
Name of the object property
lValue
Value in "long" data format
FALSE
An error has occurred.
1333
SetBasePicTransColor Function
Sets the transparent color of the basic picture for the status display.
Syntax
BOOL SetBasePicTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBasePicTransColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBasePicTransColor
Transparent color of the basic picture
1334
FALSE
An error has occurred. Note This function only applies to Bitmap graphics (*.bmp).
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetBasePicUseTransColor Function
Controls the transparent color of the basic picture for the status display.
Syntax
BOOL SetBasePicUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bBasePicUseTransColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bBasePicUseTransColor
Transparent color yes/no
1335
FALSE
An error has occurred.
SetFlashFlashPicture Function
Specifies whether the flash picture of the status display is animated dynamically or statically.
Syntax
BOOL SetFlashFlashPicture(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFlashFlashPicture);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bFlashFlashPicture
Type of flash picture TRUE dynamically animated flash picture FALSE statically animated flash picture
1336
FALSE
An error has occurred.
SetFlashPicTransColor Function
Sets the transparent color of the flash picture for a status display.
Syntax
BOOL SetFlashPicTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFlashPicTransColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFlashPicTransColor
Transparent color of the flash picture
FALSE
An error has occurred. Note This function only applies to Bitmap graphics (*.bmp).
1337
See also
Color chart (Page1538) SetBackColor example (Page1512)
SetFlashPicUseTransColor Function
Controls the transparent color of the flash picture for a status display.
Syntax
BOOL SetFlashPicUseTransColor(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bFlashPicUseTransColor);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bFlashPicUseTransColor
Transparent color yes/no
FALSE
An error has occurred.
1338
SetFlashRateFlashPic Function
Sets the flash frequency of the flash picture for a status display.
Syntax
BOOL SetFlashRateFlashPic(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFlashRateFlashPic);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFlashRateFlashPic
Flash frequency of the flash picture
FALSE
An error has occurred. 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 time etc.).
See also
Flash frequencies (Page1536) SetFlashRateFlashPic example (Page1515)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1339
SetIndex Function
Sets the index of a polygon or polyline thus defining the current object point.
Syntax
BOOL SetIndex(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lIndex);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lIndex
Index value
FALSE
An error has occurred.
1340
SetBackBorderWidth Function
Sets the frame width of 3D frames and slider objects.
Syntax
BOOL SetBackBorderWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBackBorderWidth);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBackBorderWidth
Frame width in pixels
FALSE
An error has occurred.
See also
SetBorderStyle example (Page1513)
1341
SetBorderEndStyle Function
Sets the type of line end.
Syntax
BOOL SetBorderEndStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderEndStyle);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderEndStyle
Type of line end as numeric value
FALSE
An error has occurred.
See also
Line end style (Page1541) SetBorderEndStyle example (Page1512)
1342
SetBorderStyle Function
Sets the line or border style.
Syntax
BOOL SetBorderStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderStyle);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderStyle
Numeric value defining the line or border style
FALSE
An error has occurred.
See also
Line styles (Page1541) SetBorderStyle example (Page1513)
1343
SetBorderWidth Function
Sets the line or border line width.
Syntax
BOOL SetBorderWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBorderWidth);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBorderWidth
Line width or border line width
FALSE
An error has occurred.
See also
SetBorderStyle example (Page1513)
SetBoxAlignment Function
Defines the arrangement of controls (left or right justified) in check boxes or radio boxes.
1344
Syntax
BOOL SetBoxAlignment(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lBoxAlignment);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lBoxAlignment
Arrangement of controls
FALSE
An error has occurred.
See also
Element alignment in check boxes and radio boxes (Page1538) SetBorderStyle example (Page1513)
SetFillStyle Function
Sets the type of fill pattern.
Syntax
BOOL SetFillStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFillStyle);
1345
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFillStyle
Type of fill pattern as numeric value
FALSE
An error has occurred. Note If the function is called in relation to the entire picture, set the parameter lpszObjectName = ZERO.
See also
Fill pattern (Page1539) SetFillStyle example (Page1514)
SetFillStyle2 Function
Sets the bar fill pattern for a bar graph.
Syntax
BOOL SetFillStyle2(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lFillStyle2);
1346
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lFillStyle2
Bar fill pattern as numeric value
FALSE
An error has occurred.
See also
Fill pattern (Page1539) SetFillStyle example (Page1514)
SetItemBorderStyle Function
Sets the dividing line style for the "text list" object.
Syntax
BOOL SetItemBorderStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lItemBorderStyle);
1347
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lItemBorderStyle
Numeric value defining the dividing line style
FALSE
An error has occurred.
See also
Line styles (Page1541) SetBorderStyle example (Page1513)
SetItemBorderWidth Function
Sets the dividing line width for the "text list" object.
Syntax
BOOL SetItemBorderWidth(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, long int lItemBorderWidth);
1348
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
lItemBorderWidth
Numeric value defining the dividing line width
FALSE
An error has occurred.
See also
SetBorderStyle example (Page1513)
SetPressed Function
Specifies for round buttons whether the switch setting is "pressed" or "not pressed".
Syntax
BOOL SetPressed(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bPressed);
Parameters lpszPictureName
Picture name
1349
lpszObjectName
Object name
bPressed
Switch setting of the round button TRUE Switch setting "pressed" FALSE Switch setting "not pressed"
FALSE
An error has occurred.
SetToggle Function
Specifies for round buttons whether the switch is latchable or not.
Syntax
BOOL SetToggle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bToggle);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bToggle
Switch latchable/not latchable
1350
FALSE
An error has occurred.
SetWindowsStyle Function
Specifies whether buttons are to be displayed in Windows style.
Syntax
BOOL SetWindowsStyle(LPCTSTR lpszPictureName, LPCTSTR lpszObjectName, BOOL bWindowStyle);
Parameters lpszPictureName
Picture name
lpszObjectName
Object name
bWindowStyle
"Windows style" on/off
FALSE
An error has occurred.
1351
OpenHomePicture Function
Opens the entered start picture.
Syntax
BOOL OpenHomePicture();
FALSE
An error has occurred.
OpenNextPicture Function
WinCC saves the names of the pictures opened by the user during runtime as well as the sequence in which these pictures were opened. The maximum number of picture names saved this way can be set in the WinCC Explorer in the computer properties on the "Graphics Runtime" tab under "picture buffer size". The OpenNextPicture function now opens the picture which was opened before the last call of OpenPrevPicture.
Syntax
BOOL OpenNextPicture();
FALSE
An error has occurred.
1352
OpenPrevPicture Function
WinCC saves the names of the pictures opened by the user during runtime as well as the sequence in which these pictures were opened. The maximum number of picture names saved this way can be set in the WinCC Explorer in the computer properties on the "Graphics Runtime" tab under "picture buffer size". The OpenPrevPicture function now opens the picture which was opened before the currently open picture.
Syntax
BOOL OpenPrevPicture();
FALSE
An error has occurred.
OpenStoredPicture Function
Opens the picture saved with the StorePicture function.
Syntax
BOOL OpenStoredPicture();
FALSE
An error has occurred.
1353
StorePicture Function
Saves the current picture which can then be opened with the OpenStoredPicture function.
Syntax
BOOL StorePicture();
FALSE
An error has occurred.
3.3.5
3.3.5.1
tag
tag - short description
Tags can be set or called in using the functions from the tag group.
GetTag or GetTagWait?
Process tags that are called with GetTag are put in an image. Since updating and reading the image is done in two separate procedures, the GetTag call is not directly influenced by the coupling. It can therefore be executed quicker and more independently than a GetTagWait retrieval. With GetTagWait, process tags that have been requested are not accepted in the image. A GetTagWait retrieval reads the value explicitly from the AS. This always includes the send and return path through the coupling and the response time of the AS. During this runtime, the processing of the C actions is blocked and the time required for the retrieval cannot be estimated. If multiple tags are read, the time is added. A GetTagWait call is required if fast write/read procedures are to be synchronized a value is read explicitly from the AS or a registration is to be avoided in the image deliberately. The GetTagWait call is to be avoided in cyclic C-Actions, this is the main reason for performance problems.
1354
SetTag or SetTagWait?
The SetTag retrieval distributes a write job without waiting for confirmation from the AS. The SetTagWait retrieval distributes a write job and waits for confirmation from the AS. This always includes the send and return path through the coupling and the response time of the AS. During this runtime, the processing of the C actions is blocked and the time required for the retrieval cannot be estimated. If multiple tags are written, the time is added. A SetTagWait call is set to guarantee that the value has been written before the C-Action is processed any further. The SetTagWait call in cyclic C actions is to be avoided. Note The difference between GetTag and GetTagWait also exists for internal tags. The difference is not quite so serious here however, since no coupling comes into play. To synchronize fast write/read procedures, the respective wait function is to be used with internal tags as well. Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well.
3.3.5.2
get
1355
Note If a tag is requested in a Global Script action, it remains registered throughout the enter Runtime of WinCC. In Callback functions, the respective GetTagXXXWait function must be used.
Note If a tag is requested, which is not in the trigger, then the behavior is the same as with the default trigger.
1356
1357
GetTagXXXWait
The function returns the current value. The tag is not registered cyclically, the value is requested from the AS one time only. The call is marked by the following: The value is read explicitly from the AS. The call, compared with GetTagXXX, takes longer. The duration of the call does not depend on the bus-load or on the AS. The function does not deliver any information on the status of the tags.
GetTagXXXState
The function GetTagXXXState has the same features as GetTagXXX, it also sends the function information on the status of the tags. Since the status is always delivered internally, there is no performance difference to GetTagXXX.
GetTagXXXStateWait
The function GetTagXXXStateWait has the same features as GetTagXXXWait, additionally it sends the function information on the status of the tags. Since the status is always delivered internally, there is no performance difference to GetTagXXXWait.
1358
GetTagXXXStateQC
The function GetTagXXXStateQC has the same features as GetTagXXXState. The function also delivers information on the quality code of the tag.
GetTagXXXStateQCWait
The function GetTagXXXStateQCWait has the same features as GetTagXXXStateWait. The function also delivers information on the quality code of the tag.
GetTagMultiWait
The function GetTagMultiWait has the same features as GetTagXXXWait. However, it allows the request for more tags in a job. Therefore, the read requests in the direction of the AS can be optimized in most cases so that only one request will be given to the AS.
GetTagMultiStateWait
The function GetTagMultiStateWait has the same features as GetTagMultiWait, additionally it sends the function information on the statuses of the tags.
GetTagMultiStateQCWait
The function GetTagMultiStateQCWait has the same features as GetTagMultiStateWait. The function also delivers information on the quality codese of the tags.
Syntax
BOOL GetTagBitStateWait(Tag Tag_Name, PDWORD lp_dwstate);
1359
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "BOOL"
See also
Tag statuses (Page1543) GetTagBitStateWait example (Page1495) Functionality of the GetTag functions (Page1355)
GetTagByteStateWait Function
Determines the value of a tag of data type "unsigned 8 bit". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
BYTE GetTagByteStateWait(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1360
Return value
Value of the tag in the data type "BYTE"
See also
Tag statuses (Page1543) GetTagWordStateWait example (Page1507) Functionality of the GetTag functions (Page1355)
GetTagCharStateWait Function
Determines the value of a tag of data type "8-bit text tag" or "16-bit text tag". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
char* GetTagCharStateWait(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Pointer to the value of the tag in the data type "char"
See also
Functionality of the GetTag functions (Page1355) Tag statuses (Page1543) Beispiel GetTagCharStateWait (Page1497)
1361
GetTagDoubleStateWait Function
Determines the value of a tag of data type "64-bit floating point value". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
double GetTagDoubleStateWait(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "double"
See also
Tag statuses (Page1543) GetTagFloatStateWait example (Page1498) Functionality of the GetTag functions (Page1355)
GetTagDWordStateWait Function
Determines the value of a tag of data type "unsigned 32 bit". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
DWORD GetTagDWordStateWait(Tag Tag_Name, PDWORD lp_dwstate);
1362
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "DWORD"
See also
Tag statuses (Page1543) GetTagWordStateWait example (Page1507) Functionality of the GetTag functions (Page1355)
GetTagFloatStateWait Function
Determines the value of a tag of data type "32-bit floating point value". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
float GetTagFloatStateWait(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1363
Return value
Value of the tag in the data type "float"
See also
Tag statuses (Page1543) GetTagFloatStateWait example (Page1498) Functionality of the GetTag functions (Page1355)
GetTagMultiStateWait Function
The values and states of several tags are established and stored in the corresponding addresses in the specified format. The values are read explicitly from the AS. The function must transfer a DWORD array whose members contain the individual tag states after the function is invoked. The size of the array must be selected so that sufficient memory space is available for these statuses.
Syntax
BOOL GetTagMultiStateWait(DWORD* pdwState, const char* pFormat)
Parameters pdwState
Field in which the tag statuses are stored.
pFormat
Format description for all requested tags and for each tag name and address of the value
FALSE
An error has occurred.
1364
See also
Format descriptors (Page1538) Tag statuses (Page1543) GetTagMultiStateWait example (Page1500) Functionality of the GetTag functions (Page1355)
GetTagRawStateWait Function
Determines the value of a tag of data type "Raw data type". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
BOOL GetTagRawStateWait(Tag Tag_Name, BYTE pValue, DWORD size, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
pValue
The pointer to a byte field which contains the value of the raw data tag
size
Size of the byte field in bytes
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1365
FALSE
An error has occurred.
See also
Tag statuses (Page1543) GetTagRawStateWait example (Page1503) Functionality of the GetTag functions (Page1355)
GetTagSByteStateWait Function
Determines the value of a tag of data type "signed 8 bit". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
signed char GetTagSByteStateWait(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
The value of the tag in the data type "signed char"
See also
Tag statuses (Page1543) GetTagSByteStateWait example (Page1505) Functionality of the GetTag functions (Page1355)
1366
GetTagSDWordStateWait Function
Determines the value of a tag of data type "signed 32 bit". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
long GetTagSDWordStateWait(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "long"
See also
Tag statuses (Page1543) GetTagSByteStateWait example (Page1505) Functionality of the GetTag functions (Page1355)
GetTagSWordStateWait Function
Determines the value of a tag of data type "signed 16 bit". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
short GetTagSWordStateWait(Tag Tag_Name, PDWORD lp_dwstate);
1367
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "short"
See also
Functionality of the GetTag functions (Page1355) Tag statuses (Page1543) GetTagSByteStateWait example (Page1505)
GetTagWordStateWait Function
Determines the value of a tag of data type "unsigned 16 bit". The value is read explicitly from the AS. The status of the tag is also returned.
Syntax
WORD GetTagWordStateWait(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1368
Return value
Value of the tag in the data type "WORD"
See also
Tag statuses (Page1543) GetTagWordStateWait example (Page1507) Functionality of the GetTag functions (Page1355)
GetTagBitState Function
Determines the value of a tag of data type "Binary tag". The status of the tag is also returned.
Syntax
BOOL GetTagBitState(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "BOOL"
See also
Tag statuses (Page1543) GetTagBitStateWait example (Page1495) Functionality of the GetTag functions (Page1355)
1369
GetTagByteState Function
Determines the value of a tag of data type "unsigned 8 bit". The status of the tag is also returned.
Syntax
BYTE GetTagByteState(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "BYTE"
See also
Tag statuses (Page1543) GetTagWordStateWait example (Page1507) Functionality of the GetTag functions (Page1355)
GetTagCharState Function
Determines the value of a tag of data type "8-bit text tag" or "16-bit text tag". The status of the tag is also returned.
Syntax
char* GetTagCharState(Tag Tag_Name, PDWORD lp_dwstate);
1370
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Pointer to the value of the tag in the data type "char"
See also
Tag statuses (Page1543) Beispiel GetTagCharStateWait (Page1497) Functionality of the GetTag functions (Page1355)
GetTagDoubleState Function
Determines the value of a tag of data type "64-bit floating point value". The status of the tag is also returned.
Syntax
double GetTagDoubleState(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1371
Return value
Value of the tag in the data type "double"
See also
Tag statuses (Page1543) GetTagFloatStateWait example (Page1498) Functionality of the GetTag functions (Page1355)
GetTagDWordState Function
Determines the value of a tag of data type "unsigned 32 bit". The status of the tag is also returned.
Syntax
DWORD GetTagDWordState(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "DWORD"
See also
Tag statuses (Page1543) GetTagWordStateWait example (Page1507) Functionality of the GetTag functions (Page1355)
1372
GetTagFloatState Function
Determines the value of a tag of data type "32-bit floating point value". The status of the tag is also returned.
Syntax
float GetTagFloatState(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "float"
See also
GetTagFloatStateWait example (Page1498) Tag statuses (Page1543) Functionality of the GetTag functions (Page1355)
GetTagRawState Function
Determines the value of a tag of data type "Raw data type". The status of the tag is also returned.
Syntax
BOOL GetTagRawState(Tag Tag_Name, BYTE* pValue, DWORD size, PDWORD lp_dwstate);
1373
Parameters Tag_Name
name of the tag
pValue
The pointer to a byte field which contains the value of the raw data tag
size
Size of the byte field in bytes
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) GetTagRawStateWait example (Page1503) Functionality of the GetTag functions (Page1355)
GetTagSByteState Function
Determines the value of a tag of data type "signed 8 bit". The status of the tag is also returned.
Syntax
signed char GetTagSByteState(Tag Tag_Name, PDWORD lp_dwstate);
1374
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
The value of the tag in the data type "signed char"
See also
Tag statuses (Page1543) GetTagSByteStateWait example (Page1505) Functionality of the GetTag functions (Page1355)
GetTagSDWordState Function
Determines the value of a tag of data type "signed 32 bit". The status of the tag is also returned.
Syntax
long GetTagSDWordState(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "long"
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1375
See also
Tag statuses (Page1543) GetTagSByteStateWait example (Page1505) Functionality of the GetTag functions (Page1355)
GetTagSWordState Function
Determines the value of a tag of data type "signed 16 bit". The status of the tag is also returned.
Syntax
short GetTagSWordState(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "short"
See also
Tag statuses (Page1543) GetTagSByteStateWait example (Page1505) Functionality of the GetTag functions (Page1355)
GetTagWordState Function
Determines the value of a tag of data type "unsigned 16 bit". The status of the tag is also returned.
1376
Syntax
WORD GetTagWordState(Tag Tag_Name, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
Return value
Value of the tag in the data type "WORD"
See also
Tag statuses (Page1543) GetTagWordStateWait example (Page1507) Functionality of the GetTag functions (Page1355)
Syntax
BOOL GetTagBitStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
1377
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tags in the data type "BOOL".
See also
Tag statuses (Page1543) GetTagWordStateQCWait example (Page1506) Functionality of the GetTag functions (Page1355)
GetTagByteStateQCWait Function
Determines the value of a tag of data type "unsigned 8 bit". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
BYTE GetTagByteStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
1378
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "BYTE".
See also
Tag statuses (Page1543) GetTagWordStateQCWait example (Page1506) Functionality of the GetTag functions (Page1355)
GetTagCharStateQCWait Function
Determines the value of a tag of data type "8-bit text tag" or "16-bit text tag". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
char* GetTagCharStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
1379
Return value
Pointer to the value of the tag in data type "char".
See also
Tag statuses (Page1543) GetTagCharStateQCWait example (Page1496) Functionality of the GetTag functions (Page1355)
GetTagDoubleStateQCWait Function
Determines the value of a tag of data type "64-bit floating point value". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
double GetTagDoubleStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "double".
1380
See also
Tag statuses (Page1543) GetTagFloatStateQCWait example (Page1498) Functionality of the GetTag functions (Page1355)
GetTagDWordStateQCWait Function
Determines the value of a tag of data type "unsigned 32 bit". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
DWORD GetTagDWordStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "DWORD".
See also
Tag statuses (Page1543) GetTagWordStateQCWait example (Page1506) Functionality of the GetTag functions (Page1355)
1381
GetTagFloatStateQCWait Function
Determines the value of a tag of data type "32-bit floating point value". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
float GetTagFloatStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "float".
See also
Tag statuses (Page1543) GetTagFloatStateQCWait example (Page1498) Functionality of the GetTag functions (Page1355)
GetTagMultiStateQCWait Function
The values, states and quality codes are determined for several tags and are stored in the respective addresses in the specified format. The values are read explicitly from the AS.
1382
Syntax
BOOL GetTagMultiStateQCWait(DWORD* pdwState, DWORD* pdwQualityCode, const char* pFormat)
Parameters pdwState
Field in which the status of the individual tags is stored after the function has been completed.
pdwQualityCode
Field in which the quality codes of the individual tags is stored after the function has been completed.
pFormat
Format description for all requested tags and for each tag name and address of the value.
FALSE
An error has occurred.
See also
Format descriptors (Page1538) Tag statuses (Page1543) GetTagMultiStateQCWait example (Page1499) Functionality of the GetTag functions (Page1355)
1383
GetTagRawStateQCWait Function
Determines the value of a tag of data type "Raw data type". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
BOOL GetTagRawStateQCWait(Tag Tag_Name, BYTE pValue, DWORD size, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
pValue
Pointer to a byte field containing the value of the raw data tag.
size
Size of the byte field in bytes.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
FALSE
An error has occurred.
1384
See also
Tag statuses (Page1543) GetTagRawStateQCWait example (Page1503) Functionality of the GetTag functions (Page1355)
GetTagSByteStateQCWait Function
Determines the value of a tag of data type "signed 8 bit". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
signed char GetTagSByteStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "signed char".
See also
Tag statuses (Page1543) GetTagSByteStateQCWait example (Page1504) Functionality of the GetTag functions (Page1355)
1385
GetTagSDWordStateQCWait Function
Determines the value of a tag of data type "signed 32 bit". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
long GetTagSDWordStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tags in the data type "long".
See also
Tag statuses (Page1543) GetTagSByteStateQCWait example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagSWordStateQCWait Function
Determines the value of a tag of data type "signed 16 bit". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
1386
Syntax
short GetTagSWordStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "short".
See also
Tag statuses (Page1543) GetTagSByteStateQCWait example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagValueStateQCWait Function
Enables the transfer of a value in the form of a variant. Establishes the pointer to the result structure containing the value. The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
BOOL GetTagValueStateQCWait(LPDM_VARKEY lpdmVarKey, LPDM_VAR_UPDATE_STRUCTEX lpdmresult, LPCMN_ERROR lpdmError);
1387
Parameters lpdmVarKey
Pointer to a structure of the data type "DM_VARKEY"
lpdmresult
Pointer to the value from data type "DM_VAR_UPDATE_STRUCTEX"
lpdmError
Pointer to the structure which contains the error description
FALSE
An error has occurred.
See also
Structure definition CMN_ERROR (Page1546) Structure definition DM_VAR_UPDATE_STRUCTEX (Page1549) Structure definition DM_VARKEY (Page1550) Functionality of the GetTag functions (Page1355)
GetTagWordStateQCWait Function
Determines the value of a tag of data type "unsigned 16 bit". The value is read explicitly from the AS. In addition, the status and the quality code of the tags are returned.
Syntax
WORD GetTagWordStateQCWait(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
1388
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "WORD".
See also
Tag statuses (Page1543) GetTagWordStateQCWait example (Page1506) Functionality of the GetTag functions (Page1355)
GetTagBitStateQC Function
Determines the value of a tag of data type "Binary tag". In addition, the status and the quality code of the tags are returned.
Syntax
BOOL GetTagBitStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
1389
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tags in the data type "BOOL".
See also
Tag statuses (Page1543) GetTagBitStateQC example (Page1494) Functionality of the GetTag functions (Page1355)
GetTagByteStateQC Function
Determines the value of a tag of data type "unsigned 8 bit". In addition, the status and the quality code of the tags are returned.
Syntax
BYTE GetTagByteStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1390
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "BYTE".
See also
Tag statuses (Page1543) GetTagWordStateQCWait example (Page1506) Functionality of the GetTag functions (Page1355)
GetTagCharStateQC Function
Determines the value of a tag of data type "8-bit text tag" or "16-bit text tag". In addition, the status and the quality code of the tags are returned.
Syntax
char* GetTagCharStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Pointer to the value of the tag in data type "char".
1391
See also
Tag statuses (Page1543) GetTagCharStateQCWait example (Page1496) Functionality of the GetTag functions (Page1355)
GetTagDoubleStateQC Function
Determines the value of a tag of data type "64-bit floating point value". In addition, the status and the quality code of the tags are returned.
Syntax
double GetTagDoubleStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "double".
1392
See also
GetTagFloatStateQCWait example (Page1498) Tag statuses (Page1543) Functionality of the GetTag functions (Page1355)
GetTagDWordStateQC Function
Determines the value of a tag of data type "unsigned 32 bit". In addition, the status and the quality code of the tags are returned.
Syntax
DWORD GetTagDWordStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "DWORD".
See also
Tag statuses (Page1543) GetTagWordStateQCWait example (Page1506) Functionality of the GetTag functions (Page1355)
1393
GetTagFloatStateQC Function
Determines the value of a tag of data type "32-bit floating point value". In addition, the status and the quality code of the tags are returned.
Syntax
float GetTagFloatStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "float".
See also
GetTagFloatStateQCWait example (Page1498) Tag statuses (Page1543) Functionality of the GetTag functions (Page1355)
GetTagRawStateQC Function
Determines the value of a tag of data type "Raw data type". In addition, the status and the quality code of the tags are returned.
1394
Syntax
BOOL GetTagRawStateQC(Tag Tag_Name, BYTE* pValue, DWORD size, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
pValue
Pointer to a byte field containing the value of the raw data tag.
size
Size of the byte field in bytes.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) GetTagRawStateQCWait example (Page1503) Functionality of the GetTag functions (Page1355)
1395
GetTagSByteStateQC Function
Determines the value of a tag of data type "signed 8 bit". In addition, the status and the quality code of the tags are returned.
Syntax
signed char GetTagSByteStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "signed char".
See also
Tag statuses (Page1543) GetTagSByteStateQCWait example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagSDWordStateQC Function
Determines the value of a tag of data type "signed 32 bit". In addition, the status and the quality code of the tags are returned.
1396
Syntax
long GetTagSDWordStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tags in the data type "long".
See also
Tag statuses (Page1543) GetTagSByteStateQCWait example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagSWordStateQC Function
Determines the value of a tag of data type "signed 16 bit". In addition, the status and the quality code of the tags are returned.
Syntax
short GetTagSWordStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
1397
Parameters Tag_Name
Name of the tag.
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "short".
See also
Tag statuses (Page1543) GetTagSByteStateQCWait example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagValueStateQC Function
Enables the transfer of a value in the form of a variant. Establishes the pointer to the result structure containing the value. In addition, the status and the quality code of the tags are returned.
Syntax
BOOL GetTagValueStateQC(LPDM_VARKEY lpdmVarKey, LPDM_VAR_UPDATE_STRUCTEX lpdmresult, LPCMN_ERROR lpdmError);
Parameters lpdmVarKey
Pointer to a structure of the data type "DM_VARKEY"
1398
lpdmresult
Pointer to the value from data type "DM_VAR_UPDATE_STRUCTEX"
lpdmError
Pointer to the structure which contains the error description
FALSE
An error has occurred.
See also
Structure definition CMN_ERROR (Page1546) Structure definition DM_VAR_UPDATE_STRUCTEX (Page1549) Structure definition DM_VARKEY (Page1550) Functionality of the GetTag functions (Page1355)
GetTagWordStateQC Function
Determines the value of a tag of data type "unsigned 16 bit". In addition, the status and the quality code of the tags are returned.
Syntax
WORD GetTagWordStateQC(Tag Tag_Name, PDWORD lp_dwstate, PDWORD pdwQualityCode);
Parameters Tag_Name
Name of the tag.
1399
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
pdwQualityCode
Pointer to a DWORD in which the quality code of the tag is stored after the function is complete.
Return value
Value of the tag in the data type "WORD".
See also
Tag statuses (Page1543) GetTagWordStateQCWait example (Page1506) Functionality of the GetTag functions (Page1355)
Syntax
BOOL GetTagBitWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "BOOL"
1400
See also
GetTagBit example (Page1493) Functionality of the GetTag functions (Page1355)
GetTagByteWait Function
Determines the value of a tag of data type "unsigned 8 bit". The value is read explicitly from the AS.
Syntax
BYTE GetTagByteWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "BYTE"
See also
GetTagWord example (Page1505) Functionality of the GetTag functions (Page1355)
GetTagCharWait Function
Determines the value of a tag of data type "8-bit text tag" or "16-bit text tag". The value is read explicitly from the AS.
Syntax
char* GetTagCharWait(Tag Tag_Name);
1401
Parameters Tag_Name
name of the tag
Return value
Pointer to a character string containing the value of the tag.
See also
GetTagChar example (Page1495) Functionality of the GetTag functions (Page1355)
GetTagDoubleWait Function
Determines the value of a tag of data type "64-bit floating point value". The value is read explicitly from the AS.
Syntax
double GetTagDoubleWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "double"
See also
GetTagFloat example (Page1497) Functionality of the GetTag functions (Page1355)
1402
GetTagDWordWait Function
Determines the value of a tag of data type "unsigned 32 bit". The value is read explicitly from the AS.
Syntax
DWORD GetTagDWordWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "DWORD"
See also
Functionality of the GetTag functions (Page1355) GetTagWord example (Page1505)
GetTagFloatWait Function
Determines the value of a tag of data type "32-bit floating point value". The value is read explicitly from the AS.
Syntax
float GetTagFloatWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
1403
Return value
Value of the tag in the data type "float"
See also
GetTagFloat example (Page1497) Functionality of the GetTag functions (Page1355)
GetTagMultiWait Function
The values of several tags are established and stored in the corresponding addresses in the specified format. The value is read explicitly from the AS. The memory for the tag value is created by the function with SysMalloc.
Syntax
BOOL GetTagMultiWait(const char* pFormat,...)
Parameters pFormat
Format description for all requested tags and for each tag name and address of the value
FALSE
An error has occurred.
See also
Format descriptors (Page1538) GetTagMultiWait example (Page1501) Functionality of the GetTag functions (Page1355)
1404
GetTagRawWait Function
Determines the value of a tag of data type "Raw data type". The value is read explicitly from the AS.
Syntax
BOOL GetTagRawWait(Tag Tag_Name , BYTE pValue, DWORD size);
Parameters Tag_Name
name of the tag
pValue
The pointer to a byte field which contains the value of the raw data tag
size
Size of the byte field in bytes
FALSE
An error has occurred.
See also
Functionality of the GetTag functions (Page1355) GetTagRaw example (Page1502)
1405
GetTagSByteWait Function
Determines the value of a tag of data type "signed 8 bit". The value is read explicitly from the AS.
Syntax
signed char GetTagSByteWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
The value of the tag in the data type "signed char"
See also
GetTagSByte example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagSDWordWait Function
Determines the value of a tag of data type "signed 32 bit". The value is read explicitly from the AS.
Syntax
long GetTagSDWordWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
1406
Return value
Value of the tag in the data type "long"
See also
GetTagSByte example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagSWordWait Function
Determines the value of a tag of data type "signed 16 bit". The value is read explicitly from the AS.
Syntax
short GetTagSWordWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "short"
See also
GetTagSByte example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagValueWait Function
Enables the transfer of a value in the form of a variant. Establishes the pointer to the result structure containing the value. The value is read explicitly from the AS.
1407
Syntax
BOOL GetTagValueWait(LPDM_VARKEY lpdmVarKey, LPDM_VAR_UPDATE_STRUCT lpdmresult, LPCMN_ERROR lpdmError);
Parameters lpdmVarKey
Pointer to a structure of the data type "DM_VARKEY"
lpdmresult
Pointer to the value from data type "DM_VAR_UPDATE_STRUCT"
lpdmError
Pointer to the structure which contains the error description
FALSE
An error has occurred.
See also
Structure definition CMN_ERROR (Page1546) Structure definition DM_VAR_UPDATE_STRUCT (Page1548) Structure definition DM_VARKEY (Page1550) Functionality of the GetTag functions (Page1355)
GetTagWordWait Function
Determines the value of a tag of data type "unsigned 16 bit". The value is read explicitly from the AS.
1408
Syntax
WORD GetTagWordWait(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "WORD"
See also
GetTagWord example (Page1505) Functionality of the GetTag functions (Page1355)
GetTagBit Function
Determines the value of a tag of data type "Binary tag".
Syntax
BOOL GetTagBit(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "BOOL"
See also
GetTagBit example (Page1493) Functionality of the GetTag functions (Page1355)
1409
GetTagByte Function
Determines the value of a tag of data type "unsigned 8 bit".
Syntax
BYTE GetTagByte(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "BYTE"
See also
GetTagWord example (Page1505) Functionality of the GetTag functions (Page1355)
GetTagChar Function
Determines the value of a tag of data type "8-bit text tag" or "16-bit text tag".
Syntax
char* GetTagChar(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Pointer to a character string containing the value of the tag.
1410
See also
GetTagChar example (Page1495) Functionality of the GetTag functions (Page1355)
GetTagDouble Function
Determines the value of a tag of data type "64-bit floating point value".
Syntax
double GetTagDouble(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "double"
See also
GetTagFloat example (Page1497) Functionality of the GetTag functions (Page1355)
GetTagDWord Function
Determines the value of a tag of data type "unsigned 32 bit".
Syntax
DWORD GetTagDWord(Tag Tag_Name);
1411
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "DWORD"
See also
GetTagWord example (Page1505) Functionality of the GetTag functions (Page1355)
GetTagFloat Function
Determines the value of a tag of data type "32-bit floating point value".
Syntax
float GetTagFloat(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "float".
See also
GetTagFloat example (Page1497) Functionality of the GetTag functions (Page1355)
1412
GetTagRaw Function
Determines the value of a tag of data type "Raw data type".
Syntax
BOOL GetTagRaw(Tag Tag_Name, BYTE* pValue, DWORD size);
Parameters Tag_Name
name of the tag
pValue
The pointer to a byte field which contains the value of the raw data tag
size
Size of the byte field in bytes
FALSE
An error has occurred.
See also
GetTagRaw example (Page1502) Functionality of the GetTag functions (Page1355)
GetTagSByte Function
Determines the value of a tag of data type "signed 8 bit".
1413
Syntax
signed char GetTagSByte(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
The value of the tag in the data type "signed char"
See also
GetTagSByte example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagSDWord Function
Determines the value of a tag of data type "signed 32 bit".
Syntax
long GetTagSDWord(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "long"
See also
GetTagSByte example (Page1504) Functionality of the GetTag functions (Page1355)
1414
GetTagSWord Function
Determines the value of a tag of data type "signed 16 bit".
Syntax
short GetTagSWord(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "short"
See also
GetTagSByte example (Page1504) Functionality of the GetTag functions (Page1355)
GetTagValue Function
Enables the transfer of a value in the form of a variant. Establishes the pointer to the result structure containing the value.
Syntax
BOOL GetTagValue(LPDM_VARKEY lpdmVarKey, LPDM_VAR_UPDATE_STRUCT lpdmresult, LPCMN_ERROR lpdmError);
Parameters lpdmVarKey
Pointer to a structure of the data type "DM_VARKEY"
1415
lpdmresult
Pointer to the value from data type "DM_VAR_UPDATE_STRUCT"
lpdmError
Pointer to the structure which contains the error description
FALSE
An error has occurred.
See also
Structure definition CMN_ERROR (Page1546) Structure definition DM_VAR_UPDATE_STRUCT (Page1548) Structure definition DM_VARKEY (Page1550) Functionality of the GetTag functions (Page1355)
GetTagWord Function
Determines the value of a tag of data type "unsigned 16 bit".
Syntax
WORD GetTagWord(Tag Tag_Name);
Parameters Tag_Name
name of the tag
Return value
Value of the tag in the data type "WORD"
1416
See also
GetTagWord example (Page1505) Functionality of the GetTag functions (Page1355)
3.3.5.3
set
SetTagXXXWait
The function SetTagXXXWait assigns the job of writing a value and will first return to the caller when the value has actually been written. The call is marked by the following: The call takes longer in comparison to SetTagXXX. The duration is also dependent on the channel and AS, amongst other things. The value is written after the call. The function provides no information on the state of the write job.
SetTagXXXState
The function SetTagXXXState has the same features as SetTagXXX; plus the function returns information regarding the status of the write request. Since the status is always provided internally, there is no performance difference compared to SetTagXXX.
SetTagXXXStateWait
The function SetTagXXXStateWait has the same features as SetTagXXXWait; plus the function returns information regarding the status of the write request. Since the status is always provided internally, there is no performance difference compared to SetTagXXXWait. The difference between the functions SetTagXXXStateWait and SetTagXXXState corresponds to the difference between SetTagXXXWait and SetTagXXX.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1417
SetTagMultiWait
The SetTagMultiWait function has the same features as SetTagXXXWait. It also offers the option of granting several write jobs in a single job.
Syntax
BOOL SetTagBitStateWait(Tag Tag_Name, short value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "short"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1418
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagBitStateWait (Page1522)
SetTagByteStateWait Function
Sets the value of a tag of the data type "unsigned 8 Bit". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagByteStateWait(Tag Tag_Name, BYTE value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "BYTE"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1419
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagWordStateWait (Page1529)
SetTagCharStateWait Function
Sets the value of a tag of the data type " 8-bit text tag" or "16-bit text tag". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagCharStateWait(Tag Tag_Name, LPSTR value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "LPSTR"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1420
FALSE
An error has occurred.
See also
Tag statuses (Page1543) SetTagCharStateWait example (Page1523)
SetTagDoubleStateWait Function
Defines the value of a tag of the data type "64-bit floating point value". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagDoubleStateWait(Tag Tag_Name, double value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "double"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1421
FALSE
An error has occurred.
See also
Tag statuses (Page1543) SetTagFloatStateWait example (Page1524)
SetTagDWordStateWait Function
Sets the value of a tag of the data type "unsigned 32 Bit". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagDWordStateWait(Tag Tag_Name, DWORD value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "DWORD"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1422
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagWordStateWait (Page1529)
SetTagFloatStateWait Function
Defines the value of a tag of the data type "32-bit floating point value". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagFloatStateWait(Tag Tag_Name, float value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "float"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
1423
FALSE
An error has occurred.
See also
Tag statuses (Page1543) SetTagFloatStateWait example (Page1524)
SetTagMultiStateWait Function
Sets the values of several tags. The function is ended after the AS has acknowledged acceptance of the value. The function must transfer a DWORD array whose members contain the individual tag states after the function is invoked. The size of the array must be selected so that sufficient memory space is available for these statuses. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagMultiStateWait(DWORD* pdwState, const char* pFormat,...)
Parameters pdwState
Field in which the tag statuses are stored.
pFormat
Format description for all requested tags and for each tag name and value. FormatdescriberEXAMPLES_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
1424
FALSE
An error has occurred.
See also
Tag statuses (Page1543) SetTagMultiStateWait example (Page1524)
SetTagRawStateWait Function
Sets the value of a tag of the data type "Raw data type". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagRawStateWait(Tag Tag_Name, BYTE pValue, DWORD size, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
pValue
The pointer to a byte field which contains the value of the raw data tag
size
Size of the byte field in bytes
1425
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) SetTagRawStateWait example (Page1527)
SetTagSByteStateWait Function
Sets the value of a tag of the data type "signed 8 bit". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagSByteStateWait(Tag Tag_Name, signed char value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
The value of the tag in the data type "signed char"
1426
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagSByteStateWait (Page1528)
SetTagSDWordStateWait Function
Sets the value of a tag of the data type "signed 32 bit". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagSDWordStateWait(Tag Tag_Name, long value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "long"
1427
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagSByteStateWait (Page1528)
SetTagSWordStateWait Function
Sets the value of a tag of the data type "signed 16 bit". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagSWordStateWait(Tag Tag_Name, short value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "short"
1428
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagSByteStateWait (Page1528)
SetTagWordStateWait Function
Sets the value of a tag of the data type "unsigned 16 Bit". The function is ended after the AS has acknowledged acceptance of the value. The status of the tag is also returned. Principle of the SetTag functionsEXAMPLE_INTERNAL_FUNCTIONS_TAG_STATEWAIT_23_130
Syntax
BOOL SetTagWordStateWait(Tag Tag_Name, WORD value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "WORD"
1429
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagWordStateWait (Page1529)
SetTagBitState Function
Sets the value of a tag of data type "Binary tag". The status of the tag is also returned.
Syntax
BOOL SetTagBitState(Tag Tag_Name, short int value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "short int"
1430
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagBitStateWait (Page1522) Principle of the SetTag functions (Page1417)
SetTagByteState Function
Sets the value of a tag of the data type "unsigned 8 Bit". The status of the tag is also returned.
Syntax
BOOL SetTagByteState(Tag Tag_Name, BYTE value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "BYTE"
1431
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagWordStateWait (Page1529) Principle of the SetTag functions (Page1417)
SetTagCharState Function
Sets the value of a tag of the data type " 8-bit text tag" or "16-bit text tag". The status of the tag is also returned.
Syntax
BOOL SetTagCharState(Tag Tag_Name, LPSTR value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "LPSTR"
1432
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) SetTagCharStateWait example (Page1523) Principle of the SetTag functions (Page1417)
SetTagDoubleState Function
Defines the value of a tag of the data type "64-bit floating point value". The status of the tag is also returned.
Syntax
BOOL SetTagDoubleState(Tag Tag_Name, double value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "double"
1433
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) SetTagFloatStateWait example (Page1524) Principle of the SetTag functions (Page1417)
SetTagDWordState Function
Sets the value of a tag of the data type "unsigned 32 Bit". The status of the tag is also returned.
Syntax
BOOL SetTagDWordState(Tag Tag_Name, DWORD value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "DWORD"
1434
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagWordStateWait (Page1529) Principle of the SetTag functions (Page1417)
SetTagFloatState Function
Defines the value of a tag of the data type "32-bit floating point value". The status of the tag is also returned.
Syntax
BOOL SetTagFloatState(Tag Tag_Name, float value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "float"
1435
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) SetTagFloatStateWait example (Page1524) Principle of the SetTag functions (Page1417)
SetTagRawState Function
Sets the value of a tag of the data type "Raw data type". The status of the tag is also returned.
Syntax
BOOL SetTagRawState(Tag Tag_Name, BYTE* pValue, DWORD size, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
pValue
The pointer to a byte field which contains the value of the raw data tag
1436
size
Size of the byte field in bytes
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) GetTagRaw example (Page1502) Principle of the SetTag functions (Page1417)
SetTagSByteState Function
Sets the value of a tag of the data type "signed 8 bit". The status of the tag is also returned.
Syntax
BOOL SetTagSByteState(Tag Tag_Name, signed char value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
1437
value
The value of the tag in the data type "signed char"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagSByteStateWait (Page1528) Principle of the SetTag functions (Page1417)
SetTagSDWordState Function
Sets the value of a tag of the data type "signed 32 bit". The status of the tag is also returned.
Syntax
BOOL SetTagSDWordState(Tag Tag_Name, long value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
1438
value
Value of the tag in the data type "long"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagSByteStateWait (Page1528) Principle of the SetTag functions (Page1417)
SetTagSWordState Function
Sets the value of a tag of the data type "signed 16 bit". The status of the tag is also returned.
Syntax
BOOL SetTagSWordState(Tag Tag_Name, short value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
1439
value
Value of the tag in the data type "short"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagSByteStateWait (Page1528) Principle of the SetTag functions (Page1417)
SetTagWordState Function
Sets the value of a tag of the data type "unsigned 16 Bit". The status of the tag is also returned.
Syntax
BOOL SetTagWordState(Tag Tag_Name, WORD value, PDWORD lp_dwstate);
Parameters Tag_Name
name of the tag
1440
value
Value of the tag in the data type "short"
lp_dwstate
Pointer to a DWORD in which the status of the tag is stored after the function has been completed.
FALSE
An error has occurred.
See also
Tag statuses (Page1543) Beispiel SetTagWordStateWait (Page1529) Principle of the SetTag functions (Page1417)
Syntax
BOOL SetTagBitWait(Tag Tag_Name, short value);
1441
Parameter Tag_Name
Name of the tag
Value
Value of the tag in the data type "short"
FALSE
An error has occurred.
See also
SetTagBit example (Page1522) Principle of the SetTag functions (Page1417)
SetTagByteWait Function
Sets the value of a tag of the data type "unsigned 8 Bit". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagByteWait(Tag Tag_Name, BYTE value);
Parameters Tag_Name
name of the tag
1442
value
Value of the tag in the data type "BYTE"
FALSE
An error has occurred.
See also
SetTagWord example (Page1528) Principle of the SetTag functions (Page1417)
SetTagCharWait Function
Sets the value of a tag of the data type " 8-bit text tag" or "16-bit text tag". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagCharWait(Tag Tag_Name, LPSTR value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "LPSTR"
1443
FALSE
An error has occurred.
See also
Principle of the SetTag functions (Page1417) SetTagChar example (Page1523)
SetTagDoubleWait Function
Defines the value of a tag of the data type "64-bit floating point value". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagDoubleWait(Tag Tag_Name, double value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "double"
1444
FALSE
An error has occurred.
See also
SetTagFloat example (Page1524) Principle of the SetTag functions (Page1417)
SetTagDWordWait Function
Sets the value of a tag of the data type "unsigned 32 Bit". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagDWordWait(Tag Tag_Name, DWORD value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "DWORD"
FALSE
An error has occurred.
1445
See also
SetTagWord example (Page1528) Principle of the SetTag functions (Page1417)
SetTagFloatWait Function
Defines the value of a tag of the data type "32-bit floating point value". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagFloatWait(Tag Tag_Name, float value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "float"
FALSE
An error has occurred.
See also
SetTagFloat example (Page1524) Principle of the SetTag functions (Page1417)
1446
SetTagMultiWait Function
The values of several tags are set in the specified format. The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagMultiWait(const char* pFormat,...)
Parameters pFormat
Format description for all requested tags and for each tag name and value.
FALSE
An error has occurred.
See also
Format descriptors (Page1538) SetTagMultiWait example (Page1525) Principle of the SetTag functions (Page1417)
SetTagRawWait Function
Sets the value of a tag of the data type "Raw data type". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagRawWait(Tag Tag_Name, BYTE pValue, DWORD size);
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1447
Parameters Tag_Name
name of the tag
pValue
The pointer to a byte field which contains the value of the raw data tag
size
Size of the byte field in bytes
FALSE
An error has occurred.
See also
SetTagRaw example (Page1526) Principle of the SetTag functions (Page1417)
SetTagSByteWait Function
Sets the value of a tag of the data type "signed 8 bit". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagSByteWait(Tag Tag_Name, signed char value);
1448
Parameters Tag_Name
name of the tag
value
The value of the tag in the data type "signed char"
FALSE
An error has occurred.
See also
SetTagSByte example (Page1527) Principle of the SetTag functions (Page1417)
SetTagSDWordWait Function
Sets the value of a tag of the data type "signed 32 bit". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagSDWordWait(Tag Tag_Name, long value);
Parameters Tag_Name
name of the tag
1449
value
Value of the tag in the data type "long"
FALSE
An error has occurred.
See also
Principle of the SetTag functions (Page1417) SetTagSByte example (Page1527)
SetTagSWordWait Function
Sets the value of a tag of the data type "signed 16 bit". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagSWordWait(Tag Tag_Name, short value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "short"
1450
FALSE
An error has occurred.
See also
SetTagSByte example (Page1527) Principle of the SetTag functions (Page1417)
SetTagValueWait Function
Enables the transfer of a value in the form of a variant and sets the pointer to the value of the data type "Variant". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagValueWait(LPDM_VARKEY lpdmVarKey, LPVARIANT lpdmValue, PDWORD dwState, LPCMN_ERROR lpdmError);
Parameters lpdmVarKey
Pointer to a structure of the data type "DM_VARKEY"
lpdmValue
Pointer to the value of data type "Variant". A description of the data type VARIANT can be found in the associated documentation.
dwState
Tag status which is returned after the function has been run.
1451
lpdmError
Pointer to the structure which contains the error description
FALSE
An error has occurred.
See also
Structure definition CMN_ERROR (Page1546) Tag statuses (Page1543) Structure definition DM_VAR_UPDATE_STRUCT (Page1548) Structure definition DM_VARKEY (Page1550) Principle of the SetTag functions (Page1417)
SetTagWordWait Function
Sets the value of a tag of the data type "unsigned 16 Bit". The function is ended after the AS has acknowledged acceptance of the value.
Syntax
BOOL SetTagWordWait(Tag Tag_Name, WORD value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "WORD"
1452
FALSE
An error has occurred.
See also
SetTagWord example (Page1528) Principle of the SetTag functions (Page1417)
SetTagBit Function
Sets the value of a tag of data type "Binary tag".
Syntax
BOOL SetTagBit(Tag Tag_Name, short int value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "short int"
1453
FALSE
An error has occurred.
See also
Principle of the SetTag functions (Page1417) SetTagBit example (Page1522)
SetTagByte Function
Sets the value of a tag of the data type "unsigned 8 Bit".
Syntax
BOOL SetTagByte(Tag Tag_Name, BYTE value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "BYTE"
FALSE
An error has occurred.
See also
SetTagWord example (Page1528) Principle of the SetTag functions (Page1417)
1454
SetTagChar Function
Sets the value of a tag of the data type " 8-bit text tag" or "16-bit text tag".
Parameter Tag_Name
Name of the tag
Value
Value of the tag in the data type "LPSTR"
FALSE
An error has occurred.
See also
SetTagChar example (Page1523) Principle of the SetTag functions (Page1417)
SetTagDouble Function
Defines the value of a tag of the data type "64-bit floating point value".
Syntax
BOOL SetTagDouble(Tag Tag_Name, double value);
1455
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "double"
FALSE
An error has occurred.
See also
SetTagFloat example (Page1524) Principle of the SetTag functions (Page1417)
SetTagDWord Function
Sets the value of a tag of the data type "unsigned 32 Bit".
Syntax
BOOL SetTagDWord(Tag Tag_Name, DWORD value);
Parameters Tag_Name
name of the tag
1456
value
Value of the tag in the data type "DWORD"
FALSE
An error has occurred.
See also
SetTagWord example (Page1528) Principle of the SetTag functions (Page1417)
SetTagFloat Function
Defines the value of a tag of the data type "32-bit floating point value".
Syntax
BOOL SetTagFloat(Tag Tag_Name, float value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "float"
1457
FALSE
An error has occurred.
See also
SetTagFloat example (Page1524) Principle of the SetTag functions (Page1417)
SetTagRaw Function
Sets the value of a tag of the data type "Raw data type".
Syntax
BOOL SetTagRaw(Tag Tag_Name, BYTE* pValue, DWORD size);
Parameters Tag_Name
name of the tag
pValue
The pointer to a byte field which contains the value of the raw data tag
size
Size of the byte field in bytes
1458
FALSE
An error has occurred.
See also
SetTagRaw example (Page1526) Principle of the SetTag functions (Page1417)
SetTagSByte Function
Sets the value of a tag of the data type "signed 8 bit".
Syntax
BOOL SetTagSByte(Tag Tag_Name, signed char value);
Parameters Tag_Name
name of the tag
value
The value of the tag in the data type "signed char"
1459
FALSE
An error has occurred.
See also
SetTagSByte example (Page1527) Principle of the SetTag functions (Page1417)
SetTagSDWord Function
Sets the value of a tag of the data type "signed 32 bit".
Syntax
BOOL SetTagSDWord(Tag Tag_Name, long value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "long"
FALSE
An error has occurred.
See also
SetTagSByte example (Page1527) Principle of the SetTag functions (Page1417)
1460
SetTagSWord Function
Sets the value of a tag of the data type "signed 16 bit".
Syntax
BOOL SetTagSWord(Tag Tag_Name, short value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "short"
size
Size of the byte field in bytes
FALSE
An error has occurred.
See also
SetTagSByte example (Page1527) Principle of the SetTag functions (Page1417)
1461
SetTagValue Function
Enables the transfer of a value in the form of a variant and sets the pointer to the value of the data type "Variant".
Syntax
BOOL SetTagValue(LPDM_VARKEY lpdmVarKey, LPVARIANT lpdmValue, PDWORD dwState, LPCMN_ERROR lpdmError);
Parameters lpdmVarKey
Pointer to a structure of the data type "DM_VARKEY"
lpdmValue
Pointer to the value of data type "Variant". A description of the data type VARIANT can be found in the associated documentation.
dwState
Tag status which is returned after the function has been run.
lpdmError
Pointer to the structure which contains the error description
FALSE
An error has occurred.
1462
See also
Principle of the SetTag functions (Page1417) Structure definition CMN_ERROR (Page1546) Tag statuses (Page1543) Structure definition DM_VAR_UPDATE_STRUCT (Page1548) Structure definition DM_VARKEY (Page1550)
SetTagWord Function
Sets the value of a tag of the data type "unsigned 16 Bit".
Syntax
BOOL SetTagWord(Tag Tag_Name, WORD value);
Parameters Tag_Name
name of the tag
value
Value of the tag in the data type "WORD"
FALSE
An error has occurred.
See also
SetTagWord example (Page1528) Principle of the SetTag functions (Page1417)
1463
3.3.6
3.3.6.1
WinCC
WinCC - short description
The functions of the WinCC group allow to define various setting in Runtime. The functions of the System subgroup can be used to influence WinCC Runtime. Note Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well.
3.3.6.2
system
DeactivateRTProject Function
Deactivates the activated project. Note If Runtime is exited on a server or client this applies only to the respective computer. An activated project for which the WinCC Explorer has not been started must be closed with the internal function "ExitWinCC". If the activated project was exited with the internal function "DeactivateRTProject" the WinCC project remains open in the background. To close this project, the WinCC Explorer must be opened and then be closed by means of the menu commands "File" > "Exit".
Syntax
BOOL DeactivateRTProject();
1464
FALSE
An error has occurred.
See also
DeactivateRTProject example (Page1473)
ExitWinCC Function
Deactivates Runtime and exits WinCC on the computer executing the function. Note If Runtime is exited on a server or client this applies only to the respective computer. An activated project for which the WinCC Explorer has not been started must be closed with the internal function "ExitWinCC". If the activated project was exited with the internal function "DeactivateRTProject" the WinCC project remains open in the background. To close this project, the WinCC Explorer must be opened and then be closed by means of the menu commands "File" > "Exit".
Syntax
BOOL ExitWinCC ();
FALSE
An error has occurred.
See also
ExitWinCC example (Page1474)
1465
GetLanguage Function
Determines the current Runtime language.
Syntax
DWORD GetLanguage();
Return value
The current Runtime language with the associated language identifier is returned. Note You can find a comprehensive "Language code" table in the "Basic Principles of VBScript" documentation under the index entry "Language code".
See also
GetLanguage example (Page1481)
InquireLanguage Function
Determines all languages configured in the text library for the runtime. Use dWCount to specify where the number of determined language IDs is to be stored.
Syntax
DWORD* InquireLanguage(DWORD* dwCount);
Parameters dwCount
Pointer to the number of determined language IDs
1466
Return value
The configured languages with the associated language identifiers are returned. Note You can find a comprehensive "Language code" table in the "Basic Principles of VBScript" documentation under the index entry "Language code".
See also
InquireLanguage example (Page1509)
SetLanguage Function
Changes the language setting in Runtime.
Syntax
BOOL SetLanguage(DWORD dwLocaleID);
Parameters dwLocaleID
Language ID of the language to be set
FALSE
An error has occurred.
1467
See also
Language ID (Page1542) SetLanguage example (Page1517)
3.3.6.3 Function
FillDiagnoseInTags
Activates or deactivates the storage of diagnostic information in tags. As filling the tags is an additional load for the system, it should only be activated temporarily for diagnostic information.
Syntax
void FillDiagnoseInTags(BOOL bfill);
Parameters bFill
Storage of diagnostic information in tags on/off TRUE Activate supply of diagnostic tags FALSE Deactivate supply of diagnostic tags
1468
3.3.6.4 Function
GetServerTagPrefix
To be able to access tags of the respective server from a WinCC client in a distributed system, the tag names must be supplemented with the server prefix. If the tags are accessed by means of the functions GetTagxx or SetTagxx, the required addition is made by the script control. If WinCC API functions are used for accessing, the tag names have to be supplemented by the user. The GetServer TagPrefix function provides the required prefixes. One pointer each of the "char" type to ServerPrefix, TagPrefix and WindowPrefix is returned. The user must neither change the memory (also no strcat) nor release it.
Syntax
void GetServerTagPrefix(char** ppszServerPrefix, char** ppszTagPrefix, char** ppszWindowPrefix);
Parameters ppszServerPrefix
Pointer to a pointer referring to the server prefix
ppszTagPrefix
Pointer to a pointer referring to the tag prefix
ppszWindowPrefix
Pointer to a pointer referring to the window prefix
See also
GetServerTagPrefix example (Page1491) GetServerTagPrefix example (Page1492)
3.3.6.5 Function
TraceText
The value defined in <Parameter> is recorded in APDiag if the specified diagnostic level has been reached.
1469
Syntax
void TraceText(DWORD dwTraceLevel, char* pszFormat, <Parameter>);
Parameters dwTraceLevel
Diagnostic level
pszFormat
Output format (according to printf function)
<Parameter>
Value to be reported Note The parameterization dialog for this function provides the selection of tags, graphic objects and pictures.
3.3.6.6 Function
TraceTime
The value defined in <Parameter> is recorded in APDiag if the specified diagnostic level has been reached. In addition, the time since the AP start of diagnosis is output in milliseconds to enable performance measurements.
Syntax
void TraceTime(DWORD dwTraceLevel, char* pszFormat, <Parameter>);
Parameters dwTraceLevel
Diagnostic level
1470
pszFormat
Output format (according to printf function)
<Parameter>
Value to be reported Note The parameterization dialog for this function provides the selection of tags, graphic objects and pictures.
3.4
3.4.1
3.4.1.1
Appendix
Examples
Examles - A to G
AcknowledgeMessage example
{ //Acknowledge the AlarmLogging message which is selected AcknowledgeMessage(GetTagWord("U08i_MsgNr")); }
AXC_OnBtnMsgFirst example
{ // jump to the first message in the WinCC Alarm Control AXC_OnBtnMsgFirst("gs_alarm_00","Control1"); }
Parameters of the AXC_OnBtnMsgFirst function: "gs_alarm_00" is the name of the picture in which WinCC Alarm Control was configured. Control1 is the object name of the WinCC Alarm Control.
1471
Beispiel AXC_OnBtnMsgLast
{ // jump to the last message in the WinCC Alarm Control AXC_OnBtnMsgLast("gs_alarm_00","Control1"); }
Parameters of the AXC_OnBtnMsgLast function: "gs_alarm_00" is the name of the picture in which WinCC Alarm Control was configured. Control1 is the object name of the WinCC Alarm Control.
AXC_OnBtnScroll example
{ // activate/deactivate the scroll function AXC_OnBtnScroll("gs_alarm_00","Control1"); }
Parameters of the AXC_OnBtnScroll function: "gs_alarm_00" is the name of the picture in which WinCC Alarm Control was configured. Control1 is the object name of the WinCC Alarm Control.
AXC_OnBtnSinglAckn example
{ // acknowledge the active message AXC_OnBtnSinglAckn("gs_alarm_00","Control1"); }
Parameters of the AXC_OnBtnSinglAckn function: "gs_alarm_00" is the name of the picture in which WinCC Alarm Control was configured. Control1 is the object name of the WinCC Alarm Control.
1472
AXC_SetFilter example
{ BOOL ret; MSG_FILTER_STRUCT Filter; CMN_ERROR Error; //Reset the filter struct memset( &Filter, 0, sizeof( MSG_FILTER_STRUCT ) ); //Set the filter name strcpy( Filter.szFilterName, "Control1"); // Choose selection elements Filter.dwFilter = MSG_FILTER_NR_FROM | MSG_FILTER_NR_TO; // Message number from Filter.dwMsgNr[0] = 2; // Message number to Filter.dwMsgNr[1] = 2; ret = AXC_SetFilter("gs_alarm_00","Control1",&Filter,&Error); }
1. Name the filter. 2. Select the filter type. 3. Specify the filter criteria. 4. Set the filter. Note The filter type and the filter criteria are to be adapted, all other filter types are described in the filter structure.
DeactivateRTProject example
{ //deactivate the runtime DeactivateRTProject (); }
1473
ExitWinCC example
{ //exit wincc ExitWinCC (); }
3.4.1.2
GetAlarmHigh example
{ double dAlarmHigh; //Get the Alarm High Limit dAlarmHigh = GetAlarmHigh(lpszPictureName,"Bar1"); //User defined code where the //user can do something with the return value ... }
Parameters of the function GetAlarmHigh: "lpszPictureName" is the name of the picture in which the object was configured. "Bar1" is the name of the object. 1. Read out the upper alarm limit and temporarily store it in dAlarmHigh. 2. Executing user-defined code for processing return values.
GetBackColor example
{ long int bk_color; //Get the background color bk_color = GetBackColor(lpszPictureName,"StatischerText1"); //User defined code where the //user can do something with the return value ... }
1474
GetBorderStyle example
{ long int lstyle; //Get the current border style lstyle = GetBorderStyle(lpszPictureName,"Rectangle1"); //User defined code where the //user can do something with the return value ... }
Parameters of the function GetBorderStyle: "lpszPictureName" is the name of the picture in which the object was configured. "Rectangle1" is the name of the object. 1. Read out the current line style of the object and temporarily store it in lstyle. 2. Executing user-defined code for processing return values.
GetFilling example
{ BOOL bfilling; //Get the actual state of dynamic filling bfilling = GetFilling(lpszPictureName,"Rectangle1"); if(bfilling) { // User defined code if the // dynamic filling is activated ... } Else
1475
Parameters of the function GetFilling: "lpszPictureName" is the name of the picture in which the object was configured. "Rectangle1" is the name of the object. 1. Read out whether dynamic filling is activated or not and temporary store in bfilling. 2. Executing user-defined code, depending on the return value of the function.
GetFillingIndex example
{ long int filling_index; //Get the actual filling index of the object filling_index = GetFillingIndex(lpszPictureName,"Rectangle1"); //User defined code where the //user can do something with the return value ... }
Parameters of the function GetFillingIndex: "lpszPictureName" is the name of the picture in which the object was configured. "Rectangle1" is the name of the object. 1. Read out the current fill level of the object and temporarily store it in filling_index. 2. Executing user-defined code for processing return values.
GetFillStyle example
{ long int lstyle; //Get the current fill style lstyle = GetFillStyle(lpszPictureName,"Rectangle1");
1476
//User defined code where the //user can do something with the return value ... }
Parameters of the function GetFillStyle: "lpszPictureName" is the name of the picture in which the object was configured. "Rectangle1" is the name of the object. 1. Read out the current fill pattern of the object and temporarily store it in lstyle. 2. Executing user-defined code for processing return values.
GetFlashBackColor example
{ BOOL bflash_col; //Get if the flashing is on or off bflash_col = GetFlashBackColor(lpszPictureName,"Group1"); if(bflash_col) { // User defined code if the // flashing is activated ... } Else { // User defined code if the // flashing is deactivated ... } }
Parameters of the function GetFlashBackColor: "lpszPictureName" is the name of the picture in which the object was configured. "Group1" is the name of the object. 1. Read out whether flashing of the background color is activated or not and temporary store in bflash_col. 2. Executing user-defined code, depending on the return value of the function.
1477
GetFlashBackColorOn example
{ long int flashcol_on; //Get the BackFlashColor flashcol_on = GetBackFlashColorOn(lpszPictureName,"Group1"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetBackFlashColorOn function: "lpszPictureName" is the name of the picture in which the object was configured. "Group1" is the name of the object. 1. Read out the background flash color for the "On" status of the obvject and and temporarily store it in flashcol_on. 2. Executing user-defined code for processing return values.
GetFlashRateFlashPic example
{ long lFlashRate; //Get the flashrate lFlashRate = GetFlashRateFlashPic(lpszPictureName,"StatusDisplay1"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetFlashRateFlashPic function: "lpszPictureName" is the name of the picture in which the object was configured. "Status display1" is the name of the object. 1. Read out the flash frequency of the object and temporarily store it in lFlashRate. 2. Executing user-defined code for processing return values.
1478
GetFocus example
{ char* pszValue = NULL; char szValue[_MAX_PATH+1]; //Get the Object which has the focus pszValue = Get_Focus(); //Copy the string if(pszValue != NULL) { strncpy(szValue,pszValue,_MAX_PATH); } //User defined code where the //user can do something with the return value ... }
1. Read out on which object the focus is and temporarily store in pszValue. 2. If a valid value has been returned, store the return value of the function in the local string szValue. A maximum of _MAX_PATH characters is stored. 3. Executing user-defined code for processing return values.
GetFontBold example
{ BOOL bbold; //Get if the text is bold bbold = GetFontBold(lpszPictureName,"StaticText1"); if(bbold) { // User defined code if the // font is bold ... } Else { // User defined code if the // font is not bold ... } }
Parameters of the GetBackColor function "lpszPictureName" is the name of the picture in which the object was configured.
1479
GetFontSize example
{ long int fontsize; //Get the actual Font size fontsize = GetFontSize(lpszPictureName,"StaticText1"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetFontSize function: "lpszPictureName" is the name of the picture in which the object was configured. "StaticText1" is the name of the object. 1. Read out the current font size and temporarily store it in fontsize. 2. Executing user-defined code for processing return values.
GetHeight example
{ long lHeight; //Get the height of the object lHeight = GetHeight(lpszPictureName,"WinCCLogo"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetHeight function: "lpszPictureName" is the name of the picture in which the object was configured. "WinCCLogo" is the name of the object.
1480
GetHiddenInput example
{ BOOL bHiddenInput; //Get the state of hidden input bHiddenInput = GetHiddenInput(lpszPictureName,"IOField1"); if(bHiddenInput) { // User defined code if the // hidden input is activated ... } Else { // User defined code if the // hidden input is activated ... } }
Parameters of the GetHiddenInput function: "lpszPictureName" is the name of the picture in which the object was configured. "IOField1" is the name of the object. 1. Read out whether the text is in bold or not and temporarily store in bHiddenInput. 2. Executing user-defined code, depending on the return value of the function.
GetLanguage example
{ DWORD rt_language; //Get the current language rt_language = GetLanguage (); //User defined code where the //user can do something with the return value ... }
1. Read out the current Runtime language and temporarily store it in rt_language.
1481
GetLeft example
{ long lPos; //Get the x-position of the object lPos = GetLeft(lpszPictureName,"WinCCLogo"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetLeft function: "lpszPictureName" is the name of the picture in which the object was configured. "WinCCLogo" is the name of the object. 1. Read out the current X position of the object and temporarily store it in lPos. 2. Executing user-defined code for processing return values.
GetLink example
{ LINKINFO linkinfo; //Get the linked Tag GetLink(lpszPictureName,"Bar1","Process",&linkinfo); // linkinfo.szLinkName is the tag name // linkinfo.dwCycle is the update cycle // linkinfo.LinkType is the type of the connection //User defined code where the //user can do something with the return value ... }
Parameters of the GetLink function: "lpszPictureName" is the name of the picture in which the object was configured. "Bar1" is the name of the object. "Process" is the property connected to a tag.
1482
GetLinkedVariable example
{ char* pszVarName = NULL; char szVarName[_MAX_PATH+1]; //Get the TagName pszVarName = GetLinkedVariable("gs_stand_graph_00","StaticText6","Visible"); //Copy the string if (strcmp (pszVarName,"")!= 0) { strncpy(szVarName,pszVarName,_MAX_PATH); } else printf("Attribute 'visible' is not made dynamic\r\n"); } //User defined code where the //user can do something with the return value ... }
Parameters of the GetLinkedVariable function: "gs_stand_graph_00" is the name of the picture in which the object was configured. "StaticText6" is the name of the object. "Visible" is the property connected to a tag. 1. Temporarily store the return value of the GetLinkedVariable function in pszVarName. 2. If a valid value has been returned, store the return value in szVarName. A maximum of _MAX_PATH characters is stored. 3. Executing user-defined code for processing return values.
GetLocalPicture example
{ char* pszPicName = NULL; char szPicName[_MAX_PATH+1]; //Get the Local Picture pszPicName = GetLocalPicture(lpszPictureName);
1483
//Copy the string if (pszPicName != NULL) { strncpy(szPicName,pszPicName,_MAX_PATH); } //User defined code where the //user can do something with the return value ... }
1. Temporarily store the return value of the GetLocalPicture function in pszPicName. 2. If a valid value has been returned, store the return value in szPicName. A maximum of _MAX_PATH characters is stored. 3. Executing user-defined code for processing return values.
GetMarker example
{ BOOL bmarker; //Get the state of the Marker bmarker = GetMarker(lpszPictureName,"Bar1"); if(bmarker) { // User defined code if the // marker is activated ... } Else { // User defined code if the // marker is deactivated ... } }
Parameters of the GetMarker function: "lpszPictureName" is the name of the picture in which the object was configured. "Bar1" is the name of the object. 1. Read out whether the marker is displayed or not and temporarily store in bmarker. 2. Executing user-defined code, depending on the return value of the function.
1484
GetOutputValueDouble example
{ double doutput; //Get the output value of IO Field 1 doutput = GetOutputValueDouble(lpszPictureName,"IOField1"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetOutputValueDouble function: "lpszPictureName" is the name of the picture in which the object was configured. "IOField1" is the name of the object. 1. Read out the output value and temporarily store it in doutput. 2. Executing user-defined code for processing return values.
GetParentPicture example
{ char* pszPicName = NULL; char szPicName[_MAX_PATH+1]; //Get the parent picture pszPicName = GetParentPicture(lpszPictureName); //Copy the string if (pszPicName != NULL) { strncpy(szPicName,pszPicName,_MAX_PATH); } //User defined code where the //user can do something with the return value ... }
1. Temporarily store the return value of the GetParentPicture function in pszPicName. 2. If a valid value has been returned, store the return value in szPicName. A maximum of _MAX_PATH characters is stored. 3. Executing user-defined code for processing return values.
1485
GetPictureDown example
{ char* pszPicName = NULL; char szPicName[_MAX_PATH+1]; //Get the current picture name pszPicName = GetPictureDown(lpszPictureName,"Roundbutton1"); if (pszPicName != NULL) { //Copy the string strncpy(szPicName,pszPicName,_MAX_PATH); } //User defined code where the //user can do something with the return value ... }
Parameters of the GetPictureDown function: "lpszPictureName" is the name of the picture in which the object was configured. "RoundButton1" is the name of the object. 1. Read out the picture name of the picture displayed in round button 1 and temporarily store it in pszPicName. 2. If a valid value has been returned, store the return value of the function in the local string szPicName. A maximum of _MAX_PATH characters is stored. 3. Executing user-defined code for processing return values.
GetPictureName example
{ char* pszPictureName = NULL; char szPictureName[_MAX_PATH + 1]; //Get the current PictureName pszPictureName = GetPictureName(lpszPictureName,"GraphicObject1"); if(pszPictureName != NULL) { //copy the string strncpy(szPictureName,pszPictureName,_MAX_PATH); } //User defined code where the //user can do something with the return value
1486
... }
Parameters of the GetPictureName function: "lpszPictureName" is the name of the picture in which the object was configured. "GraphicObject1" is the name of the object. 1. Read out the picture name of the picture displayed in graphic object 1 and temporarily store it in pszPictureName. 2. If a valid value has been returned, store the return value of the function in the local string szPictureName. A maximum of _MAX_PATH characters is stored. 3. Executing user-defined code for processing return values.
GetPictureUp example
{ char* pszPicName = NULL; char szPicName[_MAX_PATH+1]; //Get the current picture name pszPicName = GetPictureUp(lpszPictureName,"Roundbutton1"); if (pszPicName != NULL) { //Copy the string strncpy(szPicName,pszPicName,_MAX_PATH); } //User defined code where the //user can do something with the return value ... }
Parameters of the GetPictureUp function: "lpszPictureName" is the name of the picture in which the object was configured. "RoundButton1" is the name of the object. 1. Read out the picture name of the picture displayed in round button 1 and temporarily store it in pszPicName. 2. If a valid value has been returned, store the return value of the function in the local string szPicName. A maximum of _MAX_PATH characters is stored. 3. Executing user-defined code for processing return values.
1487
GetPosition example
{ long int lpos; //Get the actual position of the Slider lpos = GetPosition(lpszPictureName,"Control1"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetPosition function: "lpszPictureName" is the name of the picture in which the object was configured. "Control1" is the name of the object. 1. Read out the current slider position and temporarily store it in lpos. 2. Executing user-defined code for processing return values.
GetPropBOOL example
{ BOOL bProp; //Get the property Visible bProp = GetPropBOOL("gs_graph_eafield","IOField1","Visible"); if(bProp) { // User defined code if the // object is visible ... } else { // User defined code if the // object is not visible ... } }
Parameters of the GetVisible function: "lpszPictureName" is the name of the picture in which the object was configured.
1488
GetPropChar example
{ char* pszProp = NULL; char szProp[14]; //Get the property Tooltiptext pszProp = GetPropChar("lpszPictureName","EAFeld1","Tooltiptext"); if(pszProp != NULL) { //Copy the string strncpy(szProp,pszProp,13); } //User defined code where the //user can do something with the return value ... }
Parameters of the GetPropChar function: "lpszPictureName" is the name of the picture in which the object was configured. "IOField1" is the name of the object. "Tooltiptext" is the object property. 1. Read out the tooltip text of the object and temporarily store it in pszProp. 2. If a valid value has been returned, store the return value of the function in the local string szProp. A maximum of 13 characters is stored. 3. Executing user-defined code for processing return values.
3.4.1.3
GetRangeMax example
{ long int lrange;
1489
//Get the upper scale Limit lrange = GetRangeMax(lpszPictureName,"Control1"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetRangeMax function: "lpszPictureName" is the name of the picture in which the object was configured. "Control1" is the name of the object. 1. Read out the current upper limit of the object and temporarily store it in lrange. 2. Executing user-defined code for processing return values.
GetRangeMin example
{ long int lrange; //Get the lower scale Limit lrange = GetRangeMin(lpszPictureName,"Control1"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetRangeMin function: "lpszPictureName" is the name of the picture in which the object was configured. "Control1" is the name of the object. 1. Read out the current lower limit of the object and temporarily store it in lrange. 2. Executing user-defined code for processing return values.
Beispiel GetScaling
{ BOOL bscaling; //Get the Scaling state bscaling = GetScaling(lpszPictureName,"Bar1");
1490
if (bscaling) { // User defined code if the // bar object has an additional scale ... } Else { // User defined code if the // bar object has no additional scale ... } }
Parameters of the GetScaling function: "lpszPictureName" is the name of the picture in which the object was configured. "Bar1" is the name of the object. 1. Read out whether the scale of the bar is displayed or not and temporarily store in bscaling. 2. Executing user-defined code, depending on the return value of the function.
GetServerTagPrefix example
{ char* pszServerPrefix; char* pszTagPrefix; char* pszWindowPrefix; int nServerPrefixLen = 0; int nTagPrefixLen = 0; int nTagLen = 0; char myTagName[MAX_DM_VAR_NAME+1]; //Initialize the return value memset(myTagName,0,MAX_DM_VAR_NAME + 1); //Get the serverprefix the tagprefix and the windowprefix GetServerTagPrefix(&pszServerPrefix, &pszTagPrefix, &pszWindowPrefix); //If a serverprefix exists if (pszServerPrefix) { //Get the length of the string nServerPrefixLen = strlen(pszServerPrefix); } Else { printf("No server prefix was returned.");
1491
return; } //If a tagprefix exists if (pszTagPrefix) { //Get the length of the string nTagPrefixLen = strlen(pszTagPrefix); } //Get the length of the tag nTagLen = strlen("TagName"); //Check if the lenght of the //ServerPrefix+TagPrefix+VarName + the double points < MAX_DM_VAR_NAME) if (nServerPrefixLen + nTagPrefixLen + nTagLen+2 < MAX_DM_VAR_NAME) { sprintf(myTagName,"%s::%s%s",pszServerPrefix,pszTagPrefix,"TagName"); //User defined code where the //user can do something with the return value ... } Else { printf("The resulting string is too long."); return; } }
1. Initialize the myTagName tag. 2. Read out the server prefix, the tag prefix and the window prefix. 3. If no server prefix has been returned, a text ist output and the function is terminated. 4. If a server prefix has been returned, determine its length and temporarily store it in nServerPrefixLen. 5. If a tag prefix has been returned, determine its length and temporarily store it in TagPrefixLen. 6. Determine the length of the tag name and temporarily store it in nVarLen. 7. If the length permitted for tag names is exceeded a text is output and the function is terminated. 8. If the length permitted for tag names is not exceeded, the tag name required for a client environment is compiled. 9. Executing user-defined code for processing return values.
GetServerTagPrefix example
{ char* pszServerPrefix; char* pszTagPrefix;
1492
char* pszWindowPrefix; //Get the serverprefix and the tagprefix GetServerTagPrefix(&pszServerPrefix, &pszTagPrefix, &pszWindowPrefix); //User defined code where the //user can do something with the return value ... }
Parameters of the GetServerTagPrefix function: "pszServerPrefix" is the tag which is written into the server prefix. "pszTagPrefix" is the tag which is written into the tag prefix. "pszWindowrPrefix" is the tag which is written into the window prefix. 1. Read out the server prefix, the tag prefix and the window prefix. 2. The pszServerPrefix tag contains the returned server prefix. 3. The pszTagPrefix tag contains the returned tag prefix. 4. The pszWindowPrefix tag contains the returned window prefix. 5. Executing user-defined code for processing return values.
GetTagBit example
{ BOOL bstate; //Get the current state of the tag bstate = GetTagBit("gs_tag_bit"); if(bstate) { // User defined code if the // value of the tag is true ... } else { // User defined code if the // value of the tag is false ... } }
1493
GetTagBitStateQC example
{ DWORD dwState; DWORD dwQC; BOOL bValue; dwState = 0xFFFFFFFF; //Get the tag value //dwstate is the tag state bValue = GetTagBitStateQCWait("gs_tag_bit",&dwState,&dwQC); //Create a string which includes the tag value if (bValue) { // User defined code if the // value of the tag is true ... } else { // User defined code if the // value of the tag is false ... } }
Parameters of the GetTagBitStateQC function: "gs_tag_bit" is the name of the tag. "&dwState" is the address of the tags in which the tag status is to be stored. "&dwQC" is the address of the tag in which the quality code is to be stored. 1. Read out the value of the tag and temporarily store it in bValue. The function puts the tag status in dwState and the quality code in dwQC. 2. Executing user-defined code, depending on the return value of the function.
1494
GetTagBitStateWait example
{ DWORD dwstate; BOOL bValue; dwstate = 0xFFFFFFFF; //Get the tag value //dwstate is the tag state bValue = GetTagBitStateWait("gs_tag_bit",&dwstate); //Create a string which includes the tag value if (bValue) { // User defined code if the // value of the tag is true ... } else { // User defined code if the // value of the tag is false ... } }
Parameters of the GetTagBitStateWait function: "gs_tag_bit" is the name of the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Read out the value of the tag and temporarily store it in bstate. The function puts the tag status in dwstate. 2. Executing user-defined code, depending on the return value of the function.
GetTagChar example
{ char* pszValue = NULL; char szValue[13]; //Get the current value of the tag pszValue = GetTagChar("gs_tag_char"); if(pszValue != NULL) { //Copy the string strncpy(szValue,pszValue,12);
1495
} //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagChar function: "gs_tag_char" is the name of the tag. 1. Reading the value of the tag and temporarily storing in pszValue. 2. If a valid value has been returned, store the return value of the function in the local string szValue. A maximum of 12 characters is stored. 3. Executing user-defined code for processing return values.
GetTagCharStateQCWait example
{ DWORD dwState; DWORD dwQC; char* pszRetValue = NULL; char szRetValue[13]; dwState = 0xFFFFFFFF; //Get the tag value pszRetValue = GetTagCharStateQCWait("gs_tag_char",&dwState, &dwQC); if (pszRetValue != NULL) { //Copy the string strncpy(szRetValue,pszRetValue,12); } //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagCharStateQCWait function: "gs_tag_char" is the name of the tag. "&dwState" is the address of the tags in which the tag status is to be stored. "&dwQC" is the address of the tag in which the quality code is to be stored. 1. Read out the value of the tag and temporarily store it in pszRetValue. The function puts the tag status in dwState and the quality code in dwQC.
1496
Beispiel GetTagCharStateWait
{ DWORD dwstate; char szValue[11]; char* pszRetValue = NULL; char szRetValue[13]; dwstate = 0xFFFFFFFF; //Get the tag value //dwstate is the tag state pszRetValue = GetTagCharStateWait("gs_tag_char",&dwstate); if (pszRetValue != NULL) { //Copy the string strncpy(szRetValue,pszRetValue,12); } //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagCharStateWait function: "gs_tag_char" is the name of the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Read out the value of the tag and temporarily store it in pszRetValue. The function puts the tag status in dwstate. 2. If a valid value has been returned, store the return value of the function in the local string szRetValue. A maximum of 12 characters is stored. 3. Executing user-defined code for processing return values.
GetTagFloat example
{ float fValue; //Get the current value of the tag fValue = GetTagFloat("gs_tag_float");
1497
//User defined code where the //user can do something with the return value ... }
Parameters of the GetTagFloat function: "gs_tag_float" is the name of the tag. 1. Read out the value of the tag and temporarily store it in fValue. 2. Executing user-defined code for processing return values.
GetTagFloatStateQCWait example
{ DWORD dwState; DWORD dwQC; float fValue; dwState = 0xFFFFFFFF; //Get the tag value fValue = GetTagFloatStateQCWait("gs_tag_float",&dwState, &dwQC); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagFloatStateQCWait function: "gs_tag_float" is the name of the tag. "&dwState" is the address of the tags in which the tag status is to be stored. "&dwQC" is the address of the tag in which the quality code is to be stored. 1. Read out the value of the tag and temporarily store it in fValue. The function puts the tag status in dwState and the quality code in dwQC. 2. Executing user-defined code for processing return values.
GetTagFloatStateWait example
{ DWORD dwstate; float fValue;
1498
dwstate = 0xFFFFFFFF; //Get the tag value //dwstate is the tag state fValue = GetTagFloatStateWait("gs_tag_float",&dwstate); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagFloatStateWait function: "gs_tag_float" is the name of the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Read out the value of the tag and temporarily store it in fValue. The function puts the tag status in dwstate. 2. Executing user-defined code for processing return values.
GetTagMultiStateQCWait example
{ #define DATA_SIZE 5 DWORD dwState[DATA_SIZE]; DWORD dwQC[DATA_SIZE]; //define all Datas BOOL lValue1; long lValue2 ; char* szValue3; double dblValue4 ; WORD lValue5 ; //Set the tags GetTagMultiStateQCWait(dwState,dwQC,"%d%d%s%f%d", "gs_tag_bit",&lValue1, "gs_tag_SByte",&lValue2, "gs_tag_char",&szValue3, "gs_tag_float",&dblValue4, "gs_tag_word",&lValue5); //User defined code where the //user can do something with the return value ... }
1499
GetTagMultiStateWait example
{ #define DATA_SIZE 5 DWORD dwData[DATA_SIZE]; //define all Datas BOOL lValue1; long lValue2 ; char* szValue3; double dblValue4 ; WORD lValue5 ; //Set the tags GetTagMultiStateWait(dwData,"%d%d%s%f%d", "gs_tag_bit",&lValue1, "gs_tag_SByte",&lValue2, "gs_tag_char",&szValue3, "gs_tag_float",&dblValue4, "gs_tag_word",&lValue5); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagMultiStateWait function: "dwData" is the DWord-Array, in which the tag statuses are stored.
1500
GetTagMultiWait example
DWORD dwVar1Value; char* szVar2Value; //Memory for the tag value is //created by teh function with SysMalloc double dbVar3Value; BOOL ok; ok=GetTagMultiWait("%d%s%f", "Ernie_word", &dwVar1Value, "Ernie_char", &szVar2Value, "Ernie_double", &dbVar3Value); printf("Word %d, String %s, Double %f\r\n", dwVar1Value, szVar2Value, dbVar3Value);
GetTagPrefix example
{ char* pszTagPrefix = NULL; char szTagPrefix[7]; //Get the current tag prefix pszTagPrefix = GetTagPrefix(lpszPictureName,"PicWindow1"); if(pszTagPrefix != NULL) { //Copy the string strncpy(szTagPrefix,pszTagPrefix,6);
1501
} //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagPrefix function: "lpszPictureName" is the name of the picture in which the object was configured. "PictureWindow1" is the name of the object. 1. Read out the current tag prefix of picture window 1 and temporarily store it in pszTagPrefix. 2. If a valid value has been returned, store the return value of the function in the local string szTagPrefix. A maximum of 6 characters is stored. 3. Executing user-defined code for processing return values.
GetTagRaw example
{ #define DATA_SIZE 3 BYTE byData[DATA_SIZE]; //Get the current values of the tag GetTagRaw("gs_tag_raw",byData,DATA_SIZE); //Use the values received in the array byData ... }
Parameters of the GetTagRaw function: "gs_tag_raw" is the name of the tag. "byData" is the byte array in which the values of the raw data tags will be stored. "DATA_SIZE" is the number of values that will be read. 1. Reading the values of the tags and temporarily storing in byData. 2. Executing user-defined code for processing return values.
1502
GetTagRawStateQCWait example
{ #define DATA_SIZE 3 DWORD dwState; DWORD dwQC; BYTE byData[DATA_SIZE]; dwState = 0xFFFFFFFF; //Get the values of the tag GetTagRawStateQCWait("gs_tag_raw",byData,DATA_SIZE,&dwState,&dwQC); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagRawStateQCWait function: "gs_tag_raw" is the name of the tag. "byData" is the byte array in which the values of the raw data tags will be stored. "DATA_SIZE" is the number of values that will be read. "&dwState" is the address of the tags in which the tag status is to be stored. "&dwQC" is the address of the tag in which the quality code is to be stored. 1. Reading the values of the tags and temporarily storing in byData. 2. Executing user-defined code for processing return values.
GetTagRawStateWait example
{ #define DATA_SIZE 3 DWORD dwstate; BYTE byData[DATA_SIZE]; char szValue[11]; //Load dwState with default values dwstate = 0xFFFFFFFF; //Get the values of the tag //dwstate is the tag state GetTagRawStateWait("gs_tag_raw",byData,DATA_SIZE,&dwstate); //User defined code where the //user can do something with the return value ...
1503
Parameters of the GetTagRawStateWait function: "gs_tag_raw" is the name of the tag. "byData" is the byte array in which the values of the raw data tags will be stored. "DATA_SIZE" is the number of values that will be read. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Reading the values of the tags and temporarily storing in byData. 2. Executing user-defined code for processing return values.
GetTagSByte example
{ long lValue; //Get the current value of the tag lValue = GetTagSByte("gs_tag_SByte"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagSByte function: "gs_tag_SByte" is the name of the tag. 1. Read the value of the tag and temporarily store it in lValue. 2. Executing user-defined code for processing return values.
GetTagSByteStateQCWait example
{ DWORD dwState; DWORD dwQC; long lValue; dwState = 0xFFFFFFFF; //Get the tag value lValue = GetTagSByteStateQCWait("gs_tag_SByte",&dwState, &dwQC);
1504
//User defined code where the //user can do something with the return value ... }
Parameters of the GetTagSByteStateQCWait function: "gs_tag_SByte" is the name of the tag. "&dwState" is the address of the tags in which the tag status is to be stored. "&dwQC" is the address of the tag in which the quality code is to be stored. 1. Read the value of the tag and temporarily store it in lValue. The function puts the tag status in dwState and the quality code in dwQC. 2. Executing user-defined code for processing return values.
GetTagSByteStateWait example
{ DWORD dwstate; long lValue; dwstate = 0xFFFFFFFF; //Get the tag value //dwstate is the tag state lValue = GetTagSByteStateWait("gs_tag_SByte",&dwstate); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagSByteStateWait function: "gs_tag_SByte" is the name of the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Read the value of the tag and temporarily store it in lValue. The function puts the tag status in dwstate. 2. Executing user-defined code for processing return values.
GetTagWord example
{
1505
WORD wValue; //Get the current value of the tag wValue = GetTagWord("gs_tag_word"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagWord function: "gs_tag_word" is the name of the tag. 1. Read out the value of the tag and temporarily store it in wValue. 2. Executing user-defined code for processing return values.
GetTagWordStateQCWait example
{ DWORD dwState; DWORD dwQC; WORD wValue; dwState = 0xFFFFFFFF; //Get the tag value wValue = GetTagWordStateQCWait("gs_tag_word",&dwState, &dwQC); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTagWordStateQCWait function: "gs_tag_word" is the name of the tag. "&dwState" is the address of the tags in which the tag status is to be stored. "&dwQC" is the address of the tag in which the quality code is to be stored. 1. Read out the value of the tag and temporarily store it in wValue. The function puts the tag status in dwState and the quality code in dwQC. 2. Executing user-defined code for processing return values.
1506
GetTagWordStateWait example
{ DWORD dwstate; WORD wValue; dwstate = 0xFFFFFFFF; //Get the tag value //dwstate is the tag state wValue = GetTagWordStateWait("gs_tag_word",&dwstate); //User defined code where the //user can do something with the return value ... }
Parameters of then GetTagWordStateWait function: "gs_tag_word" is the name of the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Read out the value of the tag and temporarily store it in wValue. The function puts the tag status in dwstate. 2. Executing user-defined code for processing return values.
GetText example
{ char* pszValue = NULL; char szValue[13]; //Get the Text which is actually set pszValue = GetText(lpszPictureName,"StaticText1"); if(pszValue != NULL) { //Copy the string strncpy(szValue,pszValue,12); } //User defined code where the //user can do something with the return value ... }
Parameters of the GetText function: "lpszPictureName" is the name of the picture in which the object was configured. "StaticText1" is the name of the object.
1507
GetTop example
{ long lPos; //Get the y-Position of the Object lPos = GetTop(lpszPictureName,"WinCCLogo"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetTop function: "lpszPictureName" is the name of the picture in which the object was configured. "WinCCLogo" is the name of the object. 1. Read out the current Y position of the object and temporarily store it in lPos. 2. Executing user-defined code for processing return values.
GetVisible example
{ BOOL bVisible; //Get the visibility bVisible = GetVisible(lpszPictureName,"GraphicObject1"); if(bVisible) { // User defined code if the // object is visible ... } else { // User defined code if the // object is not visible ...
1508
} }
Parameters of the GetVisible function: "lpszPictureName" is the name of the picture in which the object was configured. "GraphicObject1" is the name of the object. 1. Read out whether the object is visible or not and temporarily store in bVisible. 2. Executing user-defined code, depending on the return value of the function.
GetWidth example
{ long lWidth; //Get the width of the object lWidth = GetWidth(lpszPictureName,"WinCCLogo"); //User defined code where the //user can do something with the return value ... }
Parameters of the GetWidth function: "lpszPictureName" is the name of the picture in which the object was configured. "WinCCLogo" is the name of the object. 1. Read out the current width of the object and temporarily store it in lWidth. 2. Executing user-defined code for processing return values.
3.4.1.4
Examples - H to S
InquireLanguage example
{ DWORD count; DWORD* language; int i; //Count the installed languages language = InquireLanguage(&count);
1509
printf("##################### INQUIRE LANGUAGE ####################"); //Print out the count of languages printf ( "\r\nCount Languages=%d\r\n", count ); //print out which languages are installed for (i=1;i<=count; i++) { printf ("\r\n%d.language=%x", i,*language++); } }
1. Determine the languages configured for the runtime. In language the language IDs are temporarily stored. In count the number of languages is temporarily stored. 2. The number of determined languages is output. 3. All determined language IDs are displayed.
ProgramExecute example
{ //start the program calc.exe ProgramExecute("C:\\Winnt\\system32\\calc.exe"); }
ResetFilter example
{ BOOL ret; MSG_FILTER_STRUCT Filter; CMN_ERROR Error; //delete the whole Filter struct memset( &Filter, 0, sizeof( MSG_FILTER_STRUCT ) ); //set an empty filter struct AXC_SetFilter("gs_alarm_00","Control1",&Filter,&Error); }
1. Delete the filter structure. 2. Write empty values into the filter structure.
1510
RPTJobPreview example
{ //Start the print preview of the specified print job RPTJobPreview("Documentation Text Library"); }
Parameters of the RPTJobPreview function: @Text library (compact) is the name of the print job.
RPTJobPrint example
{ //Print the specified print job out RPTJobPrint("@Text library (compact)"); }
Parameters of the RPTJobPrint function: @Text library (compact) is the name of the print job.
SysMalloc example
char* main(...); { char* returnwert; char text[17]; returnwert=SysMalloc(17); strcpy(returnwert,&text[0]; return returnwert; }
3.4.1.5
SetAlarmHigh example
{ //Set the upper limit for the warning SetAlarmHigh(lpszPictureName,"Bar1",3.0); }
1511
SetBackColor example
{ //Set the back color blue SetBackColor(lpszPictureName,"StaticText1",CO_BLUE); }
Parameters of the SetBackColor function: "lpszPictureName" is the name of the picture in which the object was configured. "StaticText1" is the name of the object. "CO_BLUE" is the constant for the color "Blue". Note Instead of using the constant for the color value you may also specify the color by means of a hexadecimal value.
SetBorderEndStyle example
{ SetBorderEndStyle(lpszPictureName,"Line", (2|393216)); }
Sets the left line end as filled arrow and the right one as filled circle. The left line end is stored in the two lower bytes, the right line end in the two upper bytes. The parameters are transferred by means of numeric values.
Sets the left line end as filled arrow and the right one as filled circle. The left line end is stored in the two lower bytes, the right line end in the two upper bytes. To address the right line end the symbolic designation "LE_FULL_CIRCLE" is moved by 2 bytes or 16 bit into the two upper bytes.
1512
SetBorderStyle example
{ //Change the Border style SetBorderStyle(lpszPictureName,"Rectangle1",3); }
Parameters of the SetBorderStyle function: "lpszPictureName" is the name of the picture in which the object was configured. "Rectangle1" is the name of the object. "3" is the line style which is set for the object.
SetColorAlarmHigh example
{ //Set the Color for the alarm high limit to red SetColorAlarmHigh(lpszPictureName,"Bar1",CO_RED); }
Parameters of the SetColorAlarmHigh function: "lpszPictureName" is the name of the picture in which the object was configured. "Bar1" is the name of the object. "CO_RED" is the constant for the color red. Note Instead of using the constant for the color value you may also specify the color by means of a hexadecimal value.
Example - SetCursorMode
{ //Set the Cursor Mode to Alpha cursor SetCursorMode(lpszPictureName,"GraphikObjekt1",FALSE); }
Parameters of the SetCursorMode function: "lpszPictureName" is the name of the picture in which the object was configured. "GraphicObject1" is the name of the object.
1513
SetFilling example
{ //Set the dynamic filling true SetFilling(lpszPictureName,"Rectangle1",TRUE); }
Parameters of the SetFilling function: "lpszPictureName" is the name of the picture in which the object was configured. "Rectangle1" is the name of the object. "TRUE" means: Activating dynamic filling.
SetFillingIndex example
{ //Set the Filling of Rectangle1 to 10 SetFillingIndex(lpszPictureName,"Rectangle1",10); }
Parameters of the SetFillingIndex function: "lpszPictureName" is the name of the picture in which the object was configured. "Rectangle1" is the name of the object. "10" is the fill level which is assigned to the object.
SetFillStyle example
{ //Change the fill style SetFillStyle(lpszPictureName,"Rectangle1",196617); }
Parameters of the SetFillStyle function: "lpszPictureName" is the name of the picture in which the object was configured. "Rectangle1" is the name of the object. "196617" is the fill pattern (brick wall) which is set for the object.
1514
SetFlashBackColor example
{ //Set the flashing to True SetFlashBackColor(lpszPictureName,"Group1",TRUE); }
Parameters of the SetFlashBackColor function "lpszPictureName" is the name of the picture in which the object was configured. "Group1" is the name of the object. "TRUE" means: Activating flashing of the background color.
SetFlashBackColorOn example
{ //Set the Flash color for the state on to red SetBackFlashColorOn(lpszPictureName,"Group1",CO_RED); }
Parameters of the SetBackFlashColorOn function: "lpszPictureName" is the name of the picture in which the object was configured. "Group1" is the name of the object. "CO_Red" is the constant for the color "Red". Note Instead of using the constant for the color value you may also specify the color by means of a hexadecimal value.
SetFlashRateFlashPic example
{ //Set the flash rate to 0 SetFlashRateFlashPic(lpszPictureName,"Statusdisplay1",0); }
Parameters of the SetFlashRateFlashPic function: "lpszPictureName" is the name of the picture in which the object was configured. "Status display1" is the name of the object. "0" is the flash frequency of the object.
1515
SetFocus example
{ //Set the Focus on the Object Button 1 Set_Focus(lpszPictureName,"Button1"); }
Parameters of the Set_Focus function "lpszPictureName" is the name of the picture in which the object was configured. "Button1" is the name of the object on which the focus is set.
SetFontBold example
{ //Set the displayed Text bold SetFontBold(lpszPictureName,"StatischerText1",TRUE); }
Parameters of the SetFontBold function: "lpszPictureName" is the name of the picture in which the object was configured. "StaticText1" is the name of the object. "TRUE" means: The text is written in bold face.
SetFontSize example
{ //Set Font Size to 12 SetFontSize(lpszPictureName,"StaticText1",12); }
Parameters of the SetFontSize function: "lpszPictureName" is the name of the picture in which the object was configured. "StaticText1" is the name of the object. "12" is the font size to which the text is set.
SetHeight example
{ //Set the height of the object to 100
1516
SetHeight(lpszPictureName,"WinCCLogo",100); }
Parameters of the SetHeight function: "lpszPictureName" is the name of the picture in which the object was configured. "WinCCLogo" is the name of the object. "100" is the height to which the object is set.
SetHiddenInput example
{ //Set the hidden input true SetHiddenInput(lpszPictureName,"IOField1",TRUE); }
Parameters of the SetHiddenInput function: "lpszPictureName" is the name of the picture in which the object was configured. "IOField1" is the name of the object. "TRUE" means: Activating the hidden input.
SetLanguage example
{ //German SetLanguage(0x0407); }
SetLeft example
{ //Set the x-position to 0 SetLeft(lpszPictureName,"WinCCLogo",0); }
Parameters of the SetLeft function: "lpszPictureName" is the name of the picture in which the object was configured.
1517
SetLink example
{ LINKINFO linkinfo; //Set the link type linkinfo.LinkType = 1; //Set the update cycle linkinfo.dwCycle = 0; //set the Structmember strcpy(linkinfo.szLinkName, "U08i_link_00"); //Set the connection to the tag SetLink(lpszPictureName,"Bar1","Process",&linkinfo); }
Parameters of the SetLink function: "lpszPictureName" is the name of the picture in which the object was configured. "Bar1" is the name of the object. "Process" is the property connected to a tag. "&linkinfo" is the address of the linkinfo structure. 1. Set the connection type for the process property to direct connection. 2. Set the update cycle to "Upon change". 3. Set the tag name to U08i_link_00.
SetMarker example
{ //Set the marker visible SetMarker(lpszPictureName,"Bar1",TRUE); }
Parameters of the SetMarker function: "lpszPictureName" is the name of the picture in which the object was configured. "Bar1" is the name of the object. "TRUE" means: The marker is displayed.
1518
SetOutputValueDouble example
{ //Set the output value of the IO field to 55.5 SetOutputValueDouble(lpszPictureName,"IOField1",55.5); }
Parameters of the SetOutputValueDouble function: "lpszPictureName" is the name of the picture in which the object was configured. "IOField1" is the name of the object. "55.5" is the value which is output.
SetPictureDown example
{ //Set the picture name to activated.bmp SetPictureDown(lpszPictureName,"Roundbutton1","activated.bmp"); }
Parameters of the SetPictureDown function: "lpszPictureName" is the name of the picture in which the object was configured. "RoundButton1" is the name of the object. "activated.bmp" is the picture name of the picture to be displayed in round button 1.
SetPictureName example
{ //Set the picture name cool_man.bmp SetPictureName(lpszPictureName,"GraphicObject1","cool_man.bmp"); }
Parameters of the SetPictureName function: "lpszPictureName" is the name of the picture in which the object was configured. "GraphicObject1" is the name of the object. "cool_man.bmp" is the picture name of the picture to be displayed in graphic object 1.
1519
SetPictureUp example
{ //Set the picture name to deactivated.bmp SetPictureUp(lpszPictureName,"Roundbutton1","deactivated.bmp"); }
Parameters of the SetPictureUp function: "lpszPictureName" is the name of the picture in which the object was configured. "RoundButton1" is the name of the object. "deactivated.bmp" is the picture name of the picture to be displayed in round button 1.
SetPosition example
{ //Set the Slider Position to 30 SetPosition(lpszPictureName,"Control1",30); }
Parameters of the SetPosition function: "lpszPictureName" is the name of the picture in which the object was configured. "Control1" is the name of the object. "30" is the position to which the slider is to be set.
SetPropBOOL example
{ //Set the visibility TRUE SetPropBOOL("lpszPictureName","EAFeld1","Visible",TRUE); }
Parameters of the SetVisible function: "lpszPictureName" is the name of the picture in which the object was configured. "IOField1" is the name of the object. "TRUE" means: The object is intended to be visible.
1520
SetPropChar example
{ //Set the property Tooltiptext SetPropChar("gs_graph_eafield","IOField1","ToolTipText","Tooltiptext1 "); }
Parameters of the SetPropChar function: "lpszPictureName" is the name of the picture in which the object was configured. "IOField1" is the name of the object. "Tooltiptext" is the object property. "Tooltiptext 1" is the value to which the property is to be set.
3.4.1.6
SetRangeMax example
{ //Set the Upper Scale Limit SetRangeMax(lpszPictureName,"Control1",80); }
Parameters of the SetRangeMax function: "lpszPictureName" is the name of the picture in which the object was configured. "Control1" is the name of the object. "80" is the upper limit to be assigned to the object.
SetRangeMin example
{ //Set the lower Scale Limit SetRangeMin(lpszPictureName,"Control1",0); }
Parameters of the SetRangeMin function: "lpszPictureName" is the name of the picture in which the object was configured. "Control1" is the name of the object. "0" is the lower limit to be assigned to the object.
1521
SetScaling example
{ //Set the Scaling Visible SetScaling(lpszPictureName,"Bar1",TRUE); }
Parameters of the SetScaling function: "lpszPictureName" is the name of the picture in which the object was configured. "Bar1" is the name of the object. "TRUE" means: Making the scaling visible.
SetTagBit example
{ //Set the tag to true SetTagBit("gs_tag_bit",TRUE); }
Parameters of the SetTagBit function: "gs_tag_bit" is the name of the tag. "TRUE" is the value to be written to the tag.
Beispiel SetTagBitStateWait
{ DWORD dwstate; //Load dwState with default values dwstate = 0xFFFFFFFF; //Set the value of the tag to TRUE //dwstate is the tag state SetTagBitStateWait("gs_tag_bit",TRUE,&dwstate); //User defined code where the //user can do something with the return value ... }
1522
SetTagChar example
{ //Set the tag to Example text SetTagChar("gs_tag_char","Example Text"); }
Parameters of the SetTagChar function: "gs_tag_char" is the name of the tag. "Example text" is the value to be written to the tag.
SetTagCharStateWait example
{ DWORD dwstate; //Load dwState with default values dwstate = 0xFFFFFFFF; //Set the tag to Example Text //dwstate is the tag state SetTagCharStateWait("gs_tag_char","Example Text",&dwstate); //User defined code where the //user can do something with the return value ... }
Parameters of the SetTagCharStateWait function: "gs_tag_char" is the name of the tag. "Example text" is the value to be written to the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Setting the tags to the specified value. 2. Executing user-defined code for processing return values.
1523
SetTagFloat example
{ //Set the tag to 55.4711 SetTagFloat("gs_tag_float",55.4711); }
Parameters of the SetTagFloat function: "gs_tag_float" is the name of the tag. "55.4711" is the value to be written to the tag.
SetTagFloatStateWait example
{ DWORD dwstate; char szValue[9]; //Load dwState with default values dwstate = 0xFFFFFFFF; //Set the tag to 55.4711 //dwstate is the tag state SetTagFloatStateWait("gs_tag_float",55.4711,&dwstate); //User defined code where the //user can do something with the return value ... }
Parameters of the SetTagFloatStateWait function: "gs_tag_float" is the name of the tag. "55.4711" is the value to be written to the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Setting the tags to the specified value. 2. Executing user-defined code for processing return values.
SetTagMultiStateWait example
{ #define DATA_SIZE 5 DWORD dwData[DATA_SIZE];
1524
//define all tags BOOL lValue1; long lValue2 ; char szValue3[_MAX_PATH]; float lValue4; char lValue5; // Fill the tags with the values // you want to set into the WinCC tags ... //Set the WinCC tags SetTagMultiStateWait(dwData,"%d%d%s%f%d","gs_tag_bit",lValue1, "gs_tag_SByte",lValue2, "gs_tag_char",szValue3, "gs_tag_float",lValue4, "gs_tag_word",lValue5); //User defined code where the //user can do something with the return value ... }
Parameters of the SetTagMultiStateWait function: "dwData" is the DWord-Array, in which the tag statuses are stored. "%d%d%s%f%d" are the type descriptions of the tags to be written. "gs_tag_bit" is the WinCC tag to be written. "lValue1" is the tag to whose value the WinCC tag gs_tag_bit is to be set. "gs_tag_SByte" is the WinCC tag to be written. "&lValue2" is the tag to whose value the WinCC tag gs_tag_SByte is to be set. The other parameters are to be handled in the same way as those described previously. 1. Creating a DWord-Array with the required size (Number of tags). 2. Creating tags whose values are to be written to the WinCC tags. 3. Writing the values of the previously created and filled tags to the WinCC tags.l 4. Executing user-defined code for processing return values.
SetTagMultiWait example
BOOL ok; ok=SetTagMultiWait("%d%s%f", "Ernie_word", 16, "Ernie_char", "Hello World", "Ernie_double", 55.4711);
1525
SetTagPrefix example
{ //Set the TagPrefix to Struct1. SetTagPrefix(lpszPictureName,"PicWindow1","Struct1."); //Set the picture name again to update the tag prefix SetPictureName(lpszPictureName,"PicWindow1","gs_graph_eafield"); }
Parameters of the SetTagPrefix function: "lpszPictureName" is the name of the picture in which the object was configured. "PictureWindow1" is the name of the object. "Struct1." is the tag prefix to be set at picture window 1. 1. Set the tag prefix of the object "PictureWindow1" to "Struct1.". 2. Reset the name of the picture shown in the picture window to make the tag prefix setting effective.
SetTagRaw example
{ #define DATA_SIZE 3 BYTE byData[DATA_SIZE]; // Fill the Byte array with the values // you want to set into the raw data tag ... //Set the tag to the default values SetTagRaw("gs_tag_raw",byData,DATA_SIZE); }
Parameters of the SetTagRaw function: "gs_tag_raw" is the name of the tag. "byData" is the byte array whose values are written to the raw data tags. "DATA_SIZE" is the number of values that will be written. 1. Creating a BYTE-Array with the required size (size of the raw data tag). 2. Filling the BYTE-Array with the values to be written. 3. Writing the values of the BYTE-Array to the raw data tag.
1526
SetTagRawStateWait example
{ #define DATA_SIZE 3 BYTE byData[DATA_SIZE]; DWORD dwstate; char szValue[9]; //Load dwState with default values dwstate = 0xFFFFFFFF; // Fill the Byte array with the values // you want to set into the raw data tag ... //Set the tag to the default values //dwstate is the tag state SetTagRawStateWait("gs_tag_raw",byData,DATA_SIZE,&dwstate); //User defined code where the //user can do something with the return value ... }
Parameters of the SetTagRawStateWait function: "gs_tag_raw" is the name of the tag. "byData" is the byte array whose values are written to the raw data tags. "DATA_SIZE" is the number of values that will be written. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Creating a BYTE-Array with the required size (size of the raw data tag). 2. Filling the BYTE-Array with the values to be written. 3. Writing the values of the BYTE-Array to the raw data tag. 4. Executing user-defined code for processing return values.
SetTagSByte example
{ //Set the tag to 50 SetTagSByte("gs_tag_SByte",50); }
1527
Beispiel SetTagSByteStateWait
{ DWORD dwstate; char szValue[9]; //Load dwState with default values dwstate = 0xFFFFFFFF; //Set the tag to 50 //dwstate is the tag state SetTagSByteStateWait("gs_tag_SByte",50,&dwstate); //User defined code where the //user can do something with the return value ... }
Parameters of the SetTagSByteStateWait: "gs_tag_SByte" is the name of the tag. "50" is the value to be written to the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Setting the tags to the specified value. 2. Executing user-defined code for processing return values.
SetTagWord example
{ //Set the tag to 50 SetTagWord("gs_tag_word",50); }
Parameters of the SetTagWord function: "gs_tag_word" is the name of the tag. "50" is the value to be written to the tag.
1528
Beispiel SetTagWordStateWait
{ DWORD dwstate; char szValue[9]; //Load dwState with default values dwstate = 0xFFFFFFFF; //Set the tag to 50 //dwstate is the tag state SetTagWordStateWait("gs_tag_word",50,&dwstate); //User defined code where the //user can do something with the return value ... }
Parameters of the SetTagWordStateWait funtion: "gs_tag_word" is the name of the tag. "50" is the value to be written to the tag. "&dwstate" is the address of the tags in which the tag status is to be stored. 1. Setting the tags to the specified value. 2. Executing user-defined code for processing return values.
SetText example
{ //Set the text Example Text on the StaticText field SetText(lpszPictureName,"StaticText1","Example Text"); }
Parameters of the SetText function: "lpszPictureName" is the name of the picture in which the object was configured. "StaticText1" is the name of the object. "ExampleText" is the text which is to be output.
SetTop example
{ //Set the y-position to 0
1529
SetTop(lpszPictureName,"WinCCLogo",140); }
Parameters of the SetTop function: "lpszPictureName" is the name of the picture in which the object was configured. "WinCCLogo" is the name of the object. "140" is the Y position to which the object is set.
SetVisible example
{ //Set the Object visible SetVisible(lpszPictureName,"GraphicObject1",TRUE); }
Parameters of the SetVisible function: "lpszPictureName" is the name of the picture in which the object was configured. "GraphicObject1" is the name of the object. "TRUE" means: The object is intended to be visible.
SetWidth example
{ //Set the width of the object to 400 SetWidth(lpszPictureName,"WinCCLogo",400); }
Parameters of the SetWidth function "lpszPictureName" is the name of the picture in which the object was configured. "WinCCLogo" is the name of the object. "400" is the width to which the object is set.
3.4.1.7
Examples - T to Z
TlgGetNumberOfColumns example
{ char text[5];
1530
long int columns //get number of Columns columns = GetNumberOfColumns("TableControl_01"); //convert long int to char sprintf(text,"%d",columns); //set text on TextField5 SetText(lpszPictureName,"StaticText5",text); }
Parameters of the TlgGetNumberOfColumns function: "TableControl_01" is the name of the WinCC Table Control. 1. Temporarily store the return value of the TlgGetNumberofColumns in columns. 2. Temporarily store the return value in the text string. 3. Output the return value to a static text field. Note Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well.
TlgGetNumberOfColumns example
{ char text[5]; long int columns //get number of Columns columns = GetNumberOfColumns("TableControl_01"); //convert long int to char sprintf(text,"%d",columns); //set text on TextField5 SetText(lpszPictureName,"StaticText5",text); }
1531
TlgGetNumberOfRows example
{ char text[5]; long int rows; //get number of rows rows = TlgGetNumberOfRows("TableControl_01"); //convert long int to char sprintf(text,"%d",rows); //set text on TextField5 SetText(lpszPictureName,"StaticText5",text); }
Parameters of the TlgGetNumberOfRows function: TableControl_01 is the name of the WinCC Table Control. 1. Temporarily store the return value of the TlgGetNumberofRows in rows. 2. Temporarily store the return value in the text string. 3. Output the return value to a static text field.
TlgGetRulerTimeTrend example
{
1532
SYSTEMTIME systime; WORD wHour; WORD wMin; WORD wSec; char szTime[10]; //Get the current systemtime systime = TlgGetRulerTimeTrend("TrendControl_01",0); //Get the hour wHour = systime.wHour; //Get the minute wMin = systime.wMinute; //Get the second wSec = systime.wSecond; // sprintf(szTime,"%d:%d:%d",wHour,wMin,wSec); //output the variable name SetText(lpszPictureName,"StaticText7",szTime); }
1. Read out the current system time. 2. Read out hour, minute and second from the SYSTEMTIME structure. 3. Create a string containing the time. 4. Output the current time.
TlgGetRulerVariableNameTrend example
{ char* pszVarName = NULL; char szVarName[20]; //Get the ruler variable name pszVarName = TlgGetRulerVariableNameTrend("TrendControl_01",0); if (pszVarName != NULL) { //Copy the string strncpy(szVarName,pszVarName,19); } //output the variable name SetText(lpszPictureName,"StaticText6",szVarName); }
1533
TlgTrendWindowPressOpenDlgButton example
{ //Opens the Property Dialog TlgTrendWindowPressOpenDlgButton("TrendControl_01"); }
Parameters of the TlgTrendWindowPressOpenDlgButton function: "TrendControl_01" is the window title of WinCC Trend Control.
TlgTrendWindowPressStartStopButton example
{ //start/stop the actualization TlgTrendWindowPressStartStopButton("TrendControl_01"); }
Parameters of the TlgTrendWindowPressStartStopButton function: "TrendControl_01" is the window title of WinCC Trend Control. Note Various examples are offered for the function descriptions. For functions with a similar syntax, a selected function is used as a template in the example. This example must be adapted as well.
1534
TlgTrendWindowPressZoomInButton example
{ //zoom in TlgTrendWindowPressZoomInButton("TrendControl_01"); }
Parameters of the TlgTrendWindowPressZoomInButton function: "TrendControl_01" is the window title of WinCC Trend Control.
TlgTrendWindowPressZoomOutButton example
{ // zoom out TlgTrendWindowPressZoomOutButton("TrendControl_01"); }
Parameters of the TlgTrendWindowPressZoomOutButton function: "TrendControl_01" is the window title of WinCC Trend Control.
3.4.2
3.4.2.1
Lists
Bar direction
3.4.2.2
Numeric value 0 1 2 3
Bar Scaling
Bar Scaling Linear (same weighting) Logarithmic (low values emphasized) Negative logarithmic (high values emphasized) Automatic (linear)
1535
3.4.2.3
Flash frequencies
Note Since the flashing is performed by means of software engineering, the flash frequency is both system-dependent and hardware-bound (number of objects, processor speed, RAM size, update time etc.). The information in the table is therefore only for orientation purposes.
3.4.2.4
0(ZER O) 9 , (comm a) e
1536
If the decimal point is left out in the format specification the decimal places are not displayed and the number is rounded to an integer. If fewer decimal positions are provided in the format specification than the number actually has, only the decimal places specified in the format specification are output. The number is rounded correspondingly. If the number has more places before the decimal point than specified in the format specification, three asterisks (***) are output which means that the number cannot be displayed in this format.
3.4.2.5
3.4.2.6
1537
3.4.2.7
3.4.2.8
Color chart
The 16 primary colors are:
Color Red Dark red Green Dark green Blue Dark blue Cyan Dark cyan Yellow Dark yellow Magenta Dark magenta Light gray Gray Black White Color value (Hex) 0x000000F F 0x0000FF0 0 0x00FF000 0 0x00FFFF0 0 0x0000FFF F 0x00FF00F F symbolic constant CO_RED
0x00800080 CO_DKMAGENTA 0x00C0C0C CO_LTGRAY 0 0x00808080 CO_DKGRAY 0x00000000 CO_BLACK 0x00FFFFF F CO_WHITE
Note The symbolic constants are externally predefined by #define and provied by WinCC.
3.4.2.9
Format descriptors
For format descriptors the following type is expected:
1538
Note If a "DWORD," for which the 32nd bit is set, is to be read, a format descriptor must be used for unsigned integers (%u).
3.4.2.10
Fill pattern
Fill pattern Transparent Solid Fill pattern Value 1048576 1048577 Fill pattern Value 196611 196612 Value 65536 0 Fill pattern Value 196627 196628
1539
Note The "Solid" fill pattern fills the object with the set background color.
1540
3.4.2.11
Line styles
Line style symbolic name LS_SOLID LS_DASH LS_DOT LS_DASHDOT LS_DASHDOT DOT hidden LS_INVISIBLE Value 0 1 2 3 4 5
3.4.2.12
Line end symbolic name LE_NO LE_HOLLOW_ARROW LE_FULL_ARROW LE_CFULL_ARROW LE_LINE LE_HOLLOW_CIRCLE LE_FULL_CIRCLE Value for the left line ends 0 1 2 3 4 5 6 Value for the right line ends 0 65536 131072 196608 262144 327680 393216
Note From a line width > 5 the line end "empty circle" is displayed as filled circle.
3.4.2.13
List type decimal Binary bit
List types
Numeric value 0 1 2
1541
3.4.2.14
Language ID
WinCC only supports the SUBLANG_DEFAULT languages of Windows.
symbolic name LANG_ARABIC LANG_AFRIKAANS LANG_ALBANIAN LANG_BASQUE LANG_BULGARIAN LANG_BYELORUSSIAN LANG_CATALAN LANG_CHINESE LANG_CROATIAN LANG_CZECH LANG_DANISH LANG_DUTCH LANG_ENGLISH LANG_ESTONIAN LANG_FAEROESE LANG_FARSI LANG_FINNISH LANG_FRENCH LANG_GERMAN LANG_GREEK LANG_HEBREW LANG_HUNGARIAN LANG_ICELANDIC LANG_INDONESIAN LANG_ITALIAN LANG_JAPANESE LANG_KOREAN LANG_LATVIAN LANG_LITHUANIAN LANG_NORWEGIAN LANG_POLISH LANG_PORTUGUESE LANG_ROMANIAN LANG_RUSSIAN LANG_SLOVAK LANG_SLOVENIAN LANG_SORBIAN LANG_SPANISH
Value (hexadecimal) 0x0401 0x0436 0x041C 0x042D 0x0402 0x0423 0x0403 0x0404 0x041A 0x0405 0x0406 0x0413 0x0409 0x0425 0x0438 0x0429 0x040B 0x040C 0x0407 0x0408 0x040D 0x040E 0x040F 0x0421 0x0410 0x0411 0x0412 0x0426 0x0427 0x0414 0x0415 0x0416 0x0418 0x0419 0x041B 0x0424 0x042E 0x040A
Abbreviation CSY DAN NLD ENU FIN FRA DEU HUN ISL ITA NOR PLK PTB RUS SKY ESP
1542
3.4.2.15
Text alignment
3.4.2.16
Tag statuses
Value (decimal) 0 1 2 4 8 16 32 64 128 256 512 1024 2048 Value (hexdecimal) 0x0000 0x0001 0x0002 0x0004 0x0008 0x0010 0x0020 0x0040 0x0080 0x0100 0x0200 0x0400 0x0800 Meaning No error Connection to partner not established Handshake error Network module defective Configured upper limit exceeded Configured lower limit exceeded Format upper limit exceeded Format lower limit exceeded Conversion error Tag initialization value Tag replacement value Channel addressing error Tag not found or not available
1543
3.4.3
3.4.3.1
Structure definitions
Structure definition CCAPErrorExecute
typedef struct { DWORD dwCurrentThreadID;Thread ID of the current thread DWORD dwErrorCode1;Error code 1 DWORD dwErrorCode2;Error code 2 BOOL bCycle; cycle/acycle char* szApplicationName;Name of the application char* szFunctionName;Name of the function char* szTagName;Name of the tag LPVOID lpParam;Pointer to the action stack DWORD dwParamSize;Size of the action stack DWORD dwCycle;Cycle of the variable CMN_ERROR* pError;Pointer to CMN_ERROR } CCAPErrorExecute;
Members
The meaning of the individual error IDs and the structure elements depending on them are specified in the following table:
0 1
X X
X X
X X
X X
X X
Action requires exception Exception when accessing the return result Stack overflow while executing the action
4097
1544
4100 0 1 2 4
X X X X X
X X X X X X X X X X
X X X X X X X X
X X X X
X X X X X X X
X X X X X X X
X X X X
X X
32768f X f 0 1 2 3 X X X X
1 2 3
X X X
X X X
X X X
X X X
X X X
X X X
Error structure
The OnErrorExecute function uses the error structure to evaluate or to output error messages, if marked by an "x" in the pError column.
See also
Structure definition CMN_ERROR (Page1546)
3.4.3.2
1545
DWORD dwCode; Code BOOL bCycle; cycle/acycle char* szApplicationName; Name of the Application char* szFunctionName; Name of the Function LPVOID lpParam; Pointer to the Action-Stack DWORD dwParamSize; size of the Action-Stack double dblTime; DWORD dwFlags; flags } CCAPTime;
Members dwCode
The structure element dwCode provides information on calling OnTime:
dwCode = 113 dwCode = 114 Call with time definition for each action Call with time monitoring for each action
dwFlags
The structure element dwFlags provides information on the output type:
dwFlags = TRUE dwFlags = FALSE The results are output to a file The results are output to the diagnostics window
3.4.3.3
struct CMNERRORSTRUCT { DWORDdwError1, DWORD dwError2, DWORD dwError3, DWORD dwError4, DWORD dwError5; TCHAR szErrorText[MAX_ERROR_LEN]; } CMN_ERROR
1546
Description
The extended error structure contains the error code and an error text for the error that has occurred. Each application can use the error structure to evaluate or to output error messages.
szErrorText
Buffer for the text description of the error cause The content is determined from the resources and therefore language-dependent.
3.4.3.4
typedef struct { DWORD dwType; DWORD dwSize; char szTypeName[MAX_DM_TYPE_NAME + 1]; } DM_TYPEREF;
Members dwType
Specifies the tag type
DM_VARTYPE_BIT DM_VARTYPE_SBYTE DM_VARTYPE_BYTE DM_VARTYPE_SWORD DM_VARTYPE_WORD DM_VARTYPE_SDWORD DM_VARTYPE_DWORD DM_VARTYPE_FLOAT DM_VARTYPE_DOUBLE Binary tag Signed 8-bit value Unsigned 8-bit value Signed 16-bit value Unsigned 16-bit value Signed 32-bit value Unsigned 32-bit value Floating-point number 32-bit IEEE 754 Floating-point number 64-bit IEEE 754
1547
dwSize
Specifies the length of the data type in bytes.
szTypeName
In the case of structure tags, contains the name of the structure type
3.4.3.5
typedef struct { DM_TYPEREF dmTypeRef; DM_VARKEY dmVarKey; VARIANT dmValue; DWORD dwState; } DM_VAR_UPDATE_STRUCT;
Members dmTypeRef
Contains information on the tag type. For performance reasons, nothing is entered into this structure in case of cyclic requirements.
dmVarKey
Specifies the tags to be edited.
dmValue
Tag value Upon access to the value of the VARIANT a ".u." has to be inserted between the name of the VARIANT and the name of the member. Example: // Supply variant
1548
dwState
Identifies the tag status.
See also
Tag statuses (Page1543) Structure definition DM_VARKEY (Page1550) Structure definition DM_TYPEREF (Page1547)
3.4.3.6
typedef struct { DM_TYPEREF dmTypeRef; DM_VARKEY dmVarKey; VARIANT dmValue; DWORD dwState; DWORD dwQualityCode; } DM_VAR_UPDATE_STRUCTEX;
Members dmTypeRef
Contains information on the tag type. For performance reasons, nothing is entered into this structure in case of cyclic requirements.
dmVarKey
Specifies the tags to be edited.
dmValue
Tag value Upon access to the value of the VARIANT a ".u." has to be inserted between the name of the VARIANT and the name of the member.
1549
dwState
Identifies the tag status.
dwQualityCode
Identifies the tag quality code.
See also
Tag statuses (Page1543) Structure definition DM_VARKEY (Page1550) Structure definition DM_TYPEREF (Page1547)
3.4.3.7
typedef struct { DWORD dwKeyType; DWORD dwID; char szName[ MAX_DM_VAR_NAME + 1 ]; LPVOID lpvUserData; } DM_VARKEY;
Members dwKeyType
Defines whether the tag is to be addressed by a key ID or by its name. DM_VARKEY_ID Specification via key ID DM_VARKEY_NAME Specification via tag name
1550
dwID
Contains the key ID of the tags if dwKeyType is set accordingly
szName
Contains the name of the tag if dwKeyType is set accordingly
lpvUserData
Pointer to application-specific data
3.4.3.8
Members LinkType
LinkType are enumeration constants defined in the "Trigger.h" file. They are to be integrated into your script with the #include "Trigger.h" command and the corresponding enumeration constants.
BUBRT_LT_NOLINK BUBRT_LT_VARIABLE_DIRECT BUBRT_LT_VARIABLE_INDIRECT BUBRT_LT_ACTION BUBRT_LT_ACTION_WIZARD BUB_LT_DIRECT_CONNECTION BUBRT_LT_ACTION_WIZARD_INPROC 0 1 2 3 4 5 6 no shortcut direct tag indirect tag C action Dynamic Dialog Direct connection Dynamic Dialog
For the function SetLink only the enumeration constants BUBRT_LT_VARIABLE_DIRECT and BUBRT_LT_VARIABLE_INDIRECT may be used. The function GetLink allows to return all listed enumeration constants.
1551
dwCycle
Update cycle time
255 235 0 1 2 3 4 5 6 7 8 9 10 11-1 5 Picture cycle Window Cycle Upon change 250ms 500 ms 1s 2s 5s 10s 1min 5min 10min 1h User cycle 1-5
szLinkName
Tag name
3.4.3.9
typedef struct { CHARszFilterName[MSG_MAX_TEXTLEN+1]; WORDdwFilter; SYSTEMTIMEst[2]; DWORDdwMsgNr[2]; DWORDdwMsgClass; DWORDdwMsgType[MSG_MAX_CLASS]; DWORD dwMsgState; WORDwAGNr[2]; WORDwAGSubNr[2]; DWORDdwArchivMode; charszTB[MSG_MAX_TB][ MSG_MAX_TB_CONTENT+1] DWORDdwTB; DoubledPValue[MSG_MAX_PVALUE][2]; DWORDdwPValue[2]; DWORDdwMsgCounter[2]; DWORDdwQuickSelect; } MSG_FILTER_STRUCT;
1552
Description
In this structure the filter criteria are specified.
Members dwFilter
The filter conditions are defined by means of the following constants from the file "m_global.h":
MSG_FILTER_DATE_FROM MSG_FILTER_DATE_TO MSG_FILTER_TIME_FROM MSG_FILTER_TIME_TO MSG_FILTER_NR_FROM MSG_FILTER_NR_TO MSG_FILTER_CLASS MSG_FILTER_STATE MSG_FILTER_AG_FROM MSG_FILTER_AG_TO MSG_FILTER_AGSUB_FROM MSG_FILTER_AGSUB_TO MSG_FILTER_TEXT MSG_FILTER_PVALUE Date from Date to Time from Time to Message number from Message number to Message classes Message status AS number from AS number to AG subnumber from AG subnumber to Message texts Process values
MSG_FILTER_COUNTER_FROM MSG_FILTER_COUNTER_TO MSG_FILTER_PROCESSMSG MSG_FILTER_SYSMSG MSG_FILTER_BEDMSG MSG_FILTER_DATE MSG_FILTER_TIME MSG_FILTER_NR MSG_FILTER_VISIBLEONLY MSG_FILTER_HIDDENONLY Internal message counter from Internal message counter to Process messages System messages Operator messages Date from to Time from to Message number from to Display visible messages Display hidden messages
st
Date/time from - to Where st[0] is the start time (from), st[1] the end time (to) Assign these fields for the filter criteria: MSG_FILTER_DATE, MSG_FILTER_DATE_FROM, MSG_FILTER_DATE_TO, MSG_FILTER_TIME, MSG_FILTER_TIME_FROM or MSG_FILTER_TIME_TO
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1553
dwMsgNr
Message number from - to Where dwMsgNr[0] is the start no. (from), dwMsgNr[1] the end no. (to) Assign these fields for the filter criteria: MSG_FILTER_NR, MSG_FILTER_NR_FROM or MSG_FILTER_NR_TO
dwMsgClass
Message classes bit-coded. Assign this field for the filter criterion: MSG_FILTER_CLASS
dwMsgType
Message type per message class, bit-coded Assign this field for the filter criterion: MSG_FILTER_CLASS
dwMsgState
Message status bit-coded. Assign this field for the filter criterion: MSG_FILTER_STATE
wAGNr
AGNr from - to Assign these fields for the filter criteria: MSG_FILTER_AG_FROM or MSG_FILTER_AG_TO
wAGSubNr
AGSubNr from - to Assign this field for the filter criteria: MSG_FILTER_AGSUB_FROM or MSG_FILTER_AGSUB_TO
dwArchivMode
Archiving / logging Must be assigned 0.
1554
szTB
Texts of the text blocks Assign these fields for the filter criterion: MSG_FILTER_TEXT
dwTB
Active text blocks (from - to, bit-coded) Assign this field for the filter criterion: MSG_FILTER_TEXT
dPValue
Process values from - to Assign these fields for the filter criterion: MSG_FILTER_PVALUE
dwPValue
Active process values (from - to, bit-coded) Assign this field for the filter criterion: MSG_FILTER_PVALUE
dwMsgCounter
Internal message counter from - to Assign these fields for the filter criteria: MSG_FILTER_COUNTER_FROM, MSG_FILTER_COUNTER_TO
dwQuickSelect
Quick selection for hour, day, month The parameter is reserved for future upgrades and must be preset to 0. Assign this field for the filter criterion: MSG_FILTER_QUICKSELECT LOWORD type:
MSG_FILTER_QUICK_MONTH MSG_FILTER_QUICK_DAYS MSG_FILTER_QUICK_HOUR Quick selection last n months Quick selection last n days Quick selection last n hours
HIWORD number: 1...n The end time of the quick selection refers to the current system time of the local computer. The start time is calucalted back n * ( months, days, hours ).
1555
3.4.3.10
typedef struct { DWORD dwMsgState; DWORD dwMsgNr; SYSTEMTIME stMsgTime; DWORD dwTimeDiff; DWORD dwCounter; DWORD dwFlags; WORD wPValueUsed; WORD wTextValueUsed; double dPValue[MSG_MAX_PVALUE]; MSG_TEXTVAL_STRUCT mtTextValue[MSG_MAX_PVALUE]; } MSG_RTDATA_STRUCT;
Members
dwMsgState Message status
MSG_STATE_COME MSG_STATE_GO MSG_STATE_QUIT MSG_STATE_LOCK MSG_STATE_UNLOCK MSG_STATE_QUIT_SYSTEM MSG_STATE_QUIT_EMERGENCY MSG_STATE_QUIT_HORN MSG_STATE_COMEGO MSG_STATE_UPDATE MSG_STATE_RESET MSG_STATE_SUMTIME MSG_STATE_INSTANCE 0x00000001 0x00000002 0x00000003 0x00000004 0x00000005 0x00000010 0x00000011 0x00000012 0x00000013 0x00010000 0x00020000 0x00040000 0x00080000 Message came in Message went out Message acknowledged Message locked Message unlocked Message acknowledged by system Emergency acknowledgement Horn acknowledgement Message came in and went out, only display in message list Bit for message update Bit for message reset Bit active for daylight savings time Bit for instance message (n messages of a no.)
dwMsgNr Message number stMsgTime Date/Time: Telegram time depending on the calling function
dwTimeDiff
Duration coming/Telegram time in seconds dwCounter Internal message counter
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1556
wPValueUsed Process values used, bit-coded. Every bit may only be set in one of the two structure elements "wPValueUsed" or "wTextValueUsed". An accompanying value may either be a number or a text. wTextValueUsed text values used, bit-coded. Every bit may only be set in one of the two structure elements "wPValueUsed" or "wTextValueUsed". An accompanying value may either be a number or a text.
1557
1559
4.2
4.2.1
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 Adding dynamics to properties of pictures and objects Configuring actions in pictures and objects Accessing products that support VBA (e.g. products in the MS Office family)
1560
See also
Organizing VBA Code in a WinCC Project (Page1562) VBA Reference (Page1664) VBA in the Graphics Designer (Page1567) Executing VBA Macros in Graphics Designer (Page1566) Differentiation: Using VBA (Page1561)
4.2.2
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.
See also
VBA in the Graphics Designer (Page1567) Executing VBA Macros in Graphics Designer (Page1566) Organizing VBA Code in a WinCC Project (Page1562) Introduction: Using VBA in WinCC (Page1560)
1561
4.2.3
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.
1562
1563
1564
See also
Event Handling (Page1655) VBA in the Graphics Designer (Page1567) Executing VBA Macros in Graphics Designer (Page1566) How to export and import VBA code (Page1565)
4.2.4
Principle
In the VBA editor you can import and export VBA code, enabling you to transfer it to another computer. 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.
1565
See also
Organizing VBA Code in a WinCC Project (Page1562)
4.2.5
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:
1566
Further information on the subject of event handling is provided under "Event handling" and "Events".
VBA editor
You can start a VBA macro in the VBA editor by pressing <F5>. If you press <F8>, you can execute a VBA macro step by step.
See also
VBA Reference (Page1664) Event Handling (Page1655) Creating Customized Menus and Toolbars (Page1573) VBA in the Graphics Designer (Page1567) Organizing VBA Code in a WinCC Project (Page1562) Introduction: Using VBA in WinCC (Page1560)
4.3
4.3.1
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.
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1567
Event Handling
With VBA you can respond to events that occur in the Graphics Designer or in a picture, for example when you insert a new object into a picture. You use event handling in order to execute VBA macros in certain program situations.
1568
See also
Editing Pictures with VBA (Page1601) SymbolLibrary Object (Page1962) HMIObject Object (Page1882) Document Object (Page1847) Application Object (Page1814) Accessing External Applications with VBA (Page1658) Event Handling (Page1655) Creating Dynamics with VBA (Page1631) Editing Objects with VBA (Page1606) Adapting the Graphics Designer with VBA (Page1569) Introduction: Using VBA in WinCC (Page1560)
4.3.2
4.3.2.1
Introduction
In VBA the Application object represents the Graphics Designer:
1569
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.
See also
Editing Pictures with VBA (Page1601) Accessing the component library with VBA (Page1593) Creating Customized Menus and Toolbars (Page1573) Language-Dependent Configuration with VBA (Page1570) VBA in the Graphics Designer (Page1567)
4.3.2.2
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 language-dependent 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".
1570
Project 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
Language change
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. The full list of language codes is available in the WinCC documentation (Index > Language ID). 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
1571
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
See also
LanguageTexts Object (Listing) (Page1893) LanguageFonts Object (Listing) (Page1890) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Create Menus in Multiple Languages (Page1580) VBA Reference (Page1664)
4.3.2.3
1572
Shortcut (3)
Defines a key combination for a menu item or an icon. You can only use the "Shortcut" property for user-defined menu items and icons:
'VBA15 Application.ActiveDocument.CustomMenus(1).MenuItems(3).Shortcut = "Ctrl+G"
Creating Customized 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 open. 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: Is linked with a specific picture and remains visible as long as the picture is visible. You should use picture-specific menus and toolbars when the VBA macros used there are relevant only for that particular picture.
1573
Figure 4-1
In the illustration above, first the picture-specific menus and toolbars are inserted, then the application-specific ones.
1574
See also
How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Add a New Icon to the Toolbar (Page1584) How to Create a New Application-Specific Toolbar (Page1582) How to Create Menus in Multiple Languages (Page1580) How to Add a New Menu Item to the Menu (Page1577) How to Create Picture-Specific Menus and Toolbars (Page1602) How to Create a New Application-Specific Menu (Page1575) Configuring Menus and Toolbars (Page1572) Executing VBA Macros in Graphics Designer (Page1566)
1575
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
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 <F5>.
Result
The two menus "App_Menu_1" and "App_Menu_2" are inserted to the right of the "Window" menu:
1576
See also
Creating Customized Menus and Toolbars (Page1573) InsertMenu Method (Page1763) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Create Menus in Multiple Languages (Page1580) How to Add a New Menu Item to the Menu (Page1577) Configuring Menus and Toolbars (Page1572) Organizing VBA Code in a WinCC Project (Page1562)
Introduction
You can insert three different types of menu items in the user-defined menu: Menu entry: 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 user-defined 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.
1577
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
1578
Result
The "InsertMenuItems()" procedure inserts the menu "App_Menu_1" with these menu items:
1579
See also
InsertSeparator Method (Page1766) InsertSubmenu Method (Page1767) InsertMenu Method (Page1763) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Create Menus in Multiple Languages (Page1580) How to Create a New Application-Specific Menu (Page1575) Configuring Menus and Toolbars (Page1572) Creating Customized Menus and Toolbars (Page1573)
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
1580
1581
Result
If you now switch the configuring language to English, certain items in the user-defined menu are shown in English.
See also
LanguageTexts Object (Listing) (Page1893) LDLabelTexts Property (Page2186) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Add a New Menu Item to the Menu (Page1577) How to Create a New Application-Specific Menu (Page1575) Configuring Menus and Toolbars (Page1572) Creating Customized Menus and Toolbars (Page1573) Language-Dependent Configuration with VBA (Page1570)
1582
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
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 <F5>.
Result
The two toolbars are inserted beneath the Graphics Designer toolbars.
See also
Add Method (CustomToolbars Listing) (Page1708) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Add a New Icon to the Toolbar (Page1584) Configuring Menus and Toolbars (Page1572) Creating Customized Menus and Toolbars (Page1573)
1583
Introduction
You can insert two different types of objects in the user-defined toolbar: Symbol: To call VBA macros. Separator line: For clearer design of user-defined toolbars. The "Position" parameter determines the order of the icons within the user-defined toolbar. The "Key" parameter is a unique identification of the icon. This parameter is used if you use the "ToolbarItemClicked" event for calling VBA macros.
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
1584
Results
The "InsertToolbarItems()" procedure adds a toolbar with two icons, separated by a dividing line, to the Graphics Designer toolbars:
Note Use the icon property in order to specify a graphic (*.ICO format) for a tool icon.
1585
See also
Creating Customized Menus and Toolbars (Page1573) Icon Property (Page2144) InsertSeparator Method (Page1766) InsertToolbarItem Method (Page1769) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Create a New Application-Specific Toolbar (Page1582) Configuring Menus and Toolbars (Page1572)
Introduction
When the configuring engineer moves the mouse over a user-defined menu item or over a user-defined icon, you can provide additional help text to explain the functionality in more detail: You can define a help text for user-defined menu items and icons; the help text is displayed in the status bar. For user-defined 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.
1586
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
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 foreign-language 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(1033, "This is my first status text in English") End Sub
1587
Results
The status text is displayed when you move the mouse pointer over the user-defined menu item or the icon.
See also
LDTooltipTexts Property (Page2190) LDStatusTexts Property (Page2188) LanguageTexts Object (Listing) (Page1893) Add Method (Page1705) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Add a New Icon to the Toolbar (Page1584) How to Add a New Menu Item to the Menu (Page1577) Configuring Menus and Toolbars (Page1572) Creating Customized Menus and Toolbars (Page1573)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1588
3. To start a VBA macro via the VBA event handlers, use the "MenuItemClicked" or "ToolbarItemClicked" event:
1589
3. To start a VBA macro via the Macro property, assign the VBA macro to each menu item or icon. In the following example, a user-defined menu with two menu entries is created, which retrieve two different VBA macros: The VBA code of the following VBA11 example depends on the file type. The VBA code is added as an example for a PDL and a PDT file. Both cases can be distinguished in the following manner: PDL file: The VBA code in a PDL file is only executed when this PDL file is being displayed. PDT file: The VBA code in a PDT file is always executed when the Graphics Designer is open. 4. Insert the VBA code from the "VBA11" table. Sample code for PDL file or "VBA821: Sample code for PDT file". You can call the following two procedures via the menu items in the user-defined menu "DocMenu1": 5. Insert the VBA code from the "VBA12" table. 6. Start the procedure with <F5>. The following tables show the VBA codes for the example:
1590
1591
' '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
1592
See also
Macro Property (Page2206) ToolbarItemClicked Event (Page1701) MenuItemClicked Event (Page1695) How to Add a New Icon to the Toolbar (Page1584) How to Add a New Menu Item to the Menu (Page1577) Event Handling (Page1655) Executing VBA Macros in Graphics Designer (Page1566)
4.3.2.4
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, which represent folders as well as objects.
1593
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:
1594
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("Objec t1").DisplayName
1595
See also
CopyToClipboard Method (Page1740) PasteClipboard Method (Page1781) GetItemByPath Method (Page1760) FindByDisplayName Method (Page1756) Delete Method (Page1745) AddItem Method (Page1720) AddFromClipboard Method (Page1717) AddFolder Method (Page1716) SymbolLibrary Object (Page1962) SymbolLibraries Object (Listing) (Page1963) How to Insert an Object from the Component Library into a Picture with VBA (Page1599) How to Edit the Component Library with VBA (Page1596)
1596
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
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.AddFromClipBoard ("Copy of PC/PLC") End Sub
1597
See also
SymbolLibrary Object (Page1962) SymbolLibraries Object (Listing) (Page1963) PasteClipboard Method (Page1781) Delete Method (Page1745) CopyToClipboard Method (Page1740) AddItem Method (Page1720) AddFromClipboard Method (Page1717) AddFolder Method (Page1716) How to Insert an Object from the Component Library into a Picture with VBA (Page1599) Accessing the component library with VBA (Page1593)
1598
How to Insert an Object from the Component Library into a Picture with VBA Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
1599
See also
PasteClipboard Method (Page1781) CopyToClipboard Method (Page1740) How to Edit the Component Library with VBA (Page1596) Accessing the component library with VBA (Page1593)
1600
4.3.3
4.3.3.1
Introduction
Pictures visualize the process to be executed and observed. They display the important process steps or plant parts and present the production process in a schematic manner. In VBA the picture is represented by the Document object.
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.
1601
See also
Editing a Copy of a Picture with VBA (Page1605) How to Create Picture-Specific Menus and Toolbars (Page1602) Editing Layers with VBA (Page1603) Editing Objects with VBA (Page1606) Adapting the Graphics Designer with VBA (Page1569)
4.3.3.2
Introduction
Picture-specific menus and toolbars are linked to a specific picture and remain visible for as long as the You should use picture-specific menus and toolbars when the VBA macros used there are relevant only for that particular picture.
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "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
1602
See also
Add Method (CustomToolbars Listing) (Page1708) InsertMenu Method (Page1763) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Add a New Icon to the Toolbar (Page1584) How to Create Menus in Multiple Languages (Page1580) How to Add a New Menu Item to the Menu (Page1577) Creating Customized Menus and Toolbars (Page1573) Configuring Menus and Toolbars (Page1572)
4.3.3.3
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":
1603
See also
IsRTLayerVisible Method (Page1771) SetRTLayerVisible Method (Page1799) SetCSLayerVisible Method (Page1797) IsCSLayerVisible Method (Page1770) Layers Object (Listing) (Page1895) Editing Pictures with VBA (Page1601) Language-Dependent Configuration with VBA (Page1570)
1604
4.3.3.4
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.
1605
Set objView = ActiveDocument.Views.Add With objView .Activate .ScrollPosX = 40 .ScrollPosY = 10 .Zoom = 150 End With End Sub
See also
Add Method (Views Listing) (Page1713) ScrollPosY Property (Page2284) ScrollPosX Property (Page2283) ActiveLayer Property (Page1996) View Object (Page1991) SetCSLayerVisible Method (Page1797) IsCSLayerVisible Method (Page1770) Activate Method (Page1704) Editing Layers with VBA (Page1603) Editing Pictures with VBA (Page1601)
4.3.4
4.3.4.1
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
1606
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("CircleAsHMIObject", "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
1607
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("CircleAsHMICircle", "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
See also
LanguageFonts Object (Listing) (Page1890) VBA Reference (Page1664) Underlined Property (Page2324) Size Property (Page2291) Parent Property (Page2241) LanguageID Property (Page2158) Italic Property (Page2151) FontFamily Property (Page2127) Bold Property (Page2034) Application Property (Page2008)
1608
4.3.4.2
Default objects, Smart objects, Windows objects and Tube 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.
1609
'Creates object of type "HMICircle" Dim objCircle As HMICircle ' 'Add object in active document Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("My Circle", "HMICircle") End Sub
Edit Object
VBA gives you access to all object properties, which 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, among others: "AlignLeft()", "AlignRight()", "AlignTop()", "AlignBottom()": These methods align objects. "CreateGroup()", "CreateCustomizedObject()": These methods create a group object or customized object. "DeselectAll()" method: Cancels the selection of all objects
See also
Parent Property (Page2241) Item Property (Page2152) Count Property (Page2082) Application Property (Page2008)
How to edit Default objects, Smart objects, Windows objects and Tube 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
1610
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "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("myCircleAsCircle", "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 "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("myCircleAsObject", "HMICircle") With objObject 'Access to objectproperties only with property "Properties": .Properties("BorderWidth") = 4 .Properties("BorderColor") = RGB(255, 0, 0) End With End Sub
1611
1612
1613
See also
Find Method (Page1755) Delete Method (Page1745) AddHMIObject Method (Page1719) How to edit Default objects, Smart objects, Windows objects and Tube objects (Page1610) Editing Objects with VBA (Page1606)
1614
1615
You will find further information on the parameters in this documentation under "AddOLEObject method". In the following example an OLE Element 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.
See also
OLEObject Object (Page1914) AddOLEObject Method (Page1722) How to edit Default objects, Smart objects, Windows objects and Tube objects (Page1610) Default objects, Smart objects, Windows objects and Tube objects (Page1609) Editing Objects with VBA (Page1606)
1616
Further information is provided under "AddActiveXControl method" in this documentation and under "Object Palette" in the WinCC documentation.
1617
End Sub
The ActiveXControl object is added to the "HMIObjects" listing as the last element and inherits the properties of the HMIObject object.
See also
ActiveXControl Object (Page1811) AddActiveXControl Method (Page1714) How to edit Default objects, Smart objects, Windows objects and Tube objects (Page1610) Default objects, Smart objects, Windows objects and Tube objects (Page1609) Editing Objects with VBA (Page1606)
4.3.4.3
Group Objects
1618
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.
1619
See also
Selection Object (Listing) (Page1949) GroupedObjects Object (Listing) (Page1877) Ungroup Method (Page1803) Remove Method (Page1784) Delete Method (Page1745) Add Method (GroupedObjects Listing) (Page1710) How to Edit Objects in a Group Object with VBA (Page1623) How to Edit Group Objects with VBA (Page1620) Editing Objects with VBA (Page1606) VBA in the Graphics Designer (Page1567)
1620
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. Open the document "ThisDocument" in the Project Explorer:
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
1621
1622
See also
Ungroup Method (Page1803) Remove Method (Page1784) Delete Method (Page1745) CreateGroup Method (Page1743) Add Method (GroupedObjects Listing) (Page1710) Selection Object (Listing) (Page1949) GroupedObjects Object (Listing) (Page1877) Group Object (Page1873) How to Edit Objects in a Group Object with VBA (Page1623) Group Objects (Page1618) Editing Objects with VBA (Page1606) VBA in the Graphics Designer (Page1567)
Requirements
You must have created at least two graphic objects in the Graphics Designer and you must have grouped them.
1623
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. Open the document "ThisDocument" in the Project Explorer:
1624
1625
See also
Properties Object (Listing) (Page1931) GroupedObjects Object (Listing) (Page1877) Ungroup Method (Page1803) Remove Method (Page1784) Delete Method (Page1745) Add Method (GroupedObjects Listing) (Page1710) How to Edit Group Objects with VBA (Page1620) Group Objects (Page1618) Editing Objects with VBA (Page1606) VBA in the Graphics Designer (Page1567)
4.3.4.4
Customized Objects
1626
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.
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").
1627
See also
HMIObject Object (Page1882) CustomizedObject Object (Page1839) Destroy Method (Page1749) Delete Method (Page1745) CreateCustomizedObject Method (Page1741) How to Edit a Customized Object with VBA (Page1628) How to Edit Group Objects with VBA (Page1620) Group Objects (Page1618) Editing Objects with VBA (Page1606)
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. Open the document "ThisDocument" in the Project Explorer:
1628
1629
See also
Destroy Method (Page1749) Delete Method (Page1745) CreateCustomizedObject Method (Page1741) Customized Objects (Page1626)
1630
4.3.5
4.3.5.1
Introduction
VBA allows you to add dynamics to properties of pictures and objects and to configure eventcontrolled 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.
1631
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.
See also
Editing Triggers (Page1652) Configuring Event-Driven Actions with VBA (Page1644) Configuring Dynamics in the Properties of Pictures and Objects (Page1632)
4.3.5.2
1632
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(hmiDynamicCreationTypeVariableDirect, "'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.
Tag 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 a dynamic to a property with the aid of the Dynamic dialog. The dynamic property responds in runtime to a variable's value ranges. The following objects are available for specifying the value range: AnalogResultInfos-Objekt: 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. "Upper limit exceeded") of a specified variable. The fixed value is then allocated to the dynamic property when the state occurs.
1633
Scripts
Use the ScriptInfo object to add a dynamic to a property with a C or VB script. The property with the dynamic reacts to a script in Runtime and is controlled via a trigger. Use the Trigger object for configuring the trigger.
See also
VariableTrigger Object (Page1989) VariableStateValue Object (Page1986) Trigger Object (Page1974) ScriptInfo Object (Page1948) BinaryResultInfo Object (Page1822) AnalogResultInfos Object (Listing) (Page1813) How to Dynamize a Property with a VB Script (Page1642) How to Dynamize a Property with a C Script (Page1639) How to Dynamize a Property with Dynamic Dialog (Page1636) How to Dynamize a Property with Tag Connection (Page1634) Creating Dynamics with VBA (Page1631)
1634
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
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(hmiDynamicCreationTypeVariableDirect, "Otto") ' 'define cycle-time With objVariableTrigger .CycleType = hmiVariableCycleType_2s End With End Sub
1635
See also
CycleType Property (Page2088) VarName Property (Page2403) VariableTrigger Object (Page1989) CreateDynamic Method (Page1742) How to Dynamize a Property with a VB Script (Page1642) How to Dynamize a Property with a C Script (Page1639) How to Dynamize a Property with Dynamic Dialog (Page1636) Configuring Dynamics in the Properties of Pictures and Objects (Page1632) Creating Dynamics with VBA (Page1631)
1636
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor"). 2. In Project Explorer, open the document in which you want to write the VBA code:
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 will be dynamically configured using the Dynamic dialog, a tag name will be assigned and three analog value ranges will be created: 4. Start the procedure with <F5>.
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") ' 'Configure dynamic. "ResultType" defines the type of valuerange: With objDynDialog .ResultType = hmiResultTypeAnalog .AnalogResultInfos.Add 50, 40 .AnalogResultInfos.Add 100, 80
1637
1638
objCircle.BackColor = RGB(0, 255, 0) objCircle.ToolTipText = "Text" Set objDynDialog = objCircle.ToolTipText.CreateDynamic(hmiDynamicCreationTypeDynamicDialog, "'Var'") End Sub
See also
How to Dynamize a Property with Tag Connection (Page1634) ResultType Property (Page2272) DynamicDialog Object (Page1851) CreateDynamic Method (Page1742) How to Dynamize a Property with a VB Script (Page1642) How to Dynamize a Property with a C Script (Page1639) Configuring Dynamics in the Properties of Pictures and Objects (Page1632) Creating Dynamics with VBA (Page1631) ToolTipText Property (Page2310)
1639
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
1640
See also
Trigger Property (Page2314) ScriptType Property (Page2280) SourceCode Property (Page2295) CycleType Property (Page2088) ScriptInfo Object (Page1948) CreateDynamic Method (Page1742) How to Dynamize a Property with a VB Script (Page1642) How to Dynamize a Property with Dynamic Dialog (Page1636) How to Dynamize a Property with Tag Connection (Page1634) Configuring Dynamics in the Properties of Pictures and Objects (Page1632) Creating Dynamics with VBA (Page1631)
1641
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor"). 2. In Project Explorer, open the document in which you want to write the VBA code:
1642
See also
How to Dynamize a Property with a C Script (Page1639) Trigger Property (Page2314) SourceCode Property (Page2295) CycleType Property (Page2088) ScriptInfo Object (Page1948) CreateDynamic Method (Page1742) How to Dynamize a Property with Dynamic Dialog (Page1636) How to Dynamize a Property with Tag Connection (Page1634) Configuring Dynamics in the Properties of Pictures and Objects (Page1632) Creating Dynamics with VBA (Page1631)
1643
4.3.5.3
General Procedure
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.
1644
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.
See also
How to Configure an Event-Oriented VB action with VBA (Page1650) Events Property (Page2099) ScriptInfo Object (Page1948) Event Object (Page1862) How to Configure an Event-Oriented C Action with VBA (Page1648) How to Configure a Direct Connection with VBA (Page1645) Event Handling (Page1655) Creating Dynamics with VBA (Page1631)
1645
Procedure
1. Open the VBA editor in Graphics Designer (<ALT+F11> or "Tools" > "Macros" > "Visual Basic Editor") 2. In Project Explorer, open the document in which you want to write the VBA code:
1646
1647
See also
ObjectName Property (Page2232) AutomationName Property (Page2011) SourceLink Object (Page1955) DestLink Object (Page1843) DirectConnection Object (Page1845) Configuring Event-Driven Actions with VBA (Page1644)
1648
1649
See also
ScriptInfo Object (Page1948) Events Object (Listing) (Page1863) Actions Object (Listing) (Page1810) Configuring Event-Driven Actions with VBA (Page1644)
1650
See also
Actions Object (Listing) (Page1810) ScriptInfo Object (Page1948) Events Object (Listing) (Page1863) Configuring Event-Driven Actions with VBA (Page1644)
1651
4.3.5.4
Editing Triggers
You determine the type of trigger with the Type property. Use the VariableTriggers property when you configure a variable as the trigger.
See also
Examples of Editing Triggers with VBA (Page1653) VariableTrigger Object (Page1989) Trigger Object (Page1974) ScriptInfo Object (Page1948)
1652
Example 2: Tag
Sub DynamicWithVariableTriggerCycle() 'VBA69 Dim objVBScript As HMIScriptInfo Dim objVarTrigger As HMIVariableTrigger Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle_VariableTrigger", "HMICircle") Set objVBScript = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBScript) With objVBScript Set objVarTrigger = .Trigger.VariableTriggers.Add("VarTrigger", hmiVariableCycleType_10s) .SourceCode = "" End With
1653
End Sub
See also
VariableTrigger Object (Page1989) Trigger Object (Page1974) ScriptInfo Object (Page1948) Editing Triggers (Page1652)
1654
4.3.6
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. NOTICE 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. Note If you open a picture in Graphics Designer, not only the "DocumentOpened event" of the active picture but also that of the "Project Template" and of the "Global Template" are triggered. The VBA code of the "DocumentOpened event" is thereby executed twice. You must intercept this behavior with the event handler.
General Procedure
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 document "Project Template" to the document "Global Template".
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)
1655
'VBA72 CancelForwarding = True MsgBox "Object's property has been changed!" End Sub
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 picture-specific 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 <Name> 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:
1656
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.
1657
See also
DisableVBAEvents Property (Page2092) Organizing VBA Code in a WinCC Project (Page1562)
4.3.7
4.3.7.1
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.
1658
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.
See also
Example: Accessing MS Excel with VBA (Page1659)
4.3.7.2
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.
1659
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 'Microsoft Excel Object Library needs to be referenced 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 '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)
1660
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 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 objGDApplication 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 = grafexe.Application Set objDoc = objGDApplication.ActiveDocument Set objXLS = New Excel.Application 'Create workbook Set objWBook = objXLS.Workbooks.Add() objWBook.SaveAs objGDApplication.ApplicationDataPath & "Export.xls"
1661
'Create worksheet in the new workbook and write headline '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) = "Width" objWSheet.Cells(1, 7) = "Hhe" 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 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()
1662
'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.ApplicationDataPath & strWorkbookName) If objWBook Is Nothing Then MsgBox "Open workbook fails!" & vbCrLf & "This function is cancled!", vbCritical, "Import od objects" Set objDoc = Nothing 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 <> 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
1663
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 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
4.4
4.4.1
1664
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
1665
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Events Object (Listing) (Page1863) SymbolLibraries Object (Listing) (Page1963) Actions Object (Listing) (Page1810) Application Object (Page1814) DataLanguage Object (Page1841) DataLanguages Object (Listing) (Page1842) Document Object (Page1847) Documents Object (Listing) (Page1850) Event Object (Page1862) HMIDefaultObjects Object (Listing) (Page1878) HMIObject Object (Page1882) HMIObjects Object (Listing) (Page1884) FolderItem Object (Page1867) FolderItems Object (Listing) (Page1868) VBA Reference: ActionDynamic (Page1667) VBA Reference: HMIObjects (Page1669) VBA Reference: Languages (Page1671) Layer Object (Page1894) Layers Object (Listing) (Page1895) Menu Object (Page1903) Menus Object (Listing) (Page1904) MenuItem Object (Page1906) MenuItems Object (Listing) (Page1909) Properties Object (Listing) (Page1931) Toolbar Object (Page1967) Toolbars Object (Listing) (Page1968) ToolbarItem Object (Page1970) ToolbarItems Object (Listing) (Page1973) View Object (Page1991) Views Object (Listing) (Page1993) Selection Object (Listing) (Page1949) SymbolLibrary Object (Page1962) Property Object (Page1932)
1666
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.2
1667
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VBA Reference (Page1664) AnalogResultInfo Object (Page1812) AnalogResultInfos Object (Listing) (Page1813) BinaryResultInfo Object (Page1822) BitResultInfo Object (Page1823) Actions Object (Listing) (Page1810) DestLink Object (Page1843) DirectConnection Object (Page1845) DynamicDialog Object (Page1851) QualityCodeStateValue Object (Page1934) QualityCodeStateValues Object (Listing) (Page1936) ScriptInfo Object (Page1948) SourceLink Object (Page1955) Trigger Object (Page1974) VariableStateValue Object (Page1986) VariableStateValues Object (Listing) (Page1987) VariableTrigger Object (Page1989) VariableTriggers Object (Listing) (Page1990)
1668
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.3
Object and List Object Detail view available. Object can be configured multilingually. Not in DefaultObjects list.
1669
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VBA Reference (Page1664) PolyLine Object (Page1928) GroupDisplay Object (Page1874) 3DBarGraph Object (Page1805) ActiveXControl Object (Page1811) ApplicationWindow Object (Page1817) Button Object (Page1824) CheckBox Object (Page1827) Circle Object (Page1828) CircularArc Object (Page1831) Line Object (Page1897) OLEObject Object (Page1914) OptionGroup Object (Page1916) PictureWindow Object (Page1919) PieSegment Object (Page1922) Polygon Object (Page1925) Property Object (Page1932) Rectangle Object (Page1939) RoundButton Object (Page1942) RoundRectangle Object (Page1945) Slider object (Page1952) StaticText Object (Page1956) StatusDisplay Object (Page1959) TextList Object (Page1964) Ellipse Object (Page1853) EllipseArc Object (Page1856) EllipseSegment Object (Page1859) GraphicObject Object (Page1870) Group Object (Page1873) HMIDefaultObjects Object (Listing) (Page1878) HMIObject Object (Page1882) HMIObjects Object (Listing) (Page1884) IOField Object (Page1886) BarGraph Object (Page1819) GroupedObjects Object (Listing) (Page1877) VBA Reference: Languages (Page1671) 1670 Selection Object (Listing) (Page1949) CustomizedObject Object (Page1839)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.4
See also
VBA Reference (Page1664) LanguageFont Object (Page1889) LanguageFonts Object (Listing) (Page1890) LanguageText Object (Page1892) LanguageTexts Object (Listing) (Page1893)
4.4.5
4.4.5.1
Events
A-D
syntax
Document_Activated(CancelForwarding As Boolean)
1671
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) CancelForwarding (Boolean) Description 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
See also
VBA Reference (Page1664) Event Handling (Page1655)
syntax
Document_BeforeClose(Cancel As Boolean, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) Cancel (Boolean) CancelForwarding (Boolean) Description TRUE if command processing is to be canceled. TRUE if the event is not intended to be forwarded. Default setting is "False".
1672
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VBA Reference (Page1664)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_BeforeDocumentClose(Document As HMIDocument, Cancel As Boolean)
Parameters
Parameter (Data Type) Document (HMIDocument) Cancel (Boolean) Description The picture that is going to be closed. 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()
1673
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'This procedure have to execute with "F5" first Set objGDApplication = grafexe.Application End Sub
See also
VBA Reference (Page1664)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_BeforeDocumentSave(Document As HMIDocument, Cancel As Boolean)
Parameters
Parameter (Data Type) Document (HMIDocument) Cancel (Boolean) Description The picture that is going to be closed. TRUE if command processing is to be canceled.
1674
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VBA Reference (Page1664)
BeforeHMIObjectDelete-Ereignis Description
Occurs immediately before an object in a picture is deleted.
syntax
BeforeHMIObjectDelete(ByVal HMIObject As IHMIObject, Cancel As Boolean, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) HMIObject (IHMIObject) Cancel (Boolean) CancelForwarding (Boolean) Description Identifies the object to be deleted. TRUE if command processing is to be canceled. TRUE if the event is not intended to be forwarded. Default setting is "False".
1675
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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" -> set Cancel to true for prevent delete Cancel = True End If End Sub
See also
VBA Reference (Page1664)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_BeforeLibraryFolderDelete(LibObject As HMIFolderItem, Cancel As Boolean)
1676
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameter (Optional)
Parameter (Data Type) LibObject (HMIFolderItem) Cancel (Boolean) Description The folder that is going to be deleted. 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
See also
VBA Reference (Page1664)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>.
1677
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
objGDApplication_BeforeLibraryObjectDelete(LibObject As HMIFolderItem, Cancel As Boolean)
Parameter (Optional)
Parameter (Data Type) LibObject (HMIFolderItem) Cancel (Boolean) Description The object that is going to be deleted. 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
See also
VBA Reference (Page1664)
syntax
1678
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_BeforeQuit(Cancel As Boolean)
Parameters
Parameter (Data Type) Cancel (Boolean) Description 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 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
See also
VBA Reference (Page1664)
syntax
Document_BeforeSave(Cancel As Boolean, CancelForwarding As Boolean)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1679
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) Cancel (Boolean) CancelForwarding (Boolean) Description TRUE if command processing is to be canceled. 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
See also
VBA Reference (Page1664)
syntax
Document_BeforeVisibleFalse(Cancel As Boolean, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) Cancel (Boolean) CancelForwarding (Boolean) Description TRUE if command processing is to be canceled. TRUE if the event is not intended to be forwarded. Default setting is "False".
Example:
--
1680
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VBA Reference (Page1664)
syntax
ConnectionEvent(eConnEventType, HMIConnector, HMIConnectedObject, CancelProcess, CancelForwarding)
Parameter (Optional)
Parameter (Data Type) eConnEventType (HMIConnectionEventType) HMIConnector (HMIObject) HMIConnectedObject (HMIObject) CancelProcess (Boolean) CancelForwarding (Boolean) Description ---TRUE if command processing is to be canceled. TRUE if the event is not intended to be forwarded. Default setting is "False".
Example:
--
See also
VBA Reference (Page1664)
syntax
1681
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_DataLanguageChanged(lCID As Long)
Parameters
Parameter (Data Type) lCID (Long) Description 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
See also
Language-Dependent Configuration with VBA (Page1570) VBA Reference (Page1664)
1682
VBA for Automated Configuration 4.4 The object model of 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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_DesktopLanguageChanged(lCID As Long)
Parameters
Parameter (Data Type) lCID (Long) Description 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
See also
VBA Reference (Page1664) Language-Dependent Configuration with VBA (Page1570)
1683
VBA for Automated Configuration 4.4 The object model of 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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_DocumentActivated(Document As HMIDocument)
Parameters
Parameter (Data Type) Document (HMIDocument) Description 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
See also
VBA Reference (Page1664)
1684
VBA for Automated Configuration 4.4 The object model of 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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_DocumentCreated(Document As HMIDocument)
Parameters
Parameter (Data Type) Document (HMIDocument) Description 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
See also
VBA Reference (Page1664)
1685
VBA for Automated Configuration 4.4 The object model of 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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_DocumentOpened(Document As HMIDocument)
Parameters
Parameter (Data Type) Document (HMIDocument) Description 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
See also
VBA Reference (Page1664)
1686
VBA for Automated Configuration 4.4 The object model of 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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_DocumentSaved(Document As HMIDocument)
Parameters
Parameter (Data Type) Document (HMIDocument) Description 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
See also
VBA Reference (Page1664)
1687
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Document_DocumentPropertyChanged(ByVal Property As IHMIProperty, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) Property (IHMIProperty) CancelForwarding (Boolean) Description Identifies the changed property. 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
See also
VBA Reference (Page1664)
4.4.5.2
F-Z
syntax
Document_HMIObjectAdded(ByVal HMIObject As IHMIObject, CancelForwarding As Boolean)
1688
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) HMIObject (IHMIObject) CancelForwarding (Boolean) Description Identifies the object being added. 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
See also
VBA Reference (Page1664)
syntax
Document_HMIObjectMoved(ByVal HMIObject As IHMIObject, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) HMIObject (IHMIObject) CancelForwarding (Boolean) Description Identifies the object being moved. TRUE if the event is not intended to be forwarded. Default setting is "False".
1689
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VBA Reference (Page1664)
syntax
Document_HMIObjectPropertyChanged(ByVal Property As IHMIProperty, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) Property (IHMIProperty) CancelForwarding (Boolean) Description Identifies the changed property. 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
1690
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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).ObjectName MsgBox "The property " & strObjProp & " of object " & strObjName & " is modified... " & vbCrLf & "The new value is: " & varPropValue End Sub
See also
VBA Reference (Page1664)
syntax
Document_HMIObjectResized(ByVal HMIObject As IHMIObject, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) HMIObject (IHMIObject) CancelForwarding (Boolean) Description Identifies the object that is being resized. 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 '
1691
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'"strObjName" contains the name of the modified object strObjName = HMIObject.ObjectName MsgBox "The size of " & strObjName & " was modified..." End Sub
See also
VBA Reference (Page1664)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_LibraryFolderRenamed(LibObject As HMIFolderItem, OldName As String)
Parameters
Parameter (Data Type) LibObject (HMIFolderItem) OldName (String) Description The renamed folder. 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:
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1692
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VBA Reference (Page1664) Accessing the component library with VBA (Page1593)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_LibraryObjectRenamed(LibObject As HMIFolderItem, OldName As String)
Parameters
Parameter (Data Type) LibObject (HMIFolderItem) OldName (String) Description The renamed object. 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
1693
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VBA Reference (Page1664) Accessing the component library with VBA (Page1593)
syntax
HMIObjectPropertyChanged(ByVal Property As IHMIProperty, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) LibObject (IHMIFolderItem) CancelForwarding (Boolean) Description Identifies the library object. 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 '
1694
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'"strObjName" contains the name of the added object strObjName = LibObject.DisplayName MsgBox "Object " & strObjName & " was added to the picture." End Sub
See also
VBA Reference (Page1664)
syntax
Document_MenuItemClicked(ByVal MenuItem As IHMIMenuItem)
Parameters
Parameter (Data Type) MenuItem (IHMIMenuItem) Description 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
In the following example a message is output when the first entry in a user-defined menu is clicked:
1695
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 MenuItem.Key Case "mItem1_1" MsgBox "The first menu-item was clicked!" End Select End Sub
See also
How to Assign VBA Macros to Menus and Toolbars (Page1589) VBA Reference (Page1664)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_NewLibraryFolder(LibObject As HMIFolderItem)
Parameters
Parameter (Data Type) LibObject (HMIFolderItem) Description The newly created folder.
1696
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VBA Reference (Page1664) Accessing the component library with VBA (Page1593)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>. objGDApplication_NewLibraryObject(LibObject As HMIFolderItem)
Parameters
Parameter (Data Type) LibObject (HMIFolderItem) Description The newly created object.
1697
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VBA Reference (Page1664) Accessing the component library with VBA (Page1593)
syntax
Document_Opened(CancelForwarding As Boolean)
Parameters
Parameter (Data Type) CancelForwarding (Boolean) Description 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
1698
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VBA Reference (Page1664)
syntax
Document_Saved(CancelForwarding As Boolean)
Parameters
Parameter (Data Type) CancelForwarding (Boolean) Description 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
See also
VBA Reference (Page1664)
1699
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Document_SelectionChanged(CancelForwarding As Boolean)
Parameters
Parameter (Data Type) CancelForwarding (Boolean) Description 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
See also
VBA Reference (Page1664)
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 <Name> As grafexe.Application In the following example, the name "objGDApplication" is substituted for <Name>.
Parameters
--
1700
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example
Declare application.
Dim WithEvents objGDApplication As grafexe.Application
See also
VBA Reference (Page1664)
syntax
Document_ToolbarItemClicked(ByVal ToolbarItem As IHMIToolbarItem)
1701
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) ToolbarItem (IHMIToolbarItem) Description Identifies the symbol.
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 varToolbarItemKey = objToolbarItem.Key ' Select Case varToolbarItemKey Case "tItem1_1" MsgBox "The first Toolbar-Icon was clicked!" End Select End Sub
See also
How to Assign VBA Macros to Menus and Toolbars (Page1589) VBA Reference (Page1664)
1702
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 <Name> As grafexe.Application
syntax
Document_ViewCreated(ByVal pView As IHMIView, CancelForwarding As Boolean)
Parameters
Parameter (Data Type) pView (IHMIView) CancelForwarding (Boolean) Description Identifies the copy of the picture. 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
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
See also
VBA Reference (Page1664)
1703
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VBA Reference (Page1664)
4.4.6
4.4.6.1
Methods
A-C
syntax
Expression.Activate()
1704
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Application" or "View" type.
Parameters
--
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
See also
View Object (Page1991) Application Object (Page1814) VBA Reference (Page1664)
1705
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Add Method (Views Listing) (Page1713) Add Method (TagTriggers Listing) (Page1712) Add Method (CustomToolbars Listing) (Page1708) Add Method (GroupedObjects Listing) (Page1710) Add Method (Documents Listing) (Page1709) Add Method (AnalogResultInfos Listing) (Page1706)
syntax
Expression.Add(RangeTo, ResultValue)
Expression
Necessary. An expression or element which returns an object of the "AnalogResultInfos" type.
Parameters
Parameter (Data Type) RangeTo (Variant) ResultValue (Variant) Description The value range to which the change of property gives rise. The value to which the object property is assigned when the value range is reached.
Example:
In the following example the radius of a circle is given dynamics with the 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog
1706
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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:
See also
DynamicDialog Object (Page1851) AnalogResultInfos Object (Listing) (Page1813) CreateDynamic Method (Page1742) How to Dynamize a Property with Dynamic Dialog (Page1636)
1707
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.Add(Key)
Expression
Necessary. An expression or element which returns an object of the "CustomToolbars" type.
Parameters
Parameter (Data Type) Key (Variant) Description 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 Set objToolbarItem = objToolbar.ToolbarItems.InsertToolbarItem(1, "tItem1_1", "My first Symbol-Icon") Set objToolbarItem = objToolbar.ToolbarItems.InsertToolbarItem(3, "tItem1_3", "My second Symbol-Icon") ' 'Insert seperatorline between the two tollbaritems
1708
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Toolbars Object (Listing) (Page1968) InsertToolbarItem Method (Page1769) InsertSeparator Method (Page1766) InsertFromMenuItem Method (Page1762) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573)
syntax
Expression.Add [HMIOpenDocumentType]
Expression
Necessary. An expression or element which returns an object of the "Documents" type.
1709
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) HMIOpenDocumentType (HMIDocumentType) Description 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 hmiOpenDocumentTypeVisible End Sub
See also
Hide Property (Page2140) Documents Object (Listing) (Page1850) VBA Reference (Page1664)
syntax
Expression.Add(Index)
Expression
Necessary. An expression or element which returns an object of the "GroupedObjects" type.
1710
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) Index (Variant) Description The object that is intended to be added. You can either use 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 .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
See also
GroupedObjects Object (Listing) (Page1877)
1711
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.Add(VarName, Type)
Expression
Necessary. An expression or element which returns an object of the "TagTriggers" type.
Parameters
Parameter (Data Type) VarName (String) Description 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. This is the cycle type. Select the cycle type from a list in the VBA Editor when you use this method.
Type (CycleType)
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_VariableTrigger", "HMICircle") Set objVBScript = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBScript) With objVBScript Set objVarTrigger = .Trigger.VariableTriggers.Add("VarTrigger", hmiVariableCycleType_10s) .SourceCode = "" End With End Sub
See also
VariableTriggers Object (Listing) (Page1990) VBA Reference (Page1664)
1712
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.Add()
Expression
Necessary. An expression or element which returns an object of the "Views" type.
Parameters
--
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
See also
Views Object (Listing) (Page1993) VBA Reference (Page1664)
syntax
Expression.Method(HMIActionCreationType)
1713
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Actions" type.
Parameters
Parameter (Data Type) HMIActionCreationType (Variant) Description Defines the action: hmiActionCreationTypeCScript: Configures a C action hmiActionCreationTypeVBScript: 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
See also
Event Object (Page1862) Actions Object (Listing) (Page1810)
Syntax
Expression.AddActiveXControl("ObjectName", "ProgID")
1714
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Required. An expression or element which returns an object of the "HMIObjects" type.
Parameter
Parameter (data type) ObjectName (String) ProgID (String) Description The name of the object. You can address the object by its name in a listing. The ActiveX Control that is to be inserted.
The following table shows a list of ProgIDs of WinCC controls that are installed by WinCC:
Name of the WinCC control Siemens HMI Symbol Library WinCC AlarmControl WinCC digital/analog clock control WinCC FunctionTrendControl WinCC gauge control ProgID SiemensHMI.SymbolLibrary.1 CCAxAlarmControl.AxAlarmControl.1 DACLOCK.DaclockCtrl.1 CCAxFunctionTrendControl.AxFunctionTrendControl.1 XGAUGE.XGaugeCtrl.1
1715
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Name of the WinCC control WinCC media control WinCC OnlineTableControl WinCC OnlineTrendControl WinCC push button control WinCC slider control WinCC RulerControl WinCC UserArchiveControl ProgID CCMediaControl.CCMediaControl.1 CCAxOnlineTableControl.AxOnlineTableControl.1 CCAxOnlineTrendControl.AxOnlineTrendControl.1 PBUTTON.PbuttonCtrl.1 SLIDER.SliderCtrl.1 CCAxTrendRulerControl.AxRulerControl.1 CCAxUserArchiveControl.AxUserArchiveControl.1
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
See also
ActiveX controls (Page1617) HMIObjects Object (Listing) (Page1884) ActiveXControl Object (Page1811) VBA Reference (Page1664)
1716
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.AddFolder(DefaultName)
Expression
Necessary. An expression or element which returns an object of the "FolderItems" type.
Parameters
Parameter (Data Type) DefaultName (String) Description 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
See also
SymbolLibrary Object (Page1962) FolderItems Object (Listing) (Page1868) VBA Reference (Page1664) Accessing the component library with VBA (Page1593)
1717
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.AddFromClipboard(DefaultName)
Expression
Necessary. An expression or element which returns an object of the "FolderItems" type.
Parameters
Parameter (Data Type) DefaultName (String) Description 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 "Folder 3" 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).CopyToClipboard End With ' 'paste object from clipboard into "Project Library" objProjectLib.FolderItems(objProjectLib.FindByDisplayName("My Folder3").Name).Folder.AddFromClipBoard ("Copy of PC/PLC") End Sub
See also
FolderItems Object (Listing) (Page1868) SymbolLibrary Object (Page1962) VBA Reference (Page1664) Accessing the component library with VBA (Page1593)
1718
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.AddHMIObject("ObjectName", "ProgID")
Expression
Necessary. An expression or element which returns an object of the "HMIObjects" type.
Parameters
Parameter (Data Type) ObjectName (String) ProgID (String) Description The name of the object. You can address the object by its name in a listing. 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
1719
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PieSegment Object (Page1922) TextList Object (Page1964) StatusDisplay Object (Page1959) StaticText Object (Page1956) Slider object (Page1952) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) PolyLine Object (Page1928) PictureWindow Object (Page1919) OptionGroup Object (Page1916) HMIObjects Object (Listing) (Page1884) Line Object (Page1897) IOField Object (Page1886) GraphicObject Object (Page1870) EllipseArc Object (Page1856) EllipseSegment Object (Page1859) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819) ApplicationWindow Object (Page1817) AddOLEObject Method (Page1722) AddActiveXControl Method (Page1714) VBA Reference (Page1664)
1720
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.Folder.AddItem "DefaultName", pHMIObject
Expression
Necessary. An expression or element which returns an object of the "FolderItems" type.
Parameters
Parameter (Data Type) DefaultName (String) pHMIObject (HMIObject) Description The name to be given to the object pasted into the components library. 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
Sub VBA123() 'VBA123 Dim objProjectLib As HMISymbolLibrary Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle", "HMICircle") Set objProjectLib = Application.SymbolLibraries(2) objProjectLib.FolderItems.AddFolder ("My Folder2") objProjectLib.FindByDisplayName("My Folder2").Folder.AddItem "ProjectLib Circle", ActiveDocument.HMIObjects("Circle") End Sub
See also
FolderItems Object (Listing) (Page1868) SymbolLibrary Object (Page1962) VBA Reference (Page1664) Accessing the component library with VBA (Page1593)
1721
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.AddOLEObject(ObjectName, ServerName, [CreationType], [UseSymbol])
Expression
Necessary. An expression or element which returns an object of the "HMIObjects" type.
Parameters
Parameter (Data Type) ObjectName (String) ServerName (String) Description The name of the object. You can address the object by its name in a listing. The name of the application which is to contain the OLE Element, or the file name complete with path. The value for "ServerName" corresponds to the "Object Type" in the "Insert Object" dialog:
1722
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameter (Data Type) CreationType (HMIOLEObjectCreation Type-) Description Defines whether the OLE Element will be newly 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 Element have no effect on the original file. Assign a name to the file via the "ServerName" parameter. HMIOLEObjectCreationTypeByLinkWithReference: Same as above, except that changes in OLE Element affect the original file. Assign a name to the file via the "ServerName" parameter. 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 Element 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:
1723
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub AddOLEObjectByLinkWithReference() 'VBA806 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, hmiOLEObjectCreationTypeByLinkWithReference, True) End Sub
See also
OLEObject Object (Page1914) HMIObjects Object (Listing) (Page1884) VBA Reference (Page1664)
syntax
Expression.AlignBottom()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
Example:
In the following example two objects are inserted at different positions in the current picture and then aligned with the bottom:
Sub AlignSelectedObjectsBottom()
1724
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.AlignLeft()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
1725
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.AlignRight()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
1726
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.AlignTop()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
1727
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.ArrangeMinimizedWindows()
Expression
Necessary. An expression or element which returns an object of the "Application" type.
Parameters
--
1728
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Application Object (Page1814) VBA Reference (Page1664)
syntax
Expression.BackwardOneLevel()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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")
1729
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 MsgBox "Objects created and selected!" ActiveDocument.Selection.BackwardOneLevel End Sub
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
Syntax
Expression.BringToFront()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
1730
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.Methode(Parameter)
Expression
Necessary. An expression or element which returns an object of the "Application" type.
1731
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
--
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
See also
VBA Reference (Page1664) Application Object (Page1814)
syntax
Expression.CenterHorizontally()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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
1732
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.CenterVertically()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
Example:
In the following example two objects are inserted at different positions in the current picture and then centered vertically:
Sub CenterSelectedObjectsVertically()
1733
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.CheckSyntax(CheckOK, Error)
Expression
Necessary. An expression or element which returns an object of the "DynamicDialog" type.
Parameters
Parameter (Data Type) CheckOK (Boolean) Error (String) Description TRUE if the syntax of the specified C script is correct. The message text that is output if the C script is incorrect.
1734
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
--
See also
DynamicDialog Object (Page1851) VBA Reference (Page1664)
Syntax 1
Expression.Close(FileName)
Expression
Necessary. An expression or element which returns an object of the "Documents" type.
Syntax 2
Expression.Close()
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
Parameter (Data Type) FileName (String) Description The name of the PDL file to be closed.
1735
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the picture "Test.PDL" will 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
See also
Document Object (Page1847) ActiveDocument Property (Page1996) Documents Object (Listing) (Page1850) VBA Reference (Page1664)
syntax
Expression.CloseAll()
Expression
Necessary. An expression or element which returns an object of the "Documents" type.
Parameters
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1736
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example all open pictures in the Graphics Designer are closed:
Sub CloseAllDocuments() 'VBA136 Application.Documents.CloseAll End Sub
See also
Documents Object (Listing) (Page1850) VBA Reference (Page1664)
syntax
Expression.ConvertToScript()
Expression
Necessary. An expression or element which returns an object of the "DynamicDialog" type.
Parameters
--
1737
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") ' 'configure dynamic. "ResultType" defines the valuerange-type: With objDynDialog .ResultType = hmiResultTypeAnalog .AnalogResultInfos.Add 50, 40 .AnalogResultInfos.Add 100, 80 .AnalogResultInfos.ElseCase = 100 MsgBox "The dynamic-dialog will be changed into a C-script." .ConvertToScript End With End Sub
See also
DynamicDialog Object (Page1851) VBA Reference (Page1664)
syntax
Expression.CopySelection()
Expression
Necessary. An expression or element which returns an object of the "Document" or "Selection" type.
1738
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
--
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!" 'Instead of "ActiveDocument.CopySelection" you can also write: '"ActiveDocument.Selection.CopySelection". ActiveDocument.CopySelection Application.Documents.Add hmiOpenDocumentTypeVisible iNewDoc = Application.Documents.Count Application.Documents(iNewDoc).PasteClipboard End Sub
See also
Document Object (Page1847) ActiveDocument Property (Page1996) Selection Object (Listing) (Page1949) PasteClipboard Method (Page1781) Add Method (Documents Listing) (Page1709) Activate Method (Page1704) VBA Reference (Page1664)
1739
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.CopyToClipboard()
Expression
Necessary. An expression or element which returns a FolderItem object of the "Item" type.
Parameters
--
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).CopyToClipboard End With ' 'paste object from clipboard into "Project Library" objProjectLib.FolderItems(objProjectLib.FindByDisplayName("My Folder3")).Folder.AddFromClipBoard ("Copy of PC/PLC") End Sub
See also
SymbolLibrary Object (Page1962) FolderItem Object (Page1867) VBA Reference (Page1664) Accessing the component library with VBA (Page1593)
1740
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.CreateCustomizedObject()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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 End With MsgBox "Objects selected!" Set objCustObject = ActiveDocument.Selection.CreateCustomizedObject objCustObject.ObjectName = "myCustomizedObject" End Sub
1741
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Selection Object (Listing) (Page1949) CustomizedObject Object (Page1839) VBA Reference (Page1664) Customized Objects (Page1626)
syntax
Expression.CreateDynamic(DynamicType, [SourceCode])
Expression
Necessary. An expression or element which returns an object of the "Property" type.
Parameters
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) DynamicType (HMIDynamicCreationType) Description Defines the type of dynamics: hmiDynamicCreationTypeVariableDirect: Dynamics with a tag hmiDynamicCreationTypeVariableIndirect: Dynamics with 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 a script (C, VB). hmiDynamicCreationTypeDynamicDialog: Dynamizing with the dynamic dialog box: 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"
1742
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiDynamicCreationTypeVariableDirect, "NewDynamic") ' 'Define cycle-time With objVariableTrigger .CycleType = hmiCycleType_2s End With End Sub
See also
Property Object (Page1932) DeleteDynamic Method (Page1747) VBA Reference (Page1664)
syntax
Expression.CreateGroup()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
1743
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 MsgBox "Objects selected!" Set objGroup = ActiveDocument.Selection.CreateGroup objGroup.ObjectName = "myGroup" End Sub
See also
Selection Object (Listing) (Page1949) Group Object (Page1873) VBA Reference (Page1664) Group Objects (Page1618)
4.4.6.2
D-M
Syntax
Expression.GetDeclutterObjectSize(Min, Max)
1744
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Required. An expression or element which returns an object of the "Document" type.
Parameter
Parameter (data type) Min (Long) Max (Long) Description Lower size range in pixels. Upper size range in pixels.
Example
In the following example, the decluttering limits of the active picture are read and output:
Sub ReadSettingsOfPicture() 'VBA848 Dim objectsize_min As Long, objectsize_max As Long ActiveDocument.GetDeclutterObjectSize objectsize_min, objectsize_max MsgBox objectsize_min & " " & objectsize_max End Sub
syntax
Expression.Delete()
Expression
Necessary. An expression or element which returns objects of the following types. Assignment FolderItem LanguageText Menu MenuItem Object Toolbar
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1745
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
ToolbarItem VariableTrigger View
Parameters
--
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
See also
LanguageText Object (Page1892) View Object (Page1991) VariableTrigger Object (Page1989) ToolbarItem Object (Page1970) FolderItem Object (Page1867) HMIObject Object (Page1882) MenuItem Object (Page1906) Menu Object (Page1903) VBA Reference (Page1664)
syntax
Expression.DeleteAll()
1746
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.DeleteDynamic
1747
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Property" type.
Parameters
--
Example:
In the following example the dynamic characteristic created with the aid of the CreateDynamic Method will be
Sub DeleteDynamicFromObjectMeinKreis() 'VBA146 Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects("MyCircle") objCircle.Top.DeleteDynamic End Sub
See also
Property Object (Page1932) CreateDynamic Method (Page1742) VBA Reference (Page1664)
syntax
Expression.DeselectAll()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
1748
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.Destroy()
Expression
An expression or element which returns objects of the "CustomizedObject" types.
Parameters
--
1749
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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".
See also
CustomizedObject Object (Page1839) Destroy Method (Page1749) Delete Method (Page1745) CreateCustomizedObject Method (Page1741) How to Edit a Customized Object with VBA (Page1628)
syntax
Expression.DuplicateSelection()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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
1750
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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.DuplicateSelection End Sub
See also
Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) VBA Reference (Page1664)
syntax
Expression.EvenlySpaceHorizontally()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
1751
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 .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
See also
VBA Reference (Page1664) Selection Object (Listing) (Page1949)
syntax
Expression.EvenlySpaceVertically()
1752
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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 .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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
1753
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Syntax
Expression.Export(Type, Path)
Expression
Required. An expression or element which returns an object of the "Document" type.
Parameter
Parameter (Data Type) Type (HMIImportExportType) Path (String) Description Defines the format in which the exported picture will be saved. The path in which the picture is going to be exported. The path must exist.
Example
Sub ExportAllPicturesAsPDL() 'VBA152 Dim iPictureCounter As Integer Dim strPath As String strPath = "C:\WinCC_PDL_Export\" 'Count Pictures in Graphics Designer... For iPictureCounter = 1 To grafexe.Documents.Count '...and export each picture as PDL-file to specified path: grafexe.Documents(iPictureCounter).Export hmiImportExportTypePDL, strPath Next iPictureCounter End Sub
See also
View Object (Page1991) Document Object (Page1847)
1754
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.Find([ObjectType], [ObjectName], [PropertyName])
Expression
Necessary. An expression or element which returns an object of the "HMIObjects" type.
Parameters
You must specify at least one of the three parameters.
Parameter (Data Type) ObjectType (String) Description 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) The name of the object that is to be searched for. You can use placeholders (?,*) in the object name in order to find objects with similar names. 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").
ObjectName (String)
PropertyName (String)
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
1755
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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".
See also
Type Property (Page2315) Name Property (Page2228) Property Object (Page1932) HMIObjects Object (Listing) (Page1884) How to edit Default objects, Smart objects, Windows objects and Tube objects (Page1610) VBA Reference (Page1664)
syntax
Expression.FindByDisplayName(DisplayName)
Expression
Necessary. An expression or element which returns an object of the "SymbolLibrary" type or the "FolderItems" listing.
1756
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) DisplayName (String) Description 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
See also
FolderItem Object (Page1867) Accessing the component library with VBA (Page1593)
syntax
Expression.FlipHorizontally()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
1757
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
--
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 MsgBox "Value of '" & strPropertyName & "' after flip: " & iPropertyValue End With End Sub
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.FlipVertically()
1758
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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 iPropertyValue = objStaticText.AlignmentLeft MsgBox "Value of '" & strPropertyName & "' after flip: " & iPropertyValue End With End Sub
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.ForwardOneLevel()
1759
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
1760
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Note To obtain the internal access path, select the "Copy Path" command from The internal access path to the folder or object will then be copied to the clipboard.
syntax
Expression.GetItemByPath(PathName)
Expression
Necessary. An expression or element which returns an object of the "SymbolLibrary" type.
Parameters
Parameter (Data Type) PathName (String) Description 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
See also
SymbolLibrary Object (Page1962) FolderItem Object (Page1867) Accessing the component library with VBA (Page1593)
1761
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.InsertFromMenuItem(Position, Key, pMenuItem, DefaultToolTipText)
Expression
Necessary. An expression or element which returns an object of the "ToolbarItems" type.
Parameters
Parameter (Data Type) Position (Long) Key (Variant) pMenuItem (HMIMenuItem) DefaultToolTipText (String) Description Defines the position of the icon within the userdefined toolbar. Identifies the symbol. Use unique names for "Key" "(e.g. tItem1_1). The MenuItem object that is intended to be referenced. Defines for the icon concerned the tool tip text that will be displayed when you move the mouse over the icon.
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 user-defined 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.
1762
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'************************************************* ' 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.InsertFromMenuItem(1, "ToolbarItem1", objMenuItem, "Call's Hello World of TestMenu") End Sub Sub HelloWorld() MsgBox "Procedure 'HelloWorld()' is execute." End Sub
See also
ToolbarItems Object (Listing) (Page1973) InsertSeparator Method (Page1766) Add Method (CustomToolbars Listing) (Page1708) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573)
syntax
Expression.InsertMenu(Position, Key, DefaultLabel)
Expression
Necessary. An expression or element which returns an object of the "CustomMenus" type.
1763
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) Position (Long) Description 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. Identifies the user-defined menu. Use unique names for "Key" (e.g. "DocMenu1") The name of the user-defined menu.
Example:
In the following example, a user-defined menu with two menus 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 submenu") Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6, "dmItem1_6", "Second item in submenu") End Sub
1764
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Menus Object (Listing) (Page1904) InsertSubmenu Method (Page1767) InsertSeparator Method (Page1766) InsertMenuItem Method (Page1765) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573)
syntax
Expression.InsertMenuItem(Position, Key, DefaultLabel)
Expression
Necessary. An expression or element which returns an object of the "MenuItems" type.
Parameters
Parameter (Data Type) Position (Long) Key (Variant) DefaultLabel (String) Description Defines the position of the submenu within the user-defined menu. Identifies the submenu. Use unique names for "Key" "(e.g. dSubMenu1_4). Defines the name of the submenu.
Example:
In the following example, a user-defined menu with two menus 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 '
1765
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 submenu") Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6, "dmItem1_6", "Second item in submenu") End Sub
See also
MenuItems Object (Listing) (Page1909) MenuItem Object (Page1906) InsertSubmenu Method (Page1767) InsertSeparator Method (Page1766) InsertMenu Method (Page1763) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573)
syntax
Expression.InsertSeparator(Position, Key)
1766
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "MenuItems" or "ToolbarItems" type.
Parameters
Parameter (Data Type) Position (Long) Key (Variant) Description Defines the position of the dividing line within the user-defined menu or user-defined toolbar. 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 symbol-icon Set objToolbarItem = objToolbar.ToolbarItems.InsertSeparator(2, "tSeparator1_2") End Sub
See also
ToolbarItems Object (Listing) (Page1973) MenuItems Object (Listing) (Page1909) InsertToolbarItem Method (Page1769) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573)
1767
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.InsertSubmenu(Position, Key, DefaultLabel)
Expression
Necessary. An expression or element which returns an object of the "MenuItem" type
Parameters
Parameter (Data Type) Position (Long) Key (Variant) DefaultLabel (String) Description Defines the position of the submenu within the user-defined menu. Identifies the submenu. Use unique names for "Key" "(e.g. dSubMenu1_4). Defines the name of the submenu.
Example:
In the following example, a user-defined menu with two menus 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 submenu") Set objMenuItem = objSubMenu.SubMenu.InsertMenuItem(6, "dmItem1_6", "Second item in submenu") End Sub
1768
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
MenuItem Object (Page1906) InsertSeparator Method (Page1766) InsertMenuItem Method (Page1765) InsertMenu Method (Page1763) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573)
syntax
Expression.InsertToolbarItem(Position, Key, DefaultToolTipText)
Expression
Necessary. An expression or element which returns an object of the "ToolbarItems" type.
Parameters
Parameter (Data Type) Position (Long) Key (Variant) DefaultToolTipText (String) Description Defines the position of the icon within the userdefined toolbar. Identifies the symbol. Use unique names for "Key" "(e.g. tItem1_1). Defines for the icon concerned the tool tip text that will be displayed when you move the mouse over the icon.
1769
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 symbol-icon Set objToolbarItem = objToolbar.ToolbarItems.InsertSeparator(2, "tSeparator1_2") End Sub
See also
ToolbarItems Object (Listing) (Page1973) InsertSeparator Method (Page1766) Add Method (CustomToolbars Listing) (Page1708) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573)
syntax
Expression.IsCSLayerVisible(Index)
1770
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
Parameter (Data Type) Index (Variant) Description 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
See also
Document Object (Page1847) VBA Reference (Page1664) Editing Layers with VBA (Page1603)
syntax
Expression.IsRTLayerVisible(Index)
1771
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
Parameter (Data Type) Index (Variant) Description 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
See also
Document Object (Page1847) VBA Reference (Page1664) Editing Layers with VBA (Page1603)
syntax
Expression.Item(Index)
1772
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object.
Parameters
Parameter (Data Type) Index (Variant) Description 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
1773
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VariableStateValues Object (Listing) (Page1987) Count Property (Page2082) Views Object (Listing) (Page1993) VariableTriggers Object (Listing) (Page1990) ToolbarItems Object (Listing) (Page1973) Toolbars Object (Listing) (Page1968) SymbolLibraries Object (Listing) (Page1963) Selection Object (Listing) (Page1949) Properties Object (Listing) (Page1931) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) MenuItems Object (Listing) (Page1909) Menus Object (Listing) (Page1904) Layers Object (Listing) (Page1895) LanguageTexts Object (Listing) (Page1893) LanguageFonts Object (Listing) (Page1890) GroupedObjects Object (Listing) (Page1877) FolderItems Object (Listing) (Page1868) Events Object (Listing) (Page1863) Documents Object (Listing) (Page1850) DataLanguages Object (Listing) (Page1842) ConnectionPoints Object (Listing) (Page1837) AnalogResultInfos Object (Listing) (Page1813) Actions Object (Listing) (Page1810) VBA Reference (Page1664)
1774
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Syntax
Expression.ItemByLcid(LangID)
Expression
Required. An expression or element which returns an object of the "LanguageFonts" type.
Parameter
Parameter (Data Type) LangID (Long) Description This is the language identifier. The list of language identifiers is contained, for example, in the "Languages.csv" file that is found in the index of the WinCC documentation.
Example
The following example sets the font attributes of a button for French and English. In contrast to English, French is displayed on the button in a smaller font with a constant tracking (Courier New, 12pt):
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 English: With objLangFonts.ItemByLCID(1033) .Family = "Times New Roman" .Bold = False .Italic = True .Underlined = False .Size = 14 End With ' 'To make fontsettings for French: With objLangFonts.ItemByLCID(1036) .Family = "Courier New" .Bold = True .Italic = False .Underlined = True .Size = 12 End With End Sub
1775
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
LanguageFonts Object (Listing) (Page1890)
syntax
Expression.LoadDefaultConfig(FileName)
Expression
Necessary. An expression or element which returns an object of the "Application" type.
Parameters
Parameter (Data Type) FileName (String) Description 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
See also
Application Object (Page1814) SaveDefaultConfig Method (Page1793) VBA Reference (Page1664)
1776
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.MoveOneLayerDown()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
1777
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.MoveOneLayerUp()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
1778
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.MoveSelection(PosX, PosY)
Expression
Necessary. An expression or element which returns an object of the "Document" or "Selection" type.
Parameters
Parameter (Data Type) PosX (Long) PosY (Long) Description The number of pixels by which the selection is to be moved horizontally. 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 .Top = 40 .Left = 40 .Selected = True End With With objRectangle
1779
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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
See also
Top Property (Page2311) Left Property (Page2192) Document Object (Page1847) VBA Reference (Page1664)
4.4.6.3
O-Z
syntax
Expression.Open(FileName, [HMIOpenDocumentType])
Expression
Necessary. An expression or element which returns an object of the "Documents" type.
1780
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) FileName (String) Description 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", hmiOpenDocumentTypeVisible End Sub
See also
Hide Property (Page2140) Documents Object (Listing) (Page1850) VBA Reference (Page1664)
1781
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.PasteClipboard()
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
--
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 hmiOpenDocumentTypeVisible iNewDoc = Application.Documents.Count Application.Documents(iNewDoc).PasteClipboard End Sub
See also
ActiveDocument Property (Page1996) Document Object (Page1847) CopySelection Method (Page1738) Add Method (Documents Listing) (Page1709) Activate Method (Page1704) VBA Reference (Page1664)
syntax
Expression.PrintDocument()
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1782
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "View" type.
Parameters
--
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
See also
View Object (Page1991) VBA Reference (Page1664)
syntax
Expression.PrintProjectDocumentation()
1783
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
--
Example:
In the following example the project documentation for the active picture will be printed:
Sub ToPrintProjectDocumentation() 'VBA178 ActiveDocument.PrintProjectDocumentation End Sub
See also
Document Object (Page1847) VBA Reference (Page1664)
syntax
Expression.Remove(Index)
Expression
Necessary. An expression or element which returns an object of the "GroupedObjects" or "Selection" type.
1784
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
Parameter (Data Type) Index (Variant) Description 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") 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
1785
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Selection Object (Listing) (Page1949) GroupedObjects Object (Listing) (Page1877) VBA Reference (Page1664)
syntax
Expression.Rotate()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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
1786
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End With MsgBox "Objects selected!" Set objGroup = ActiveDocument.Selection.CreateGroup MsgBox "Group-object created." objGroup.Selected = True ActiveDocument.Selection.Rotate End Sub
See also
VBA Reference (Page1664) Selection Object (Listing) (Page1949)
syntax
Expression.SameHeight()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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")
1787
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
With objCircle .Top = 30 .Left = 0 .Height = 15 .Selected = True End With With objRectangle .Top = 80 .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
See also
Height Property (Page2139) Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.SameWidth()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
1788
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
--
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 .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
See also
Width Property (Page2408) Selection Object (Listing) (Page1949) VBA Reference (Page1664)
1789
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.SameWidthAndHeight()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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 .Left = 42 .Width = 25 .Height = 40 .Selected = True End With With objEllipse .Top = 48 .Left = 162 .Width = 40
1790
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.Height = 120 .BackColor = RGB(255, 0, 0) .Selected = True End With MsgBox "Objects selected!" ActiveDocument.Selection.SameWidthAndHeight End Sub
See also
Width Property (Page2408) Height Property (Page2139) Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.Save()
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
--
Example:
In the following example the active picture in the Graphics Designer will be saved:
Sub SaveDocument() 'VBA184 ActiveDocument.Save End Sub
1791
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ActiveDocument Property (Page1996) Document Object (Page1847) VBA Reference (Page1664)
syntax
Expression.SaveAll()
Expression
Necessary. An expression or element which returns an object of the "Documents" type.
Parameters
--
Example:
In the following example all open pictures in the Graphics Designer are saved:
Sub SaveAllDocuments() 'VBA185 Application.Documents.SaveAll End Sub
See also
Documents Object (Listing) (Page1850) VBA Reference (Page1664)
1792
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
Expression.SaveAs(FileName)
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
Parameter (Data Type) FileName (String) Description 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
See also
LockedByCreatorID Property (Page2200) ActiveDocument Property (Page1996) Document Object (Page1847) VBA Reference (Page1664)
1793
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.SaveDefaultConfig(FileName)
Expression
Necessary. An expression or element which returns an object of the "Application" type.
Parameters
Parameter (Data Type) FileName (String) Description 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
See also
Application Object (Page1814) LoadDefaultConfig Method (Page1776) VBA Reference (Page1664)
syntax
Expression.SelectAll()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
1794
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Parameters
--
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 .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
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
1795
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Note If the "SendToBack" method is used, the sequence of HMI objects can change in the HMIObjects listing.
Syntax
Expression.SendToBack()
Expression
Necessary. An expression or element which returns an object of the "Selection" type.
Parameters
--
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 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
1796
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Selection Object (Listing) (Page1949) VBA Reference (Page1664)
syntax
Expression.SetCSLayerVisible(Index, Val)
Expression
Necessary. An expression or element which returns an object of the "View" type.
Parameters
Parameter (Data Type) Index (Variant) Val (Boolean) Description Defines the CS layer that is going to be shown or hidden. Value range from 1 up to 32. 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
1797
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Document Object (Page1847) VBA Reference (Page1664) Editing Layers with VBA (Page1603)
syntax
Expression.SetDeclutterObjectSize(Min, Max)
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
Parameter (Data Type) Min (Long) Max (Long) Description Lower size range in pixels. 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
1798
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ObjectSizeDecluttering Property (Page2234) Document Object (Page1847) VBA Reference (Page1664)
syntax
Expression.SetRTLayerVisible(Index, Val)
Expression
Necessary. An expression or element which returns an object of the "Document" type.
Parameters
Parameter (Data Type) Index (Variant) Val (Boolean) Description Defines the RT layer that is going to be shown or hidden. Value range from 1 to 32. 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
1799
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Document Object (Page1847) VBA Reference (Page1664) Editing Layers with VBA (Page1603)
syntax
Expression.ShowPropertiesDialog()
Expression
Necessary. An expression or element which returns an object of the "Application" type.
Parameters
--
Example:
In the following example the "Object Properties" dialog is opened:
Sub ShowPropertiesDialog() 'VBA192 Application.ShowPropertiesDialog End Sub
See also
Application Object (Page1814) VBA Reference (Page1664)
1800
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.ShowSymbolLibraryDialog()
Expression
Necessary. An expression or element which returns an object of the "Application" type.
Parameters
--
Example:
In the following example the Components Library is opened:
Sub ShowSymbolLibraryDialog() 'VBA193 Application.ShowSymbolLibraryDialog End Sub
See also
Application Object (Page1814) VBA Reference (Page1664)
syntax
Expression.ShowTagDialog()
Expression
Necessary. An expression or element which returns an object of the "Application" type.
Parameters
--
1801
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the "Tags" dialog is opened:
Sub ShowTagDialog() 'VBA194 Application.ShowTagDialog End Sub
See also
Application Object (Page1814) VBA Reference (Page1664)
syntax
Expression.Methode()
Expression
Necessary. An expression or element which returns an object of the "Application" type.
Parameters
--
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
1802
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Application Object (Page1814) VBA Reference (Page1664)
syntax
Expression.Methode()
Expression
Necessary. An expression or element which returns an object of the "Application" type.
Parameters
--
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
See also
Application Object (Page1814) VBA Reference (Page1664)
1803
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
syntax
Expression.Ungroup(Parameter)
Expression
Necessary. An expression or element which returns an object of the "Group" type.
Parameters
--
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 .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."
1804
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Group Object (Page1873) CreateGroup Method (Page1743) VBA Reference (Page1664) Group Objects (Page1618)
4.4.7
4.4.7.1
Represents the "3D Bar" object. The 3DBarGraph object is an element of the following listings: HMIObjects: Contains all objects of a picture. Selection: Contains all selected objects of a picture.
Usage
Use the Add method to create a new "3D Bar" object in a picture:
Sub Add3DBarGraph() 'VBA200
1805
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
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
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1806
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Layer00Checked Layer00Color Layer00Value Layer01Checked Layer01Color Layer01Value Layer02Checked Layer02Color Layer02Value Layer03Checked Layer03Color Layer03Value Layer04Checked Layer04Color Layer04Value Layer05Checked Layer05Color Layer05Value Layer06Checked Layer06Color Layer06Value Layer07Checked Layer07Color Layer07Value Layer08Checked Layer08Color Layer08Value Layer09Checked Layer09Color Layer09Value Layer10Checked Layer10Color Layer10Value Layer Left
1807
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
LightEffect Max. Min. Name Operation PasswordLevel PredefinedAngles Process ToolTipText Top Visible Width ZeroPointValue
1808
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Selection Object (Listing) (Page1949) Layer09Color Property (Page2180) Layer01Checked Property (Page2163) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) ZeroPointValue Property (Page2413) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) Process Property (Page2260) PredefinedAngels Property (Page2259) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Min Property (Page2225) Max Property (Page2207) LightEffect Property (Page2193) Left Property (Page2192) Layer Property (Page2160) Layer10Value Property (Page2183) Layer10Color Property (Page2182) Layer10Checked Property (Page2182) Layer09Value Property (Page2181) Layer09Checked Property (Page2180) Layer08Value Property (Page2179) Layer08Color Property (Page2178) Layer08Checked Property (Page2178) Layer07Value Property (Page2177) Layer07Color Property (Page2176) Layer07Checked Property (Page2176) Layer06Value Property (Page2175)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, Layer06Checked Property (Page2174)
1809
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 .Left = 10 .Text = "Increase Radius" End With 'define event and assign sourcecode to it: Set objVBScript = objButton.Events(1).Actions.AddAction(hmiActionCreationTypeVBScript) strVBCode = "Dim myCircle" & vbCrLf & "Set myCircle = " strVBCode = strVBCode & "HMIRuntime.ActiveScreen.ScreenItems(""Circle_VB"")" strVBCode = strVBCode & vbCrLf & "myCircle.Radius = myCircle.Radius + 5" With objVBScript
1810
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
AddAction Method (Page1713) Configuring Event-Driven Actions with VBA (Page1644) Parent Property (Page2241) Item Property (Page2152) Count Property (Page2082) Application Property (Page2008)
Represents the ActiveX Control object. The ActiveXControl object is an element of the following listings: HMIObjects: Contains all objects of a picture. Selection: Contains all selected objects of a picture.
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
1811
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ServerName Property (Page2287) AddActiveXControl Method (Page1714) VBA Reference (Page1664) ActiveX controls (Page1617) ProgID Property (Page2262)
Displays an analog value range and associated property value in the Dynamic dialog. The AnalogResultInfo object is an element of the AnalogResultInfos listing:
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.
1812
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
AnalogResultInfos Object (Listing) (Page1813) Delete Method (Page1745) Value Property (Page2331) RangeTo Property (Page2270) Parent Property (Page2241) Application Property (Page2008)
A listing of AnalogResultInfo objects that contain all the analog value ranges and the associated property value in the Dynamic dialog.
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog .AnalogResultInfos.Add 50, 40 .AnalogResultInfos.Add 100, 80 .AnalogResultInfos.ElseCase = 100 End With
1813
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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() '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_A-Radius:" & vbCrLf & "Range of value to: " & varRange & vbCrLf & "Value of property: " & varValue, vbOKCancel) If vbCancel = iAnswer Then Exit For Next objAResultInfo End Sub
See also
Add Method (AnalogResultInfos Listing) (Page1706) Parent Property (Page2241) Item Property (Page2152) ElseCase Property (Page2097) Count Property (Page2082) Application Property (Page2008)
1814
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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.
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
1815
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ShowTagDialog Method (Page1801) CurrentDesktopLanguage Property (Page2084) TileWindowsVertically Method (Page1803) TileWindowsHorizontally Method (Page1802) ShowSymbolLibraryDialog Method (Page1800) ShowPropertiesDialog Method (Page1800) SaveDefaultConfig Method (Page1793) LoadDefaultConfig Method (Page1776) CascadeWindows Method (Page1731) ArrangeMinimizedWindows Method (Page1728) Activate Method (Page1704) VBA Reference (Page1664) WindowState Property (Page2412) Visible Property (Page2405) Version Property (Page2404) VBE Property (Page2404) VBAVersion Property (Page2404) SymbolLibraries Property (Page2299) ProjectType Property (Page2263) ProjectName Property (Page2262) ProfileName Property (Page2261) Parent Property (Page2241) Name Property (Page2228) IsConnectedToProject Property (Page2149) Documents Property (Page2095) DefaultHMIObjects Property (Page2089) CustomToolbars Property (Page2086) CustomMenus Property (Page2086) CurrentDataLanguage Property (Page2083) ConfigurationFileName Property (Page2081) AvailableDataLanguages Property (Page2013) ApplicationDataPath Property (Page2008) Application Property (Page2008) ActiveDocument Property (Page1996)
1816
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Application Window" object. The ApplicationWindow 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 property values of all standard, Windows, and smart objects.
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 End Sub Use "Selection"(Index) to return an object from the Selection listing:
1817
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Caption Property (Page2053) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) WindowBorder Property (Page2409) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) Sizeable Property (Page2292) OnTop Property (Page2236) Name Property (Page2228) Moveable Property (Page2227) MaximizeButton Property (Page2208) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) CloseButton Property (Page2065) Application Property (Page2008)
1818
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Bar" object. The BarGraph 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.
VBAbezeichnung
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
1819
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1820
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
TypeWarningHigh Property (Page2322) Max Property (Page2207) FillColor Property (Page2104) BorderStyle Property (Page2043) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) ZeroPointValue Property (Page2413) ZeroPoint Property (Page2412) Width Property (Page2408) WarningLow Property (Page2407) WarningHigh Property (Page2406) Visible Property (Page2405) TypeWarningLow Property (Page2323) TypeToleranceLow Property (Page2322) TypeToleranceHigh Property (Page2321) TypeLimitLow5 Property (Page2320) TypeLimitLow4 Property (Page2319) TypeLimitHigh5 Property (Page2318) TypeLimitHigh4 Property (Page2318) TypeAlarmLow Property (Page2317) TypeAlarmHigh Property (Page2316) Trend Property (Page2313) TrendColor Property (Page2314) Top Property (Page2311) ToolTipText Property (Page2310) ToleranceLow Property (Page2308) ToleranceHigh Property (Page2308) ScalingType Property (Page2279) Scaling Property (Page2278) ScaleTicks Property (Page2277) ScaleColor Property (Page2277)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, Process Property (Page2260)
RightComma Property (Page2273) 1821 PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228)
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Displays both the binary (boolean) value ranges and the associated property values in the Dynamic dialog.
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeBool .BinaryResultInfo.NegativeValue = 20 .BinaryResultInfo.PositiveValue = 40 End With End Sub
See also
VBA Reference (Page1664) PositiveValue Property (Page2258) Parent Property (Page2241) NegativeValue Property (Page2229) Application Property (Page2008)
1822
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Displays both the value ranges for bit set/not set and the associated property values in the Dynamic dialog.
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeBit .BitResultInfo.BitNumber = 1 .BitResultInfo.BitSetValue = 40 .BitResultInfo.BitNotSetValue = 80 End With End Sub
1823
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Delete Method (Page1745) VBA Reference (Page1664) BitSetValue Property (Page2033) BitNumber Property (Page2032) BitNotSetValue Property (Page2031) Application Property (Page2008)
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.
VBAbezeichnung
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
1824
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1825
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ForeFlashColorOn Property (Page2133) BorderColorBottom Property (Page2038) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) Text Property (Page2306) PictureUp Property (Page2253) PictureDown Property (Page2251) PasswordLevel Property (Page2244) Orientation Property (Page2239) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Hotkey Property (Page2142) Height Property (Page2139) ForeFlashColorOff Property (Page2132) ForeColor Property (Page2132) FontUnderline Property (Page2131) FontSize Property (Page2130) FontName Property (Page2129) FontItalic Property (Page2128) FontBold Property (Page2126) FlashRateForeColor Property (Page2123) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashForeColor Property (Page2114) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) 1826 FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Check Box" object. The CheckBox 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.
VBAbezeichnung
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
1827
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) BitSetValue Property (Page2033) BitNumber Property (Page2032) BitNotSetValue Property (Page2031) Application Property (Page2008)
Represents the "Circle" object. The Circle 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.
1828
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1829
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
FillColor Property (Page2104) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) Radius Property (Page2268) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BackFlashColorOn Property (Page2022) BackFlashColorOff Property (Page2021) BackColor Property (Page2017)
1830
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Circular Arc" object. The CircularArc 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.
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
1831
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1832
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
HMIObjects Object (Listing) (Page1884) BorderBackColor Property (Page2035) Selection Object (Listing) (Page1949) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) StartAngle Property (Page2296) Radius Property (Page2268) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashBorderColor Property (Page2112) EndAngle Property (Page2098) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036)
1833
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "ComboBox" object. The ComboBox object is an element of the following lists: HMIObjects: Contains all objects of a picture. Selection: Contains all selected objects of a picture. HMIDefaultObjects: Contains the default property values of all default, smart, window and tube objects.
Usage
Use the Add method to create a new "ComboBox" object in a picture:
Sub AddComboBox() 'VBA822 Dim objComboBox As HMIComboBox Set objComboBox = ActiveDocument.HMIObjects.AddHMIObject("ComboBox", "HMIComboBox") End Sub
Use "HMIObjects"(Index)" to return an object from the HMIObjects listing, where Index in this case identifies the object by name:
1834
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub EditComboBox() 'VBA850 Dim objComboBox As HMIComboBox Set objComboBox = ActiveDocument.HMIObjects("ComboBox") objComboBox.BorderColor = RGB(255, 0, 0) End Sub
1835
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ObjectName Property (Page2232) Left Property (Page2192) Layer Property (Page2160) Top Property (Page2311) Width Property (Page2408) Height Property (Page2139) NumberLines Property (Page2231) ForeColor Property (Page2132) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BackColor Property (Page2017) BorderStyle Property (Page2043) BorderWidth Property (Page2045) FillColor Property (Page2104) FillStyle Property (Page2108) FontName Property (Page2129) FontSize Property (Page2130) FontBold Property (Page2126) FontItalic Property (Page2128) FontUnderline Property (Page2131) AlignmentLeft Property (Page2004) GlobalShadow property (Page2135) Index Property (Page2145) Text Property (Page2306) Operation Property (Page2237) PasswordLevel Property (Page2244) Visible Property (Page2405) ToolTipText Property (Page2310) OperationMessage Property (Page2238) OperationReport Property (Page2238) SelText property (Page2287) SelIndex property (Page2286)
1836
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
The listing returns the number of points to which the connector can be appended in the specified object.
Object properties
The ConnectionPoints object possesses the following properties: Application Count Item Parent
Example 1
In this example, a rectangle is inserted and the number of connection points is 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
1837
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example 2:
In this example, a text field is inserted and the connection points are accessed via "ConnectionPoints.Item". The coordinates of the connection points are shown in an output window.
Sub GetConnectionPoints() 'VBA825 Dim xPos As Long Dim yPos As Long Dim objConnPoints As HMIConnectionPoints Set objDoc = Application.ActiveDocument Set objObject = objDoc.HMIObjects.AddHMIObject("Text","HMIStaticText") Set objConnPoints = ActiveDocument.HMIObjects("Text").ConnectionPoints For i = 1 To objConnPoints.Count xPos = objObject.ConnectionPoints.Item(i)(0) yPos = objObject.ConnectionPoints.Item(i)(1) MsgBox "Coordinates " & i & ". ConnectionPoint:" & Chr(13) & "x: " & xPos & Chr(13) & "y: " & yPos Next End Sub
The diagram below shows the positions of the 4 connection points of the text field.
1838
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Note If you activate the connection points of a connector with VBA, the connection point index begins with "1". If you determine the connection points in the property window of the connector in the graphical interface, the connection point index begins with "0". The index numbers e.g. of the lower connection point in the picture are assigned as follows: VBA: Index = 3 Graphical interface: Index = 2
See also
Parent Property (Page2241) Item Property (Page2152) Count Property (Page2082) Application Property (Page2008)
Represents the object called "Customized Object". The CustomizedObject object is an element of the following listings: Objects: Contains all objects of a picture. Selection: Contains all selected objects of a picture. 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".
1839
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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") 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
1840
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) Destroy Method (Page1749) Delete Method (Page1745) CreateCustomizedObject Method (Page1741) How to Edit a Customized Object with VBA (Page1628) VBA Reference (Page1664) Customized Objects (Page1626) Editing Objects with VBA (Page1606)
4.4.7.2
D-I
Represents the installed project language, which is identified by its name and language identifier. The DataLanguage object is an element of the DataLanguages listing: The full list of language codes is available in the WinCC documentation (Index > Language ID). The hexadecimal value specified in the list has to be converted to its equivalent decimal value.
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
1841
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
DataLanguages Object (Listing) (Page1842) VBA Reference (Page1664) Language-Dependent Configuration with VBA (Page1570) Parent Property (Page2241) LanguageName Property (Page2158) LanguageID Property (Page2158) Application Property (Page2008)
A listing of the DataLanguage objects that represent all the installed project languages.
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
1842
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
iCount = 0 Set colDataLanguages = Application.AvailableDataLanguages For Each objDataLanguage In colDataLanguages If "" <> strLanguages Then strLanguages = strLanguages & "/" strLanguages = strLanguages & objDataLanguage.LanguageName & " " 'Every 15 items of datalanguages output in a messagebox If 0 = iCount Mod 15 And 0 <> iCount Then MsgBox strLanguages strLanguages = "" End If iCount = iCount + 1 Next objDataLanguage MsgBox strLanguages End Sub
See also
Language-Dependent Configuration with VBA (Page1570) DataLanguage Object (Page1841) Item Method (Page1772) VBA Reference (Page1664) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
1843
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 .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(hmiActionCreationTypeDirectConnection) 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
1844
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
DirectConnection Object (Page1845) VBA Reference (Page1664) Type Property (Page2315) ObjectName Property (Page2232) AutomationName Property (Page2011) DestinationLink Property (Page2090)
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
1845
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.Left = 100 End With 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(hmiActionCreationTypeDirectConnection) 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
See also
DestinationLink Property (Page2090) SourceLink Object (Page1955) DestLink Object (Page1843) VBA Reference (Page1664) SourceLink Property (Page2293)
1846
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Displays a picture in Graphics Designer. The document object is an element of the documents listing.
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() 'VBA812 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()
1847
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
1848
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Editing Pictures with VBA (Page1601) GridHeight Property (Page2136) Documents Object (Listing) (Page1850) SetRTLayerVisible Method (Page1799) SaveAs Method (Page1792) Save Method (Page1791) PrintProjectDocumentation Method (Page1783) PasteClipboard Method (Page1781) MoveSelection Method (Page1779) IsRTLayerVisible Method (Page1771) Export Method (Page1754) CopySelection Method (Page1738) Close Method (Page1735) VBA Reference (Page1664) ExtendedZoomingEnable Property (Page2103) Width Property (Page2408) Visible Property (Page2405) Views Property (Page2405) UpdateCycle Property (Page2327) TabOrderOtherAction Property (Page2303) TabOrderMouse Property (Page2302) TabOrderKeyboard Property (Page2301) TabOrderAllHMIObjects Property (Page2300) SnapToGrid Property (Page2293) HMIDefaultObjects Object (Listing) (Page1878) Selection Property (Page2286) Properties Property (Page2264) Path Property (Page2244) PasswordLevel Property (Page2244) Parent Property (Page2241) Operation Property (Page2237) Name Property (Page2228) LockedByCreatorID Property (Page2200) LastChange Property (Page2160) HMIObjects Property (Page2141)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, Height Property (Page2139)
1849
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1850
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Add Method (Page1705) Document Object (Page1847) SaveAll Method (Page1792) Open Method (Page1780) Item Method (Page1772) CloseAll Method (Page1736) Close Method (Page1735) VBA Reference (Page1664) Editing Pictures with VBA (Page1601) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008) ActiveDocument Property (Page1996)
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.
1851
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Usage
Use the DynamicDialog object to make an object property dynamic. 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog .Trigger.VariableTriggers.Add "NewDynamic2", hmiVariableCycleType_5s .AnalogResultInfos.Add 50, 40 .AnalogResultInfos.Add 100, 80 .AnalogResultInfos.ElseCase = 100 End With End Sub
See also
Delete Method (Page1745) ConvertToScript Method (Page1737) CheckSyntax Method (Page1734) VariableStateValues Property (Page2401) VariableStateChecked Property (Page2400) Trigger Property (Page2314) SourceCode Property (Page2295) ScriptType Property (Page2280) ResultType Property (Page2272) Parent Property (Page2241) Compiled Property (Page2080) BitResultInfo Property (Page2033) BinaryResultInfo Property (Page2031) Application Property (Page2008) AnalogResultInfos Property (Page2006)
1852
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Ellipse" object. The Ellipse 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 property values of all standard, Windows, and smart objects.
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
1853
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1854
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
FillingIndex Property (Page2107) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) RadiusWidth Property (Page2269) RadiusHeight Property (Page2268) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) Filling Property (Page2106) FillColor Property (Page2104) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BackFlashColorOn Property (Page2022) BackFlashColorOff Property (Page2021) BackColor Property (Page2017)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1855
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Ellipse Arc" object. The EllipseArc 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 property values of all standard, Windows, and smart objects.
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
1856
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1857
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ToolTipText Property (Page2310) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) StartAngle Property (Page2296) RadiusWidth Property (Page2269) RadiusHeight Property (Page2268) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashBorderColor Property (Page2112) EndAngle Property (Page2098) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035)
1858
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Ellipse Segment" object. The EllipseSegment 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 property values of all standard, Windows, and smart objects.
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
1859
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Use "Selection"(Index) to return an object from the Selection listing:
Sub ShowNameOfFirstSelectedObject() 'VBA250 '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
1860
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ToolTipText Property (Page2310) BackFlashColorOn Property (Page2022) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) StartAngle Property (Page2296) RadiusWidth Property (Page2269) RadiusHeight Property (Page2268) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104) EndAngle Property (Page2098) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, BackColor Property (Page2017)
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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.
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
1862
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Application Property (Page2008) Delete Method (Page1745) AddAction Method (Page1713) VBA Reference (Page1664) Parent Property (Page2241) EventType Property (Page2101) Actions Property (Page1995)
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 0 1 2 3 4 5 6 7 8 9 10 EventType (depending upon the object used) hmiEventTypeNotDefined hmiEventTypeMouseClick hmiEventTypeMouseLButtonDown hmiEventTypeMouseLButtonUp hmiEventTypeMouseRButtonDown hmiEventTypeMouseRButtonUp hmiEventTypeKeyboardDown hmiEventTypeKeyboardUp hmiEventTypeFocusEnter hmiEventTypeObjectChange hmiEventTypePictureOpen
1863
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 pictures are put out. In order for this example to work, insert some objects into the active picture and configure different 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
See also
Item Method (Page1772) VBA Reference (Page1664) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
1864
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "faceplate instance" object. The FaceplateObject object is an element of the following lists: HMIObjects: Contains all objects of a picture. Selection: Contains all selected objects of a picture. HMIDefaultObjects: Contains the default property values of all default, smart, window and tube objects.
Usage
Use the Add method to create a new "faceplate instance" object in a picture:
Sub AddFaceplateInstance() 'VBA826 Dim objFaceplateInstance As HMIFaceplateObject Set objFaceplateInstance = ActiveDocument.HMIObjects.AddHMIObject("faceplate instance", "HMIFaceplateObject") objFaceplateInstance.Properties.Item(3).value = "Faceplate1.fpt" End Sub
1865
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Use "HMIObjects"(Index)" to return an object from the HMIObjects listing, where Index in this case identifies the object by name:
Sub EditFaceplateInstance() 'VBA827 Dim objFaceplateInstance As HMIFaceplateObject Set objFaceplateInstance = ActiveDocument.HMIObjects("faceplate instance") objFaceplateInstance.visible = True End Sub
See also
ObjectName Property (Page2232) Layer Property (Page2160) Left Property (Page2192) Top Property (Page2311) Width Property (Page2408) Height Property (Page2139) Operation Property (Page2237) PasswordLevel Property (Page2244) Visible Property (Page2405) ToolTipText Property (Page2310) ScalingMode property (Page2279) FaceplateType property (Page2104)
1866
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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.
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").Folder.Item("Object1").CopyToClipboa rd End Sub
1867
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Type Property (Page2315) FolderItems Object (Listing) (Page1868) Delete Method (Page1745) CopyToClipboard Method (Page1740) How to Insert an Object from the Component Library into a Picture with VBA (Page1599) How to Edit the Component Library with VBA (Page1596) VBA Reference (Page1664) Accessing the component library with VBA (Page1593) Parent Property (Page2241) Name Property (Page2228) LDNames Property (Page2187) Folder Property (Page2124) Application Property (Page2008)
A listing of the FolderItem objects that represent all the folders and objects in the Components Library.
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
1868
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Dim objFolderItem As HMIFolderItem Set colFolderItems = Application.SymbolLibraries(1).FolderItems For Each objFolderItem In colFolderItems MsgBox objFolderItem.Name Next objFolderItem End Sub
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
See also
AddItem Method (Page1720) SymbolLibrary Object (Page1962) FolderItem Object (Page1867) Item Method (Page1772) AddFromClipboard Method (Page1717) AddFolder Method (Page1716) How to Insert an Object from the Component Library into a Picture with VBA (Page1599) How to Edit the Component Library with VBA (Page1596) VBA Reference (Page1664) Accessing the component library with VBA (Page1593) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
1869
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the object called "Graphic Object". The GraphicObject 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.
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
1870
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Use "Selection"(Index) to return an object from the Selection listing:
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
1871
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Left Property (Page2192) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) PicUseTransColor Property (Page2256) PictureName Property (Page2252) PicTransColor Property (Page2250) PicReferenced Property (Page2249) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BackFlashColorOn Property (Page2022) BackFlashColorOff Property (Page2021) 1872 BackColor Property (Page2017)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the object called "Group Object". The Group Object is an element of the following listings: HMIObjects: Contains all objects of a picture. Selection: Contains all selected objects of a picture. 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".
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
Use the following methods to edit an existing Group Object: Methode "Add(Index)": Adds a new object to the group object. Methode "Remove(Index)": Removes a object from the group object. "UnGroup()" method: Ungroups the group object (ungroup). "Delete()" Method: Deletes the group object and the objects that it contains.
1873
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) GroupedObjects Object (Listing) (Page1877) Ungroup Method (Page1803) Remove Method (Page1784) Delete Method (Page1745) Add Method (GroupedObjects Listing) (Page1710) How to Edit Objects in a Group Object with VBA (Page1623) How to Edit Group Objects with VBA (Page1620) VBA Reference (Page1664) Group Objects (Page1618) Editing Objects with VBA (Page1606)
Represents the "Group Display" object. The GroupDisplay object is an element of the following listings: Objects: Contains all objects of a picture. Selection: Contains all selected objects of a picture.
1874
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1875
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
MCText Property (Page2222) Height Property (Page2139) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) UserValue4 Property (Page2330) UserValue3 Property (Page2329) UserValue2-Eigenschaft (Page2328) UserValue1 Property (Page2328) Top Property (Page2311) ToolTipText Property (Page2310) SignificantMask Property (Page2290) SameSize Property (Page2276) Relevant Property (Page2272) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) MessageClass Property (Page2224) MCKQTextFlash Property (Page2221) MCKQTextColorOn Property (Page2220) MCKQTextColorOff Property (Page2220) MCKQBackFlash Property (Page2219) MCKQBackColorOn Property (Page2218) MCKQBackColorOff Property (Page2218) MCKOTextFlash Property (Page2217) MCKOTextColorOn Property (Page2216) MCKOTextColorOff Property (Page2215) MCKOBackFlash Property (Page2215) MCKOBackColorOn Property (Page2214) MCKOBackColorOff Property (Page2213) MCGUTextFlash Property (Page2213) MCGUTextColorOn Property (Page2212) 1876 MCGUTextColorOff Property (Page2211) MCGUBackFlash Property (Page2211) MCGUBackColorOn Property (Page2210) MCGUBackColorOff-Eigenschaft (Page2209)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
A listing of the HMIObject objects that represent all the objects in the group object.
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
1877
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Item Method (Page1772) Group Object (Page1873) Remove Method (Page1784) Add Method (GroupedObjects Listing) (Page1710) How to Edit Group Objects with VBA (Page1620) VBA Reference (Page1664) Group Objects (Page1618) Parent Property (Page2241) GroupedHMIObjects Property (Page2138) Count Property (Page2082) Application Property (Page2008)
1878
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Object I/O Field Button Check box Radio box Round button Bar Slider object Graphic Object Status display Text list Connector Multiple row text Combo box List box Polygon tube T-piece Double T-piece Tube bend 3D bar Group display Faceplate instance VBA object name HMIIOField HMIButton HMICheckBox HMIOptionGroup HMIRoundButton HMIBarGraph HMISlider HMIGraphicObject HMIStatusDisplay HMITextList HMIObjConnection HMIMultiLineEdit HMIComboBox HMIListBox HMITubePolyline HMITubeTeeObject HMITubeDoubleTeeObject HMITubeArcObject HMI3DBarGraph HMIGroupDisplay HMIFaceplateObject
Usage
Use the DefaultHMIObjects property to change the default property values of the included objects. 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
1879
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1880
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Button Object (Page1824) TextList Object (Page1964) StatusDisplay Object (Page1959) StaticText Object (Page1956) Slider object (Page1952) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) PolyLine Object (Page1928) Polygon Object (Page1925) PieSegment Object (Page1922) PictureWindow Object (Page1919) OptionGroup Object (Page1916) Line Object (Page1897) IOField Object (Page1886) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) BarGraph Object (Page1819) ApplicationWindow Object (Page1817) Item Method (Page1772) VBA Reference (Page1664) Parent Property (Page2241) Count Property (Page2082) DefaultHMIObjects Property (Page2089) Application Property (Page2008)
1881
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents an object from the Object Palette of the Graphics Designer. The HMIObject 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 property values of all standard, Windows, and smart objects. This object contains the object properties that apply to all standard, smart and Windows objects (incl. Width, Height, Top and Left).
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:
1882
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub DeleteObject() 'VBA269 ActiveDocument.HMIObjects(1).Delete End Sub
See also
Name Property (Page2228) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) Delete Method (Page1745) VBA Reference (Page1664) Default objects, Smart objects, Windows objects and Tube objects (Page1609) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Type Property (Page2315) Top Property (Page2311) ToolTipText Property (Page2310) TabOrderAlpha Property (Page2301) TabOrderSwitch Property (Page2299) Selected Property (Page2285) Properties Property (Page2264) PasswordLevel Property (Page2244) Parent Property (Page2241) Operation Property (Page2237) Left Property (Page2192) LDTooltipTexts Property (Page2190) Layer Property (Page2160) Height Property (Page2139) GroupParent Property (Page2138) Events Property (Page2099) Application Property (Page2008)
1883
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
A listing of the HMIObject objects that represent all the objects in the picture.
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:
1884
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub AddCircle() 'VBA271 Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle_1", "HMICircle") End Sub
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
See also
Count Property (Page2082) HMIDefaultObjects Object (Listing) (Page1878) Selection Object (Listing) (Page1949) Item Method (Page1772) Find Method (Page1755) AddOLEObject Method (Page1722) AddHMIObject Method (Page1719) AddActiveXControl Method (Page1714) How to edit Default objects, Smart objects, Windows objects and Tube objects (Page1610) VBA Reference (Page1664) Default objects, Smart objects, Windows objects and Tube objects (Page1609) Editing Objects with VBA (Page1606) Parent Property (Page2241) Application Property (Page2008)
1885
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "I/O Field" object. The IOField 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.
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
1886
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1887
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
LimitMin Property (Page2197) ClearOnNew Property (Page2064) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) PasswordLevel Property (Page2244) OutputValue Property (Page2241) OutputFormat Property (Page2240) Orientation Property (Page2239) OperationReport Property (Page2238) OperationMessage Property (Page2238) Operation Property (Page2237) Name Property (Page2228) LimitMax Property (Page2197) Left Property (Page2192) Layer Property (Page2160) HiddenInput Property (Page2141) Height Property (Page2139) ForeFlashColorOn Property (Page2133) ForeFlashColorOff Property (Page2132) ForeColor Property (Page2132) FontUnderline Property (Page2131) FontSize Property (Page2130) FontName Property (Page2129) FontItalic Property (Page2128) FontBold Property (Page2126) FlashRateForeColor Property (Page2123) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) 1888 FlashForeColor Property (Page2114) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.7.3
L-Q
Contains the font settings for the project language. The LanguageFont object is an element of the LanguageFonts listing.
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:
1889
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
LanguageFonts Object (Listing) (Page1890) VBA Reference (Page1664) Underlined Property (Page2324) Size Property (Page2291) Parent Property (Page2241) LanguageID Property (Page2158) Italic Property (Page2151) FontFamily Property (Page2127) Bold Property (Page2034) Application Property (Page2008)
A listing of the LanguageFont objects that represent all the language-dependent fonts in an object.
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
1890
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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.
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
See also
LanguageFont Object (Page1889) ItemByLcid Method (Page1774) Item Method (Page1772) VBA Reference (Page1664) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1891
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Contains the multilingual labels for an object. The LanguageText object is an element of the LanguageTexts listing.
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
See also
LanguageTexts Object (Listing) (Page1893) Delete Method (Page1745) VBA Reference (Page1664) Parent Property (Page2241) LanguageID Property (Page2158) DisplayText Property (Page2094) Application Property (Page2008)
1892
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
A listing of the LanguageText objects that represent all the multilingual texts in an object.
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: Set objLabelText = ActiveDocument.HMIObjects("myButton").LDTexts.Add(1033, "English Text") End Sub
1893
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
LanguageText Object (Page1892) ItemByLcid Method (Page1774) Item Method (Page1772) VBA Reference (Page1664) Parent Property (Page2241) LDTooltipTexts Property (Page2190) LDTexts Property (Page2190) LDStatusTexts Property (Page2188) LDNames Property (Page2187) LDLabelTexts Property (Page2186) Count Property (Page2082) Application Property (Page2008)
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 RT 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:
1894
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layers Property (Page2184) VBA Reference (Page1664) Editing Layers with VBA (Page1603) Visible Property (Page2405) Number Property (Page2230) Name Property (Page2228) MinZoom Property (Page2226) MaxZoom Property (Page2208) LDNames Property (Page2187) ActiveLayer Property (Page1996)
A listing of the Layer objects that represent the 32 layers in the picture.
1895
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 > iCounter Then strLayerList = strLayerList & vbCrLf ElseIf 11 > iCounter Then strLayerList = strLayerList & " " Else strLayerList = strLayerList & " " End If strLayerList = strLayerList & objLayer.Name iCounter = iCounter + 1 Next objLayer MsgBox strLayerList End Sub
See also
Layer Object (Page1894) Item Method (Page1772) VBA Reference (Page1664) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
1896
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Line" object. The Line 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.
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
1897
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1898
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
AddHMIObject Method (Page1719) BorderBackColor Property (Page2035) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) RotationAngle Property (Page2274) ReferenceRotationTop Property (Page2271) ReferenceRotationLeft Property (Page2270) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Index Property (Page2145) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashBorderColor Property (Page2112) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderEndStyle Property (Page2039) BorderColor Property (Page2036) ActualPointTop Property (Page1998) ActualPointLeft Property (Page1997)
1899
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "ListBox" object. The ListBox 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 property values of all default, smart, window and tube objects.
Usage
Use the Add method to create a new "ListBox" object in a picture:
Sub AddListBox() 'VBA829 Dim objListBox As HMIListBox Set objListBox = ActiveDocument.HMIObjects.AddHMIObject("ListBox", "HMIListBox") End Sub
Use "HMIObjects"(Index)" to return an object from the HMIObjects listing, where Index in this case identifies the object by name:
1900
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub EditListBox() 'VBA830 Dim objListBox As HMIListBox Set objListBox = ActiveDocument.HMIObjects("ListBox") objListBox.BorderColor = RGB(255, 0, 0) End Sub
1901
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ObjectName Property (Page2232) Layer Property (Page2160) Left Property (Page2192) Top Property (Page2311) Width Property (Page2408) Height Property (Page2139) NumberLines Property (Page2231) ForeColor Property (Page2132) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BackColor Property (Page2017) FillColor Property (Page2104) BorderStyle Property (Page2043) BorderWidth Property (Page2045) FillStyle Property (Page2108) GlobalShadow property (Page2135) FontName Property (Page2129) FontSize Property (Page2130) FontBold Property (Page2126) FontItalic Property (Page2128) FontUnderline Property (Page2131) AlignmentLeft Property (Page2004) Index Property (Page2145) Text Property (Page2306) Operation Property (Page2237) PasswordLevel Property (Page2244) Visible Property (Page2405) ToolTipText Property (Page2310) OperationMessage Property (Page2238) OperationReport Property (Page2238) SelIndex property (Page2286) SelText property (Page2287)
1902
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "User Defined Menu" object. The Menu object is an element of the CustomMenus listing.
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 ApplicationSpecific Menu" in this documentation. In the following example the name of the first userdefined 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
1903
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Menus Object (Listing) (Page1904) Delete Method (Page1745) How to Create Picture-Specific Menus and Toolbars (Page1602) How to Create a New Application-Specific Menu (Page1575) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573) Visible Property (Page2405) StatusText Property (Page2297) Position Property (Page2257) Parent Property (Page2241) MenuItems Property (Page2222) LDStatusTexts Property (Page2188) LDLabelTexts Property (Page2186) Label Property (Page2157) Key Property (Page2155) Enabled Property (Page2098) Application Property (Page2008)
A listing of the Menu objects that represent all the user-defined menus in the Graphics Designer.
1904
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 picture-specific 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
Use the Application property and the InsertMenu method if you want to create an applicationspecific menu. Create the VBA code in either the "Project Template" document or the "Global Template" document. In the following example a user-defined 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 picturespecific 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
1905
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Menu Object (Page1903) Item Method (Page1772) InsertMenu Method (Page1763) How to Create Picture-Specific Menus and Toolbars (Page1602) How to Create a New Application-Specific Menu (Page1575) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
Represents a menu entry for a user-defined menu in the Graphics Designer. The MenuItem object is an element of the MenuItems listing.
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.
1906
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
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
1907
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Parent Property (Page2241) MenuItems Object (Listing) (Page1909) Delete Method (Page1745) Configuring Menus and Toolbars (Page1572) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Add a New Menu Item to the Menu (Page1577) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573) Visible Property (Page2405) Tag Property (Page2303) SubMenu Property (Page2298) StatusText Property (Page2297) ShortCut Property (Page2289) Position Property (Page2257) MenuItemType Property (Page2223) Macro Property (Page2206) LDStatusTexts Property (Page2188) LDLabelTexts Property (Page2186) Label Property (Page2157) Key Property (Page2155) Icon Property (Page2144) Enabled Property (Page2098) Checked Property (Page2056) Application Property (Page2008)
1908
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 picturespecific menu in the output.
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 "MenuItem1" is inserted:
1909
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
InsertSubmenu Method (Page1767) MenuItem Object (Page1906) InsertSeparator Method (Page1766) InsertMenuItem Method (Page1765) How to Add a New Menu Item to the Menu (Page1577) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
1910
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "MultiLineEdit" object. The MultiLineEdit 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 property values of all default, smart, window and tube objects.
Usage
Use the Add method to create a new "MultiLineEdit" object in a picture:
Sub AddMultiLineEdit() 'VBA832 Dim objMultiLineEdit As HMIMultiLineEdit Set objMultiLineEdit = ActiveDocument.HMIObjects.AddHMIObject("MultiLineEdit", "HMIMultiLineEdit") End Sub
Use "HMIObjects"(Index)" to return an object from the HMIObjects listing, where Index in this case identifies the object by name:
Sub EditMultiLineEdit() 'VBA833 Dim objMultiLineEdit As HMIMultiLineEdit Set objMultiLineEdit = ActiveDocument.HMIObjects("MultiLineEdit") objMultiLineEdit.BorderColor = RGB(255, 0, 0) End Sub
1911
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Layer Property (Page2160) Left Property (Page2192) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BorderStyle Property (Page2043) BorderWidth Property (Page2045) BackColor Property (Page2017) FontName Property (Page2129) FontSize Property (Page2130) FontBold Property (Page2126) FontItalic Property (Page2128) FontUnderline Property (Page2131) ForeColor Property (Page2132) AlignmentLeft Property (Page2004) Top Property (Page2311) Width Property (Page2408) Height Property (Page2139) Text Property (Page2306) Operation Property (Page2237) PasswordLevel Property (Page2244) Visible Property (Page2405) ToolTipText Property (Page2310) ObjectName Property (Page2232) GlobalShadow property (Page2135)
1912
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 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
1913
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 Private Sub Document_MenuItemClicked(ByVal MenuItem As IHMIMenuItem) Select Case MenuItem.Key Case "ShowConnectInfo" Call ShowConnectorInfo End Select End Sub
See also
TopConnectedConnectionPointIndex Property (Page2312) TopConnectedObjectName Property (Page2312) BottomConnectedConnectionPointIndex Property (Page2047) BottomConnectedObjectName Property (Page2046)
Represents the object called "OLE Element". The OLEObject object is an element of the following listings: Objects: Contains all objects of a picture. Selection: Contains all selected objects of a picture.
1914
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Usage
Use the AddOLEObject method to create a new "OLE Element" object in a picture: In the following example an OLE Element 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
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 Element "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
1915
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
How to Create Picture-Specific Menus and Toolbars (Page1602) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) Delete Method (Page1745) AddOLEObject Method (Page1722) How to Create a New Application-Specific Toolbar (Page1582) VBA Reference (Page1664) OLE Objects (Page1615) Application Property (Page2008)
Represents the "Radio Box" object. The OptionGroup 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.
Usage
Use the Add method to create a new "Option Group" object in a picture:
Sub AddOptionGroup()
1916
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'VBA301 Dim objOptionGroup As HMIOptionGroup Set objOptionGroup = ActiveDocument.HMIObjects.AddHMIObject("Radio-Box", "HMIOptionGroup") End Sub
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("Radio-Box") objOptionGroup.BorderColor = RGB(255, 0, 0) End Sub
1917
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Left Property (Page2192) BorderStyle Property (Page2043) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) Text Property (Page2306) Process Property (Page2260) PasswordLevel Property (Page2244) Orientation Property (Page2239) OperationMessage Property (Page2238) Operation Property (Page2237) Name Property (Page2228) Layer Property (Page2160) Index Property (Page2145) Height Property (Page2139) ForeFlashColorOn Property (Page2133) ForeFlashColorOff Property (Page2132) ForeColor Property (Page2132) FontUnderline Property (Page2131) FontSize Property (Page2130) FontName Property (Page2129) FontItalic Property (Page2128) FontBold Property (Page2126) FlashRateForeColor Property (Page2123) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashForeColor Property (Page2114) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) 1918 FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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.
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
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
1919
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1920
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
MaximizeButton Property (Page2208) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Zoom Property (Page2414) WindowBorder Property (Page2409) Width Property (Page2408) Visible Property (Page2405) UpdateCycle Property (Page2327) Top Property (Page2311) TagPrefix Property (Page2304) Sizeable Property (Page2292) ServerPrefix Property (Page2288) ScrollPositionY Property (Page2282) ScrollPositionX Property (Page2282) ScrollBars Property (Page2281) PictureName Property (Page2252) OnTop Property (Page2236) OffsetTop Property (Page2235) OffsetLeft Property (Page2235) Name Property (Page2228) Moveable Property (Page2227) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) CloseButton Property (Page2065) CaptionText Property (Page2054) Caption Property (Page2053) AdaptSize Property (Page2001) AdaptPicture Property (Page2000)
1921
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Pie Segment" object. The PieSegment 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.
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
1922
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1923
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Filling Property (Page2106) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) StartAngle Property (Page2296) Radius Property (Page2268) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) FillColor Property (Page2104) EndAngle Property (Page2098) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BackFlashColorOn Property (Page2022) BackFlashColorOff Property (Page2021) BackColor Property (Page2017) 1924
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Polygon" object. The Polygon 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.
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
1925
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1926
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ToolTipText Property (Page2310) BorderBackColor Property (Page2035) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) RotationAngle Property (Page2274) ReferenceRotationTop Property (Page2271) ReferenceRotationLeft Property (Page2270) PointCount Property (Page2256) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Index Property (Page2145) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, BackFlashColorOff
BackFlashColorOn Property (Page2022) Property (Page2021) 1927 BackColor Property (Page2017) ActualPointTop Property (Page1998) ActualPointLeft Property (Page1997)
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Polyline" object. The PolyLine 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.
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
1928
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1929
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
HMIDefaultObjects Object (Listing) (Page1878) BorderEndStyle Property (Page2039) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) RotationAngle Property (Page2274) ReferenceRotationTop Property (Page2271) ReferenceRotationLeft Property (Page2270) PointCount Property (Page2256) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Index Property (Page2145) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashBorderColor Property (Page2112) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035) ActualPointTop Property (Page1998) ActualPointLeft Property (Page1997)
1930
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
A listing of the Property objects that represent all the properties of an object.
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("CircleAsHMIObject", "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
1931
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Item Method (Page1772) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
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: <Object>.<Property> = <Value> You can use the "Dynamic" property in order to make an object property dynamic with VBA. Use the "Events" listing in order to configure actions with VBA. The Property object is an element of the Properties listing.
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
1932
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 "Otto", which is updated every two seconds:
Sub DynamicToRadiusOfNewCircle() 'VBA318 Dim objVariableTrigger As HMIVariableTrigger Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects("Circle") Set objVariableTrigger = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVariableDirect, "NewDynamic1") objVariableTrigger.CycleType = hmiCycleType_2s End Sub
See also
DisplayName Property (Page2092) Properties Object (Listing) (Page1931) DeleteDynamic Method (Page1747) CreateDynamic Method (Page1742) VBA Reference (Page1664) Creating Dynamics with VBA (Page1631) Editing Objects with VBA (Page1606) Value Property (Page2331) Type Property (Page2315) Parent Property (Page2241) Name Property (Page2228) IsDynamicable Property (Page2150) Events Property (Page2099) Dynamic Property (Page2095) Application Property (Page2008)
1933
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the quality code of a tag which is assigned in the dynamic dialog and used for dynamization.
Object properties
The object QualityCodeStateValue has the following properties:
1934
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_BAD_CONFERROR Property (Page2338) VBA Reference (Page1664) VarName Property (Page2403) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) Parent Property (Page2241) Application Property (Page2008)
1935
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
A listing of QualityCodeStateValue objects which contain all quality codes in Dynamic dialog and are used for dynamization.
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 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() 'VBA813 Dim objDynDialog As HMIDynamicDialog Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle_A", "HMICircle") Set objDynDialog = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDynamicDialog, "'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: .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
1936
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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:
1937
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_MAINTDEM Property (Page2387) VBA Reference (Page1664) VarName Property (Page2403) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) Parent Property (Page2241) Item Property (Page2152) Count Property (Page2082) Application Property (Page2008)
1938
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.7.4
R-Z
Represents the "Rectangle" object. The Rectangle 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.
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 Set objRectangle = ActiveDocument.HMIObjects("Rectangle1") objRectangle.BorderColor = RGB(255, 0, 0)
1939
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
1940
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Name Property (Page2228) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) PasswordLevel Property (Page2244) Operation Property (Page2237) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BackFlashColorOn Property (Page2022) BackFlashColorOff Property (Page2021) BackColor Property (Page2017)
1941
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Round Button" object. The RoundButton 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.
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) End Sub
1942
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1943
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ToolTipText Property (Page2310) FlashBackColor Property (Page2111) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) Toggle Property (Page2307) Radius Property (Page2268) Pressed Property (Page2260) PicUpUseTransColor Property (Page2255) PicUpTransparent Property (Page2254) PicUpReferenced Property (Page2254) PictureUp Property (Page2253) PictureDown Property (Page2251) PictureDeactivated Property (Page2251) PicDownUseTransColor Property (Page2249) PicDownTransparent Property (Page2248) PicDownReferenced Property (Page2247) PicDeactUseTransColor Property (Page2247) PicDeactTransparent Property (Page2246) PicDeactReferenced-Eigenschaft (Page2245) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FillStyle Property (Page2108) 1944 FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104) BorderWidth Property (Page2045)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Rounded Rectangle" object. The RoundRectangle 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.
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
1945
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1946
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Width Property (Page2408) BorderBackColor Property (Page2035) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) RoundCornerWidth Property (Page2275) RoundCornerHeight Property (Page2275) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BackFlashColorOn Property (Page2022) BackFlashColorOff Property (Page2021) BackColor Property (Page2017)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1947
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents a script (C, VB) that is configured for adding dynamics to a property or action to an event.
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(hmiDynamicCreationTypeCScript) ' 'Define triggertype and cycletime: With objCScript .SourceCode = "" .Trigger.Type = hmiTriggerTypeStandardCycle .Trigger.CycleType = hmiCycleType_2s .Trigger.Name = "Trigger1" End With End Sub
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"
1948
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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
See also
Prototype Property (Page2264) Delete Method (Page1745) VBA Reference (Page1664) Creating Dynamics with VBA (Page1631) Trigger Property (Page2314) SourceCode Property (Page2295) ScriptType Property (Page2280) Parent Property (Page2241) Compiled Property (Page2080) Application Property (Page2008)
A listing of the HMIObject objects that represent all the selected objects in a picture.
1949
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 <> 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
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
1950
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
HMIObjects Object (Listing) (Page1884) AlignTop Method (Page1727) HMIDefaultObjects Object (Listing) (Page1878) BringToFront Method (Page1730) SendToBack Method (Page1795) SelectAll Method (Page1794) SameWidthAndHeight Method (Page1790) SameWidth Method (Page1788) SameHeight Method (Page1787) Rotate Method (Page1786) Remove Method (Page1784) ForwardOneLevel Method (Page1759) BackwardOneLevel Method (Page1729) MoveSelection Method (Page1779) Item Method (Page1772) FlipVertically Method (Page1758) FlipHorizontally Method (Page1757) EvenlySpaceVertically Method (Page1752) EvenlySpaceHorizontally Method (Page1751) DuplicateSelection Method (Page1750) DeselectAll Method (Page1748) DeleteAll Method (Page1746) CreateGroup Method (Page1743) CreateCustomizedObject Method (Page1741) CopySelection Method (Page1738) CenterVertically Method (Page1733) CenterHorizontally Method (Page1732) AlignRight Method (Page1726) AlignLeft Method (Page1725) AlignBottom Method (Page1724) How to Edit a Customized Object with VBA (Page1628) How to Edit Group Objects with VBA (Page1620) How to edit Default objects, Smart objects, Windows objects and Tube objects (Page1610) VBA Reference (Page1664) Customized Objects (Page1626)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, Default objects, Smart
Group Objects (Page1618) objects, Windows objects and Tube objects (Page1609) 1951 Editing Objects with VBA (Page1606) Parent Property (Page2241) Count Property (Page2082)
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the object called "Slider Object". The Slider 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.
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
1952
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1953
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
OperationReport Property (Page2238) BorderFlashColorOff Property (Page2040) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) SmallChange Property (Page2292) Process Property (Page2260) PasswordLevel Property (Page2244) OperationMessage Property (Page2238) Operation Property (Page2237) Name Property (Page2228) Min Property (Page2225) Max Property (Page2207) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104) ExtendedOperation Property (Page2103) Direction Property (Page2091) ColorTop Property (Page2075) ColorBottom Property (Page2068) ButtonColor Property (Page2052) 1954 BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderColor Property (Page2036)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 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
1955
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
' 'Initiation of directconnection by mouseclick: Set objDirConnection = objButton.Events(1).Actions.AddAction(hmiActionCreationTypeDirectConnection) With objDirConnection '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
See also
DirectConnection Object (Page1845) VBA Reference (Page1664) Type Property (Page2315) SourceLink Property (Page2293) ObjectName Property (Page2232) AutomationName Property (Page2011)
Represents the "Static Text" object. The StaticText 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.
1956
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1957
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Selection Object (Listing) (Page1949) FontBold Property (Page2126) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) ToolTipText Property (Page2310) Text Property (Page2306) PasswordLevel Property (Page2244) Orientation Property (Page2239) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Height Property (Page2139) ForeFlashColorOn Property (Page2133) ForeFlashColorOff Property (Page2132) ForeColor Property (Page2132) FontUnderline Property (Page2131) FontSize Property (Page2130) FontName Property (Page2129) FontItalic Property (Page2128) FlashRateForeColor Property (Page2123) FlashRateBorderColor Property (Page2120) FlashRateBackColor Property (Page2119) FlashForeColor Property (Page2114) FlashBorderColor Property (Page2112) FlashBackColor Property (Page2111) FillStyle Property (Page2108) FillingIndex Property (Page2107) Filling Property (Page2106) FillColor Property (Page2104) 1958 BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Status Display" object. The "StatusDisplay" 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.
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) End Sub
1959
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1960
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ToolTipText Property (Page2310) BasePicReferenced Property (Page2027) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Width Property (Page2408) Visible Property (Page2405) Top Property (Page2311) PasswordLevel Property (Page2244) Operation Property (Page2237) Name Property (Page2228) Left Property (Page2192) Layer Property (Page2160) Index Property (Page2145) Height Property (Page2139) FlashRateFlashPic Property (Page2122) FlashRateBorderColor Property (Page2120) FlashPicUseTransColor Property (Page2117) FlashPicture Property (Page2116) FlashPicTransColor Property (Page2116) FlashPicReferenced Property (Page2115) FlashFlashPicture Property (Page2114) FlashBorderColor Property (Page2112) BorderWidth Property (Page2045) BorderStyle Property (Page2043) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) BorderColor Property (Page2036) BorderBackColor Property (Page2035) BasePicUseTransColor Property (Page2029) BasePicture Property (Page2028) BasePicTransColor Property (Page2027)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1961
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Global Library" or "Project Library". The SymbolLibrary object is an element of the SymbolLibraries listing.
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
1962
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
SymbolLibraries Object (Listing) (Page1963) GetItemByPath Method (Page1760) FindByDisplayName Method (Page1756) VBA Reference (Page1664) Accessing the component library with VBA (Page1593) Parent Property (Page2241) Name Property (Page2228) FolderItems Property (Page2125) Application Property (Page2008)
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".
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
1963
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
For Each objSymbolLibrary In colSymbolLibraries strLibraryList = strLibraryList & objSymbolLibrary.Name & vbCrLf Next objSymbolLibrary MsgBox strLibraryList End Sub
See also
SymbolLibrary Object (Page1962) Item Method (Page1772) VBA Reference (Page1664) Accessing the component library with VBA (Page1593) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
Represents the "Text List" object. The TextList 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.
1964
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1965
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Width Property (Page2408) ForeFlashColorOn Property (Page2133) BitNumber Property (Page2032) Selection Object (Listing) (Page1949) HMIObjects Object (Listing) (Page1884) HMIDefaultObjects Object (Listing) (Page1878) AddHMIObject Method (Page1719) VBA Reference (Page1664) Editing Objects with VBA (Page1606) Visible Property (Page2405) UnselTextColor Property (Page2326) UnselBGColor Property (Page2325) Top Property (Page2311) ToolTipText Property (Page2310) SelTextColor Property (Page2287) SelBGColor Property (Page2284) PasswordLevel Property (Page2244) OutputValue Property (Page2241) Orientation Property (Page2239) OperationReport Property (Page2238) OperationMessage Property (Page2238) Operation Property (Page2237) NumberLines Property (Page2231) Name Property (Page2228) ListType Property (Page2198) Left Property (Page2192) Layer Property (Page2160) LanguageSwitch Property (Page2159) ItemBorderWidth Property (Page2155) ItemBorderStyle Property (Page2154) ItemBorderColor Property (Page2153) ItemBorderBackColor Property (Page2152) Height Property (Page2139) ForeFlashColorOff Property (Page2132) ForeColor Property (Page2132) FontUnderline Property (Page2131) 1966 FontSize Property (Page2130) FontName Property (Page2129) FontItalic Property (Page2128) FontBold Property (Page2126)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "User Defined Toolbar" object. The Toolbar object is an element of the CustomToolbars listing.
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
1967
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Key Property (Page2155) Toolbars Object (Listing) (Page1968) Delete Method (Page1745) How to Create Picture-Specific Menus and Toolbars (Page1602) How to Create a New Application-Specific Toolbar (Page1582) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573) Visible Property (Page2405) ToolbarItems Property (Page2309) Parent Property (Page2241) Application Property (Page2008)
A listing of the Toolbar objects that represent all the user-defined toolbars in the Graphics Designer.
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.
1968
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 picture-specific toolbars in the output.
Sub ShowCustomToolbarsOfDocument() 'VBA350 Dim colToolbars As HMIToolbars Dim objToolbar As HMIToolbar Dim strToolbarList As String Set colToolbars = ActiveDocument.CustomToolbars If 0 <> 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
1969
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Toolbar Object (Page1967) Item Method (Page1772) Add Method (Page1705) How to Create Picture-Specific Menus and Toolbars (Page1602) How to Create a New Application-Specific Toolbar (Page1582) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
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.
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.
1970
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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).ToolbarItemType MsgBox strType End Sub
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
1971
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Macro Property (Page2206) ToolbarItems Object (Listing) (Page1973) Delete Method (Page1745) Configuring Menus and Toolbars (Page1572) How to Assign VBA Macros to Menus and Toolbars (Page1589) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Add a New Icon to the Toolbar (Page1584) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573) Visible Property (Page2405) Type Property (Page2315) ToolTipText Property (Page2310) Tag Property (Page2303) StatusText Property (Page2297) ShortCut Property (Page2289) Position Property (Page2257) Parent Property (Page2241) LDTooltipTexts Property (Page2190) LDStatusTexts Property (Page2188) Key Property (Page2155) Icon Property (Page2144) Enabled Property (Page2098) Application Property (Page2008)
1972
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
A listing of the ToolbarItem objects that represent all the objects in a user-defined toolbar.
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 picturespecific 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 <> colToolbarItems.Count Then For Each objToolbarItem In colToolbarItems strTypeList = strTypeList & objToolbarItem.ToolbarItemType & vbCrLf Next objToolbarItem Else strTypeList = "No Toolbaritems existing" End If MsgBox strTypeList End Sub
1973
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ToolbarItem Object (Page1970) InsertToolbarItem Method (Page1769) InsertSeparator Method (Page1766) InsertFromMenuItem Method (Page1762) How to Add a New Icon to the Toolbar (Page1584) VBA Reference (Page1664) Creating Customized Menus and Toolbars (Page1573) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
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.
1974
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiDynamicCreationTypeVBScript) ' 'Define cycletime and sourcecode With objVBScript .SourceCode = "" .Trigger.Type = hmiTriggerTypeStandardCycle .Trigger.CycleType = hmiCycleType_2s .Trigger.Name = "Trigger1" End With End Sub
See also
Delete Method (Page1745) VBA Reference (Page1664) VariableTriggers Property (Page2402) Type Property (Page2315) Trigger Property (Page2314) Parent Property (Page2241) Name Property (Page2228) CycleType Property (Page2088) Application Property (Page2008)
1975
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Tube arc" object. The TubeArcObject object is an element of the following lists: HMIObjects: Contains all objects of a picture. Selection: Contains all selected objects of a picture. HMIDefaultObjects: Contains the default property values of all default, smart, window and tube objects.
Usage
Use the Add method to create a new "Tube arc" object in a picture:
Sub AddTubeArcObject() 'VBA835 Dim objTubeArcObject As HMITubeArcObject Set objTubeArcObject = ActiveDocument.HMIObjects.AddHMIObject("TubeArcObject", "HMITubeArcObject") End Sub
Use "HMIObjects"(Index)" to return an object from the HMIObjects listing, where Index in this case identifies the object by name:
1976
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub EditTubeArcObject() 'VBA836 Dim objTubeArcObject As HMITubeArcObject Set objTubeArcObject = ActiveDocument.HMIObjects("TubeArcObject") objTubeArcObject.BorderColor = RGB(255, 0, 0) End Sub
1977
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ObjectName Property (Page2232) Left Property (Page2192) Layer Property (Page2160) Top Property (Page2311) Width Property (Page2408) Height Property (Page2139) BorderColor Property (Page2036) BorderWidth Property (Page2045) ToolTipText Property (Page2310) Visible Property (Page2405) PasswordLevel Property (Page2244) Operation Property (Page2237) FlashRateBorderColor Property (Page2120) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) FlashBorderColor Property (Page2112) Transparency property (Page2313) GlobalShadow property (Page2135) GlobalColorScheme property (Page2134) StartAngle Property (Page2296) EndAngle Property (Page2098) RadiusHeight Property (Page2268) RadiusWidth Property (Page2269)
1978
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "Double T-piece" object. The TubeDoubleTeeObject 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 property values of all default, smart, window and tube objects.
Usage
Use the Add method to create a new "Double T-piece" object in a picture:
Sub AddTubeDoubleTeeObject() 'VBA838 Dim objTubeDoubleTeeObject As HMITubeDoubleTeeObject Set objTubeDoubleTeeObject = ActiveDocument.HMIObjects.AddHMIObject("Double T-piece", "HMITubeDoubleTeeObject") End Sub
Use "HMIObjects"(Index)" to return an object from the HMIObjects listing, where Index in this case identifies the object by name:
1979
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub EditTubeDoubleTeeObject() 'VBA839 Dim objTubeDoubleTeeObject As HMITubeDoubleTeeObject Set objTubeDoubleTeeObject = ActiveDocument.HMIObjects("Double T-piece") objTubeDoubleTeeObject.BorderColor = RGB(255, 0, 0) End Sub
See also
ObjectName Property (Page2232) Left Property (Page2192) Layer Property (Page2160) Top Property (Page2311) Width Property (Page2408) Height Property (Page2139) BorderColor Property (Page2036) BorderWidth Property (Page2045) ToolTipText Property (Page2310) Visible Property (Page2405) PasswordLevel Property (Page2244) Operation Property (Page2237) FlashRateBorderColor Property (Page2120) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) FlashBorderColor Property (Page2112) Transparency property (Page2313) GlobalShadow property (Page2135) GlobalColorScheme property (Page2134)
1980
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "TubePolyline" object. The TubePolyline 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 property values of all default, smart, window and tube objects.
Usage
Use the Add method to create a new "TubePolyline" object in a picture:
Sub AddTubePolyline() 'VBA841 Dim objTubePolyline As HMITubePolyline Set objTubePolyline = ActiveDocument.HMIObjects.AddHMIObject("TubePolyline", "HMITubePolyline") End Sub
Use "HMIObjects"(Index)" to return an object from the HMIObjects listing, where Index in this case identifies the object by name:
1981
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub EditTubePolyline() 'VBA842 Dim objTubePolyline As HMITubePolyline Set objTubePolyline = ActiveDocument.HMIObjects("TubePolyline") objTubePolyline.BorderColor = RGB(255, 0, 0) End Sub
1982
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ObjectName Property (Page2232) Left Property (Page2192) Layer Property (Page2160) Top Property (Page2311) Width Property (Page2408) Height Property (Page2139) BorderColor Property (Page2036) BorderWidth Property (Page2045) ToolTipText Property (Page2310) Visible Property (Page2405) PasswordLevel Property (Page2244) Operation Property (Page2237) FlashRateBorderColor Property (Page2120) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) FlashBorderColor Property (Page2112) Transparency property (Page2313) GlobalShadow property (Page2135) GlobalColorScheme property (Page2134) PointCount Property (Page2256) ActualPointLeft Property (Page1997) ActualPointTop Property (Page1998) Index Property (Page2145) LineJoinStyle property (Page2198)
1983
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the "T-piece" object. The TubeTeeObject object is an element of the following lists: HMIObjects: Contains all objects of a picture. Selection: Contains all selected objects of a picture. HMIDefaultObjects: Contains the default property values of all default, smart, window and tube objects.
Usage
Use the Add method to create a new "T-piece" object in a picture:
Sub AddTubeTeeObject() 'VBA844 Dim objTubeTeeObject As HMITubeTeeObject Set objTubeTeeObject = ActiveDocument.HMIObjects.AddHMIObject("T-piece", "HMITubeTeeObject") End Sub
Use "HMIObjects"(Index)" to return an object from the HMIObjects listing, where Index in this case identifies the object by name:
1984
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub EditTubeTeeObject() 'VBA845 Dim objTubeTeeObject As HMITubeTeeObject Set objTubeTeeObject = ActiveDocument.HMIObjects("T-piece") objTubeTeeObject.BorderColor = RGB(255, 0, 0) End Sub
See also
ObjectName Property (Page2232) Left Property (Page2192) Layer Property (Page2160) Top Property (Page2311) Width Property (Page2408) Height Property (Page2139) BorderColor Property (Page2036) BorderWidth Property (Page2045) ToolTipText Property (Page2310) Visible Property (Page2405) PasswordLevel Property (Page2244) Operation Property (Page2237) FlashRateBorderColor Property (Page2120) BorderFlashColorOn Property (Page2042) BorderFlashColorOff Property (Page2040) FlashBorderColor Property (Page2112) Transparency property (Page2313) GlobalShadow property (Page2135) GlobalColorScheme property (Page2134) RotationAngle Property (Page2274)
1985
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Represents the state of a tag, the value of which is assigned in the Dynamic dialog and used
See also
VALUE_SERVERDOWN Property (Page2373) VBA Reference (Page1664) VarName Property (Page2403) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) Parent Property (Page2241) Application Property (Page2008)
1986
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
A listing of VariableStateValue objects containing all tag statuses in Dynamic dialog to be used for dynamization.
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 The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'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: .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
1987
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
See also
VALUE_MAX_RANGE Property (Page2367) VBA Reference (Page1664) VarName Property (Page2403) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) Parent Property (Page2241) Item Property (Page2152) Application Property (Page2008)
1988
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 Otto:
Sub AddDynamicAsVariableDirectToProperty() 'VBA359 Dim objVariableTrigger As HMIVariableTrigger Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle1", "HMICircle") Set objVariableTrigger = objCircle.Top.CreateDynamic(hmiDynamicCreationTypeVariableDirect, "'NewDynamic1'") ' 'Define cycletime With objVariableTrigger .CycleType = hmiCycleType_2s End With End Sub
1989
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Delete Method (Page1745) VariableTriggers Object (Listing) (Page1990) VBA Reference (Page1664) VariableTriggers Property (Page2402) Type Property (Page2315) Parent Property (Page2241) Name Property (Page2228) CycleType Property (Page2088) Application Property (Page2008)
A listing of the VariableTrigger objects that represent all the tag triggers in use.
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_VariableTrigger", "HMICircle")
1990
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Set objVBScript = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBScript) 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
See also
Add Method (TagTriggers Listing) (Page1712) VBA Reference (Page1664) Parent Property (Page2241) Item Property (Page2152) Count Property (Page2082) Application Property (Page2008)
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.
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
1991
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
1992
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Height Property (Page2139) Views Object (Listing) (Page1993) SetCSLayerVisible Method (Page1797) PrintDocument Method (Page1782) IsCSLayerVisible Method (Page1770) Delete Method (Page1745) Add Method (Views Listing) (Page1713) Activate Method (Page1704) VBA Reference (Page1664) Editing a Copy of a Picture with VBA (Page1605) Editing Layers with VBA (Page1603) ExtendedZoomingEnable Property (Page2103) Zoom Property (Page2414) WindowState Property (Page2412) Width Property (Page2408) Top Property (Page2311) ScrollPosY Property (Page2284) ScrollPosX Property (Page2283) Parent Property (Page2241) Left Property (Page2192) IsActive Property (Page2148) Application Property (Page2008) ActiveLayer Property (Page1996)
1993
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Item Method (Page1772) View Object (Page1991) Add Method (Page1705) VBA Reference (Page1664) Parent Property (Page2241) Count Property (Page2082) Application Property (Page2008)
1994
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.8
4.4.8.1
Properties
A
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: Set objVBScript = objButton.Events(1).Actions.AddAction(hmiActionCreationTypeVBScript) With objVBScript .SourceCode = "Dim myCircle" & vbCrLf & _ "Set myCircle = HMIRuntime.ActiveScreen.ScreenItems(""Circle_VB"")" & _ vbCrLf & "myCircle.Radius = myCircle.Radius + 5" End With End Sub
See also
Actions Object (Listing) (Page1810) AddAction Method (Page1713) Configuring Event-Driven Actions with VBA (Page1644)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
1995
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Documents Object (Listing) (Page1850)
1996
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
View Object (Page1991)
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
1997
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PointCount Property (Page2256) Index Property (Page2145) ActualPointTop Property (Page1998) PolyLine Object (Page1928) Polygon Object (Page1925) Line Object (Page1897)
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
1998
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
See also
PointCount Property (Page2256) Index Property (Page2145) ActualPointLeft Property (Page1997) PolyLine Object (Page1928) Polygon Object (Page1925) Line Object (Page1897)
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
1999
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
OptionGroup Object (Page1916) TextList Object (Page1964) StaticText Object (Page1956) IOField Object (Page1886) CheckBox Object (Page1827) Button Object (Page1824)
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
2000
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PictureWindow Object (Page1919)
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
See also
PictureWindow Object (Page1919)
2001
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TypeAlarmHigh Property (Page2316) ColorAlarmHigh Property (Page2066) CheckAlarmHigh Property (Page2055) BarGraph Object (Page1819)
2002
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
The "CheckAlarmLow" property defines whether the monitoring function for the limit value is activated.
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
See also
TypeAlarmLow Property (Page2317) ColorAlarmLow Property (Page2067) CheckAlarmLow Property (Page2056) BarGraph Object (Page1819)
2003
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
Scaling Property (Page2278) Direction Property (Page2091) BarGraph Object (Page1819)
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
2004
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
2005
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
AlignmentLeft Property (Page2004) TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) GroupDisplay Object (Page1874) IOField Object (Page1886) CheckBox Object (Page1827) Button Object (Page1824)
Example:
An example showing how to use the AnalogResultInfos property can be found in this documentation under the heading "AnalogResultInfos Object (Listing)".
See also
DynamicDialog Object (Page1851) AnalogResultInfos Object (Listing) (Page1813)
2006
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
AngleBeta Property (Page2007) 3DBarGraph Object (Page1805)
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
2007
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
AngleAlpha Property (Page2006) 3DBarGraph Object (Page1805)
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
See also
Application Object (Page1814)
2008
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "ShowApplicationDataPath()" procedure outputs the path of the current picture: Sub ShowApplicationDataPath() 'VBA383 MsgBox Application.ApplicationDataPath End Sub
See also
Application Property (Page2008) Application Object (Page1814)
Example:
--
See also
ListType Property (Page2198) TextList Object (Page1964)
2009
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TextList Object (Page1964) IOField Object (Page1886)
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
2010
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
See also
OutputFormat Property (Page2240) DataFormat Property (Page2089) IOField Object (Page1886)
2011
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiActionCreationTypeDirectConnection) With objDynConnection '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
2012
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
DestinationLink Property (Page2090) Type Property (Page2315) SourceLink Property (Page2293) ObjectName Property (Page2232) SourceLink Object (Page1955) DestLink Object (Page1843)
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
2013
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
LanguageName Property (Page2158) LanguageID Property (Page2158) How to Assign Help Texts to Menus and Toolbars (Page1586) How to Create Menus in Multiple Languages (Page1580) Language-Dependent Configuration with VBA (Page1570)
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
BarGraph Object (Page1819)
2014
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
3DBarGraph Object (Page1805)
2015
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 = 2 End With End Sub
See also
BarGraph Object (Page1819)
4.4.8.2
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
2016
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Slider object (Page1952) RoundButton Object (Page1942) GroupDisplay Object (Page1874) Button Object (Page1824)
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
2017
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
EllipseSegment Object (Page1859) StaticText Object (Page1956) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) GroupDisplay Object (Page1874) GraphicObject Object (Page1870) IOField Object (Page1886) Ellipse Object (Page1853) Document Object (Page1847) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819) 3DBarGraph Object (Page1805)
2018
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
BarGraph Object (Page1819)
Example:
The "BarGraphConfiguration()" procedure configures 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
2019
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
BarGraph Object (Page1819)
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
See also
Slider object (Page1952)
2020
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Slider object (Page1952)
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)
2021
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
BarGraph Object (Page1819) StaticText Object (Page1956) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) Ellipse Object (Page1853) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824)
2022
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
RoundButton Object (Page1942) StaticText Object (Page1956) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) Rectangle Object (Page1939) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) Ellipse Object (Page1853) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
2023
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
3DBarGraph Object (Page1805)
Background picture
As the "Display type" attribute, defines the position and scaling for the background image of the process picture. normal Stretched (window) The background picture is centered in the original size. When opening the picture in runtime, it remains in the location. The background picture is scaled to the larger of the two windows runtime window and process picture. In runtime, it is scaled to the size of the runtime window and is scaled further when opening.
2024
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Tiled Stretched (picture) Graphics Designer and process picture are exhibited with the picture in its original size. The background picture is scaled to the configured size of the process picture. When opening the picture in runtime, it retains its size.
Path specifications
The following path specification formats are possible: Absolute: z.B. "C:\Siemens\WinCC\Icons\myIcon.ICO. Relative: The starting folder for relative path specification is the "GraCS" folder of the current project. <global>: Refers to the installation path for WinCC. The path specification "<global>\Icons \myIcon" is the same as the path specification under "Absolute". <project>: Refers to the current project directory.
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
2025
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
3DBarGraph Object (Page1805)
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
See also
3DBarGraph Object (Page1805)
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
2026
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
See also
3DBarGraph Object (Page1805)
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
See also
StatusDisplay Object (Page1959)
2027
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
BasePicUseTransColor Property (Page2029) StatusDisplay Object (Page1959)
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
2028
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
BasePicReferenced Property (Page2027) StatusDisplay Object (Page1959)
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
See also
BasePicTransColor Property (Page2027) StatusDisplay Object (Page1959)
2029
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
3DBarGraph Object (Page1805)
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
2030
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
3DBarGraph Object (Page1805)
Example:
An example showing how to use the BinaryResultInfo property can be found in this documentation under the heading "BinaryResultInfo Object".
See also
BinaryResultInfo Object (Page1822)
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeBit .Trigger.VariableTriggers(1).CycleType = hmiVariableCycleType_5s .BitResultInfo.BitNumber = 1 .BitResultInfo.BitSetValue = 40 .BitResultInfo.BitNotSetValue = 80
2031
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
BitNumber Property (Page2032) BitResultInfo Object (Page1823)
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeBit .BitResultInfo.BitNumber = 1 .BitResultInfo.BitSetValue = 40 .BitResultInfo.BitNotSetValue = 80 End With End Sub
See also
BitResultInfo Object (Page1823) VBA Reference (Page1664)
2032
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
An example showing how to use the BitResultInfo property can be found in this documentation under the heading "BitResultInfo Object".
See also
BitResultInfo Object (Page1823)
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeBit .BitResultInfo.BitNumber = 1 .BitResultInfo.BitSetValue = 40 .BitResultInfo.BitNotSetValue = 80 End With End Sub
2033
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
BitNumber Property (Page2032) BitResultInfo Object (Page1823)
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
2034
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Underlined Property (Page2324) Size Property (Page2291) Parent Property (Page2241) LanguageID Property (Page2158) Italic Property (Page2151) FontFamily Property (Page2127) Application Property (Page2008) LanguageFont Object (Page1889)
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
2035
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PieSegment Object (Page1922) BorderStyle Property (Page2043) TextList Object (Page1964) StatusDisplay Object (Page1959) StaticText Object (Page1956) Slider object (Page1952) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) PolyLine Object (Page1928) OptionGroup Object (Page1916) Line Object (Page1897) IOField Object (Page1886) GraphicObject Object (Page1870) EllipseArc Object (Page1856) EllipseSegment Object (Page1859) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
2036
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GraphicObject Object (Page1870) TextList Object (Page1964) StatusDisplay Object (Page1959) StaticText Object (Page1956) Slider object (Page1952) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) PolyLine Object (Page1928) PieSegment Object (Page1922) OptionGroup Object (Page1916) Line Object (Page1897) IOField Object (Page1886) EllipseArc Object (Page1856) EllipseSegment Object (Page1859) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
2037
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
RoundButton Object (Page1942) Button Object (Page1824)
2038
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
RoundButton Object (Page1942) Button Object (Page1824)
To determine the line ends for the object, go to the "Line End Style" window and proceed as follows:
2039
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Left 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 Column: Configures the end of the line. 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.
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
See also
PolyLine Object (Page1928) Line Object (Page1897)
2040
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
RoundButton Object (Page1942) StatusDisplay Object (Page1959) StaticText Object (Page1956) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) Rectangle Object (Page1939) PolyLine Object (Page1928) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) Line Object (Page1897) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824)
2041
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
2042
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
StaticText Object (Page1956) StatusDisplay Object (Page1959) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) PolyLine Object (Page1928) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) Line Object (Page1897) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824)
2043
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
IOField Object (Page1886) StatusDisplay Object (Page1959) StaticText Object (Page1956) Slider object (Page1952) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Polygon Object (Page1925) PolyLine Object (Page1928) TextList Object (Page1964) PieSegment Object (Page1922) OptionGroup Object (Page1916) Line Object (Page1897) GraphicObject Object (Page1870) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819) 3DBarGraph Object (Page1805)
2044
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
2045
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
IOField Object (Page1886) StatusDisplay Object (Page1959) StaticText Object (Page1956) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) PolyLine Object (Page1928) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) Line Object (Page1897) GraphicObject Object (Page1870) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824)
Example:
An example showing how to use the BottomConnectedObjectName property can be found in this documentation under the heading "ObjConnection Object".
See also
objConnection Object (Page1912)
2046
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
An example showing how to use the BottomConnectedObjectName property can be found in this documentation under the heading "ObjConnection Object".
See also
objConnection Object (Page1912)
Example:
The "CreateOptionGroup()" procedure creates the OptionGroup object with four option buttons. Each option button is assigned the default name "myCustomText<Nummer>":
Sub CreateOptionGroup() 'VBA424 Dim objRadioBox As HMIOptionGroup Dim iCounter As Integer Set objRadioBox = ActiveDocument.HMIObjects.AddHMIObject("RadioBox_1", "HMIOptionGroup")
2047
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
BoxCount Property (Page2048) OptionGroup Object (Page1916) CheckBox Object (Page1827)
Example:
The "CreateOptionGroup()" procedure creates the OptionGroup object with four option buttons. Each option button is assigned the default name "myCustomText<Nummer>":
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
2048
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
BoxAlignment Property (Page2047) OptionGroup Object (Page1916) CheckBox Object (Page1827)
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
See also
IOField Object (Page1886)
2049
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
SameSize Property (Page2276) Button4Width Property (Page2051) Button3Width Property (Page2051) Button2Width Property (Page2050) GroupDisplay Object (Page1874)
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
2050
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
SameSize Property (Page2276) Button4Width Property (Page2051) Button3Width Property (Page2051) Button1Width Property (Page2049) GroupDisplay Object (Page1874)
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
See also
SameSize Property (Page2276) Button4Width Property (Page2051) Button2Width Property (Page2050) Button1Width Property (Page2049) GroupDisplay Object (Page1874)
2051
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
When the SameSize property is set to TRUE, all the buttons are specified 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
See also
Button1Width Property (Page2049) SameSize Property (Page2276) Button3Width Property (Page2051) Button2Width Property (Page2050) GroupDisplay Object (Page1874)
2052
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Slider object (Page1952)
4.4.8.3
Example:
The "ApplicationWindowConfig" procedure accesses the properties of the application window. In this example the application window will
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
2053
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.Sizeable = True .Top = 20 .Visible = True .Width = 250 .WindowBorder = True End With End Sub
See also
PictureWindow Object (Page1919) ApplicationWindow Object (Page1817)
Example:
The "PictureWindowConfig" procedure accesses the properties of the picture window. In this example the picture window will
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
2054
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PictureWindow Object (Page1919)
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
See also
TypeAlarmHigh Property (Page2316) ColorAlarmHigh Property (Page2066) AlarmHigh Property (Page2002) BarGraph Object (Page1819)
2055
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ColorAlarmLow Property (Page2067) TypeAlarmLow Property (Page2317) AlarmLow Property (Page2002) BarGraph Object (Page1819)
2056
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 marked with a tick:
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
See also
MenuItems Property (Page2222) Configuring Menus and Toolbars (Page1572)
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")
2057
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TypeLimitHigh4 Property (Page2318) LimitHigh4 Property (Page2193) ColorLimitHigh4 Property (Page2069) BarGraph Object (Page1819)
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
2058
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ColorLimitHigh5 Property (Page2070) TypeLimitHigh5 Property (Page2318) LimitHigh4 Property (Page2193) BarGraph Object (Page1819)
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
2059
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
TypeLimitLow4 Property (Page2319) LimitLow4 Property (Page2195) ColorLimitLow4 Property (Page2071) BarGraph Object (Page1819)
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
See also
TypeLimitLow5 Property (Page2320) LimitLow5 Property (Page2196) ColorLimitLow5 Property (Page2072) BarGraph Object (Page1819)
2060
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TypeToleranceHigh Property (Page2321) ToleranceHigh Property (Page2308) ColorToleranceHigh Property (Page2073) BarGraph Object (Page1819)
2061
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
BarGraph Object (Page1819) TypeToleranceLow Property (Page2322) ToleranceLow Property (Page2308) ColorToleranceLow Property (Page2074)
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
2062
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
WarningHigh Property (Page2406) TypeWarningHigh Property (Page2322) ColorWarningHigh Property (Page2076) BarGraph Object (Page1819)
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)
2063
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
WarningLow Property (Page2407) TypeWarningLow Property (Page2323) ColorWarningLow Property (Page2077) BarGraph Object (Page1819)
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
See also
IOField Object (Page1886)
2064
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
IOField Object (Page1886)
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
See also
PictureWindow Object (Page1919) ApplicationWindow Object (Page1817)
2065
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
--
See also
GroupDisplay Object (Page1874)
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
2066
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.CheckAlarmHigh = True 'Set barcolor to "red" .ColorAlarmHigh = RGB(255, 0, 0) 'Set upper limit to "50" .AlarmHigh = 50 End With End Sub
See also
CheckAlarmHigh Property (Page2055) BarGraph Object (Page1819)
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"
2067
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
CheckAlarmLow Property (Page2056) BarGraph Object (Page1819)
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
See also
Slider object (Page1952)
2068
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphLimitConfiguration()" procedure configures 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
See also
BarGraph Object (Page1819)
2069
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
CheckLimitHigh4 Property (Page2057) BarGraph Object (Page1819)
2070
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
CheckLimitHigh5 Property (Page2058) BarGraph Object (Page1819)
2071
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
CheckLimitLow4 Property (Page2059) BarGraph Object (Page1819)
2072
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
CheckLimitLow5 Property (Page2060) BarGraph Object (Page1819)
2073
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
CheckToleranceHigh Property (Page2061) BarGraph Object (Page1819)
2074
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
CheckToleranceLow Property (Page2061) BarGraph Object (Page1819)
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
2075
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Dim objSlider As HMISlider Set objSlider = ActiveDocument.HMIObjects.AddHMIObject("SliderObject1", "HMISlider") With objSlider .ColorTop = RGB(255, 128, 0) End With End Sub
See also
Slider object (Page1952)
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
2076
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
CheckWarningHigh Property (Page2062) BarGraph Object (Page1819)
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
See also
CheckWarningLow Property (Page2063) BarGraph Object (Page1819)
2077
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example
In the following example, a tag that is common to all picture objects is declared in the active picture. The common declaration section is then output :
Sub DefineTagInActiveDocument ActiveDocument.CommonVBSCode = "DIM actionIsdone" & vbCrLf MsgBox ActiveDocument.CommonVBSCode End Sub
See also
Document Object (Page1847)
2078
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example
In the following example, two tags are declared in the active picture. The "Event" declaration section is the output:
Sub DefineTagInActiveDocument ActiveDocument.CommonVBSCode = "DIM actionIsdone" & vbCrLf ActiveDocument.CommonVBSEventArea = ActiveDocument.CommonVBSEventArea & "DIM "eventHasOccurred" MsgBox ActiveDocument.CommonVBSEventArea End Sub
Example
In the following example, two tags are declared in the active picture. The "Property" declaration section is then output:
Sub DefineTagInActiveDocument ActiveDocument.CommonVBSCode = "DIM actionIsdone" & vbCrLf ActiveDocument CommonVBSPropertyArea = ActiveDocument.CommonVBSPropertyArea & "DIM propertyIsChanged" MsgBox ActiveDocument.CommonVBSPropertyArea End Sub
2079
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Application Object (Page1814)
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:
2080
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Set objEvent = objButton.Events(1) Set objVBScript = objButton.Events(1).Actions.AddAction(hmiActionCreationTypeVBScript) objVBScript.SourceCode = strCode Select Case objVBScript.Compiled Case True MsgBox "Compilation OK!" Case False MsgBox "Errors by compilation!" End Select End Sub
See also
SourceCode Property (Page2295) ScriptInfo Object (Page1948)
Example:
The "ShowConfigurationFileName() procedure outputs the configuration file path for the current picture: Sub ShowConfigurationFileName() 'VBA464 MsgBox ActiveDocument.Application.ConfigurationFileName End Sub
See also
Application Property (Page2008) Application Object (Page1814)
2081
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiOpenDocumentTypeVisible) 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
2082
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VariableTriggers Object (Listing) (Page1990) Views Object (Listing) (Page1993) VariableStateValues Object (Listing) (Page1987) ToolbarItems Object (Listing) (Page1973) Toolbars Object (Listing) (Page1968) SymbolLibraries Object (Listing) (Page1963) Selection Object (Listing) (Page1949) Properties Object (Listing) (Page1931) HMIObjects Object (Listing) (Page1884) MenuItems Object (Listing) (Page1909) Menus Object (Listing) (Page1904) Layers Object (Listing) (Page1895) LanguageTexts Object (Listing) (Page1893) LanguageFonts Object (Listing) (Page1890) GroupedObjects Object (Listing) (Page1877) FolderItems Object (Listing) (Page1868) Events Object (Listing) (Page1863) Documents Object (Listing) (Page1850) HMIDefaultObjects Object (Listing) (Page1878) DataLanguages Object (Listing) (Page1842) ConnectionPoints Object (Listing) (Page1837) AnalogResultInfos Object (Listing) (Page1813) Actions Object (Listing) (Page1810)
Example:
The "ShowDataLanguage()" procedure outputs the currently set project language:
Sub ShowDataLanguage()
2083
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Application Property (Page2008) DataLanguageChanged Event (Page1681) Language-Dependent Configuration with VBA (Page1570)
Example:
The "ShowDesktopLanguage()" procedure outputs the currently set user interface language:
Sub ShowDesktopLanguage() 'VBA467 MsgBox Application.CurrentDesktopLanguage End Sub
See also
Application Property (Page2008) Application Object (Page1814) DesktopLanguageChanged event (Page1682) Language-Dependent Configuration with VBA (Page1570)
2084
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "IOFieldConfiguration()" procedure accesses the properties of the I/O field. In this example the cursor will skip into the next field when another field is exited. For this to work, the Cursor mode 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
See also
TabOrderAlpha Property (Page2301) TabOrderSwitch Property (Page2299) CursorMode Property (Page2085) ActiveDocument Property (Page1996) TextList Object (Page1964) IOField Object (Page1886)
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
2085
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
CursorControl Property (Page2084) ActiveDocument Property (Page1996) Documents Object (Listing) (Page1850)
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
See also
Application Property (Page2008) ActiveDocument Property (Page1996) Menu Object (Page1903)
2086
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Application Property (Page2008) ActiveDocument Property (Page1996) Toolbar Object (Page1967)
Example:
--
See also
VariableTrigger Object (Page1989)
2087
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
--
See also
VariableTrigger Object (Page1989)
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("Circle1", "HMICircle") Set VariableTrigger = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVariableDirect, "NewDynamic1") VariableTrigger.CycleType = hmiVariableCycleType_2s End Sub
See also
VariableTrigger Object (Page1989) Configuring Dynamics in the Properties of Pictures and Objects (Page1632)
2088
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.8.4
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
See also
IOField Object (Page1886)
2089
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
HMIDefaultObjects Object (Listing) (Page1878)
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
2090
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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(hmiActionCreationTypeDirectConnection) 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
See also
AutomationName Property (Page2011) ObjectName Property (Page2232) Type Property (Page2315) DirectConnection Object (Page1845)
Slider
Defines or returns the position of the Slider object. BOOLEAN write-read access.
Position/Bar Axis Vertical/Negative Horizontal/Positive Assigned Value TRUE FALSE
2091
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Slider object (Page1952) 3DBarGraph Object (Page1805)
Example:
The "DisableVBAEvents()" procedure disables Event Handling:
Sub DisableVBAEvents() 'VBA479 Application.DisableVBAEvents = False End Sub
See also
Application Object (Page1814) Event Handling (Page1655)
2092
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Property Object (Page1932)
Example:
The "ButtonConfiguration()" procedure accesses the properties of the button. In this example the button is assigned "Graphic and text":
2093
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub ButtonConfiguration() 'VBA814 Dim objbutton As HMIButton Set objbutton = ActiveDocument.HMIObjects.AddHMIObject("Button1", "HMIButton") With objbutton .DisplayOptions = 1 End With End Sub
See also
Button Object (Page1824)
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
2094
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ToolTipText Property (Page2310) Label Property (Page2157) ToolbarItem Object (Page1970) LanguageText Object (Page1892) MenuItem Object (Page1906) Menu Object (Page1903)
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
See also
Application Property (Page2008) Application Object (Page1814)
2095
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 <> objProperty.DynamicStateType Then strOutput = strOutput & vbCrLf & objObject.ObjectName & " - " & objProperty.DisplayName & ": Statetype " & objProperty.Dynamic.DynamicStateType End If Next objProperty Next objObject MsgBox strOutput End Sub
See also
Property Object (Page1932)
4.4.8.5
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")
2096
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
TextList Object (Page1964) IOField Object (Page1886)
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog .AnalogResultInfos.Add 50, 40 .AnalogResultInfos.Add 100, 80 .AnalogResultInfos.ElseCase = 100 End With End Sub
See also
AnalogResultInfos Object (Listing) (Page1813) AnalogResultInfo Object (Page1812) Add Method (AnalogResultInfos Listing) (Page1706)
2097
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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("DeleteAllCircles") .Enabled = False End With End Sub
See also
ToolbarItem Object (Page1970) MenuItem Object (Page1906) Menu Object (Page1903) Configuring Menus and Toolbars (Page1572)
2098
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
StartAngle Property (Page2296) PieSegment Object (Page1922) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) CircularArc Object (Page1831)
2099
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Index 9 10 11 12 13 14 15 16 EventType (depending upon the object used) hmiEventTypePropertyChange hmiEventTypePropertyStateChange hmiEventTypePictureOpen hmiEventTypePictureClose hmiEventTypeObjectDefined hmiEventTypeFocusEnter hmiEventTypeLastTriggerType 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 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(hmiActionCreationTypeDirectConnection) With objDirConnection 'Sourceobject: Property "Top" of Rectangle_A .SourceLink.Type = hmiSourceTypeProperty .SourceLink.ObjectName = "Rectangle_A" .SourceLink.AutomationName = "Top" ' 'Targetobject: Property "Left" of Rectangle_B
2100
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.DestinationLink.Type = hmiDestTypeProperty .DestinationLink.ObjectName = "Rectangle_B" .DestinationLink.AutomationName = "Left" End With End Sub
See also
Events Object (Listing) (Page1863) Configuring Event-Driven Actions with VBA (Page1644)
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()
2101
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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) Set objCScript = objEvent.Actions.AddAction(hmiActionCreationTypeCScript) MsgBox "the type of the projected event is " & objEvent.EventType End Sub
See also
Events Object (Listing) (Page1863) Configuring Event-Driven Actions with VBA (Page1644)
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
BarGraph Object (Page1819)
2102
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Slider object (Page1952)
Example:
The procedure "DocConfiguration()" accesses picture properties. In this example, the property ExtendedZoomingEnable is set to TRUE:
2103
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Sub DocConfiguration() 'VBA815 Dim objDoc As Document Set objDoc = ActiveDocument With objDoc .ExtendedZoomingEnable = True End With End Sub
4.4.8.6
Usage
Use the Add method to create a new "faceplate instance" object in a picture. "Properties.Item(3)" is used to access the FaceplateType property:
Sub AddFaceplateInstance() 'VBA847 Dim objFaceplateInstance As HMIFaceplateObject Set objFaceplateInstance = ActiveDocument.HMIObjects.AddHMIObject("faceplate instance", "HMIFaceplateObject") objFaceplateInstance.Properties.Item(3).value = "Faceplate1.fpt" MsgBox "Faceplate """ & objFaceplateInstance.Properties.Item(3).value & """ is used." End Sub
2104
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Button Object (Page1824) StaticText Object (Page1956) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) GroupDisplay Object (Page1874) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) Ellipse Object (Page1853) Document Object (Page1847) Circle Object (Page1828) CheckBox Object (Page1827) BarGraph Object (Page1819) 3DBarGraph Object (Page1805)
2105
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
FillingIndex Property (Page2107) StaticText Object (Page1956) Slider object (Page1952) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) GraphicObject Object (Page1870) EllipseSegment Object (Page1859) Ellipse Object (Page1853) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824)
2106
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
PieSegment Object (Page1922) FillColor Property (Page2104) BackColor Property (Page2017) StaticText Object (Page1956) Slider object (Page1952) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Polygon Object (Page1925) OptionGroup Object (Page1916) GraphicObject Object (Page1870) EllipseSegment Object (Page1859) Ellipse Object (Page1853) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2107
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
2108
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Fill pattern Value 196609 196610 Fill pattern Value 196625 196626 Fill pattern Value 196641 196642
Example
The "RectangleConfiguration()" procedure accesses the properties of the rectangle. In this example the fill pattern will be set to the value "196642":
Sub RectangleConfiguration() 'VBA496 Dim objRectangle As HMIRectangle Set objRectangle = ActiveDocument.HMIObjects.AddHMIObject("Rectangle1", "HMIRectangle") With objRectangle .FillStyle = 196642 End With End Sub
See also
TextList Object (Page1964) StaticText Object (Page1956) Slider object (Page1952) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) IOField Object (Page1886) GraphicObject Object (Page1870) EllipseSegment Object (Page1859) Ellipse Object (Page1853) Document Object (Page1847) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
2109
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
2110
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Fill pattern Value 196609 196610 Fill pattern Value 196625 196626 Fill pattern Value 196641 196642
Example
The "BarGraphConfiguration()" procedure configures In this example the bar pattern will be set to "196642":
Sub BarGraphConfiguration() 'VBA497 Dim objBarGraph As HMIBarGraph Set objBarGraph = ActiveDocument.HMIObjects.AddHMIObject("Bar1", "HMIBarGraph") With objBarGraph .FillStyle2 = 196642 End With End Sub
See also
BarGraph Object (Page1819)
2111
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
RoundButton Object (Page1942) StaticText Object (Page1956) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) Rectangle Object (Page1939) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) Ellipse Object (Page1853) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
2112
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
StaticText Object (Page1956) StatusDisplay Object (Page1959) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) PolyLine Object (Page1928) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) Line Object (Page1897) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824)
2113
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
StatusDisplay Object (Page1959)
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
2114
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) CheckBox Object (Page1827) Button Object (Page1824)
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
See also
StatusDisplay Object (Page1959)
2115
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
FlashPicUseTransColor Property (Page2117) StatusDisplay Object (Page1959)
2116
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
FlashPicReferenced Property (Page2115) StatusDisplay Object (Page1959)
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)
2117
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
FlashPicTransColor Property (Page2116) StatusDisplay Object (Page1959)
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
See also
GroupDisplay Object (Page1874)
2118
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
2119
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
StaticText Object (Page1956) Slider object (Page1952) TextList Object (Page1964) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) Ellipse Object (Page1853) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
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.).
2120
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Slider object (Page1952) StatusDisplay Object (Page1959) StaticText Object (Page1956) TextList Object (Page1964) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) PolyLine Object (Page1928) Polygon Object (Page1925) PieSegment Object (Page1922) OptionGroup Object (Page1916) Line Object (Page1897) GraphicObject Object (Page1870) IOField Object (Page1886) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853) CircularArc Object (Page1831) Circle Object (Page1828) CheckBox Object (Page1827) Button Object (Page1824)
2121
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
StatusDisplay Object (Page1959)
2122
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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":
Sub ButtonConfiguration() 'VBA510 Dim objButton As HMIButton Set objButton = ActiveDocument.HMIObjects.AddHMIObject("Button1", "HMIButton") With objButton .FlashRateForeColor = 1 End With End Sub
See also
TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) CheckBox Object (Page1827) Button Object (Page1824)
2123
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 <> objFolderItem.Folder.Count Then 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
2124
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
SymbolLibraries Object (Listing) (Page1963) SymbolLibrary Object (Page1962) FolderItems Object (Listing) (Page1868) FolderItem Object (Page1867) Accessing the component library with VBA (Page1593)
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
2125
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
iSubFolderIndex = 1 For iSubFolderIndex = 1 To iMaxFolder strFolderItemName = objFolderItem.DisplayName If 0 <> objFolderItem.Folder.Count Then 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
See also
FolderItem Object (Page1867) SymbolLibraries Object (Listing) (Page1963) SymbolLibrary Object (Page1962) FolderItems Object (Listing) (Page1868) Accessing the component library with VBA (Page1593)
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")
2126
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) GroupDisplay Object (Page1874) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
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
2127
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.Size = 12 End With ' 'To do typesettings for english: With colLangFonts.ItemByLCID(1033) .Family = "Times New Roman" .Bold = False .Italic = True .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
See also
Underlined Property (Page2324) Size Property (Page2291) Parent Property (Page2241) Italic Property (Page2151) LanguageID Property (Page2158) Bold Property (Page2034) Application Property (Page2008) LanguageFont Object (Page1889)
2128
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
StaticText Object (Page1956) TextList Object (Page1964) OptionGroup Object (Page1916) IOField Object (Page1886) GroupDisplay Object (Page1874) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
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
2129
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
See also
CheckBox Object (Page1827) TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) GroupDisplay Object (Page1874) Button Object (Page1824) BarGraph Object (Page1819)
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
2130
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) GroupDisplay Object (Page1874) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
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
See also
TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) GroupDisplay Object (Page1874) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
2131
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Button Object (Page1824) TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) GroupDisplay Object (Page1874) CheckBox Object (Page1827) BarGraph Object (Page1819)
2132
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
CheckBox Object (Page1827) TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) GroupDisplay Object (Page1874) Button Object (Page1824) BarGraph Object (Page1819)
2133
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) GroupDisplay Object (Page1874) CheckBox Object (Page1827) Button Object (Page1824) BarGraph Object (Page1819)
4.4.8.7
G-H
Example
--
2134
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example
--
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
See also
GridWidth Property (Page2137) GridHeight Property (Page2136) GridColor Property (Page2136) ActiveDocument Property (Page1996) Application Property (Page2008) Document Object (Page1847) Application Object (Page1814)
2135
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Grid Property (Page2135) ActiveDocument Property (Page1996) Application Property (Page2008) Document Object (Page1847) Application Object (Page1814)
2136
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GridWidth Property (Page2137) Grid Property (Page2135) ActiveDocument Property (Page1996) Application Property (Page2008) Document Object (Page1847) Application Object (Page1814)
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
2137
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Grid Property (Page2135) GridHeight Property (Page2136) ActiveDocument Property (Page1996) Application Property (Page2008) Document Object (Page1847) Application Object (Page1814)
Example:
--
See also
Group Object (Page1873) ActiveDocument Property (Page1996) GroupedObjects Object (Listing) (Page1877) Document Object (Page1847) Application Object (Page1814)
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
2138
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Group Object (Page1873)
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
2139
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
View Object (Page1991) HMIObject Object (Page1882) Document Object (Page1847)
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 Me.Hide End Sub
See also
Open Method (Page1780) Add Method (Documents Listing) (Page1709) Document Object (Page1847)
2140
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
IOField Object (Page1886)
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
2141
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Document Object (Page1847)
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
See also
Button Object (Page1824)
2142
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphConfiguration()" procedure configures In this example the display shall take place with hysteresis:
Sub BarGraphConfiguration() 'VBA531 Dim objBarGraph As HMIBarGraph Set objBarGraph = ActiveDocument.HMIObjects.AddHMIObject("Bar1", "HMIBarGraph") With objBarGraph .Hysteresis = True End With End Sub
See also
BarGraph Object (Page1819)
Example:
The "BarGraphConfiguration()" procedure configures 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
2143
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
BarGraph Object (Page1819) Hysteresis Property (Page2143)
4.4.8.8
I-K
Path specifications
The following path specification formats are possible: Absolute: z.B. "C:\Siemens\WinCC\Icons\myIcon.ICO. Relative: The starting folder for relative path specification is the "GraCS" folder of the current project. <global>: Refers to the installation path for WinCC. The path specification "<global>\Icons \myIcon" is the same as the path specification under "Absolute". <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
2144
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ToolbarItems Object (Listing) (Page1973) ToolbarItem Object (Page1970) How to Add a New Icon to the Toolbar (Page1584) How to Create a New Application-Specific Toolbar (Page1582)
Example
Line Object
Defines the start and end point for a line, and so also defines the direction. Use the ActualPointLeft and ActualPointTop properties to define the coordinates for each starting and finishing point.
2145
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
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("PolyLine1", "HMIPolyLine")
2146
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
' '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
2147
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Line Object (Page1897) FlashPicture Property (Page2116) BasePicture Property (Page2028) ActualPointTop Property (Page1998) ActualPointLeft Property (Page1997) StatusDisplay Object (Page1959) PolyLine Object (Page1928) Polygon Object (Page1925) OptionGroup Object (Page1916)
Example
2148
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ActiveDocument Property (Page1996) View Object (Page1991)
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
2149
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Application Object (Page1814)
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
Further information on the "Events" topic can be found under the heading "Executing VBA macros in Graphics Designer".
See also
Property Object (Page1932) HMIObject Object (Page1882) HMIObjectPropertyChanged Event (Page1690) Executing VBA Macros in Graphics Designer (Page1566)
2150
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Underlined Property (Page2324) Size Property (Page2291) Parent Property (Page2241) LanguageID Property (Page2158) FontFamily Property (Page2127) Bold Property (Page2034) Application Property (Page2008) LanguageFont Object (Page1889)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2151
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
VariableTriggers Object (Listing) (Page1990) VariableStateValues Object (Listing) (Page1987) AnalogResultInfos Object (Listing) (Page1813)
2152
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. 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
See also
ItemBorderStyle Property (Page2154) TextList Object (Page1964)
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. 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
2153
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
See also
TextList Object (Page1964)
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. 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
See also
TextList Object (Page1964)
2154
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. In this example the dividing line width will be set to "4": 'Sub E_628_TextListConfiguration() Sub E_629_TextListConfiguration() 'VBA545 Dim objTextList As HMITextList Set objTextList = ActiveDocument.HMIObjects.AddHMIObject("myTextList", "HMITextList") With objTextList .ItemBorderWidth = 4 End With End Sub
See also
TextList Object (Page1964)
Example:
The "CreateMenuItem()" procedure creates the "Delete Objects" menu and adds two menu entries ("Delete Rectangles" and "Delete Circles"):
Sub CreateMenuItem() 'VBA546
2155
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 ' 'To analyse "strClicked" with "Select Case" Select Case strClicked Case "DeleteAllRectangles" ' 'Instead of "MsgBox" a procedurecall (e.g. "Call <Prozedurname>") can stay here MsgBox "'Delete rectangle' was clicked" Case "DeleteAllCircles" MsgBox "'Delete Circles' was clicked" End Select End Sub
See also
ToolbarItem Object (Page1970) MenuItem Object (Page1906) InsertToolbarItem Method (Page1769) InsertMenuItem Method (Page1765) ToolbarItemClicked Event (Page1701) MenuItemClicked Event (Page1695) Creating Customized Menus and Toolbars (Page1573)
2156
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.8.9 La
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
See also
CustomMenus Property (Page2086) MenuItems Object (Listing) (Page1909) MenuItem Object (Page1906) Menu Object (Page1903)
2157
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
DataLanguages Object (Listing) (Page1842) DataLanguage Object (Page1841)
Example:
The "DataLanguages()" procedure outputs the project languages together with their language identifiers:
Sub DataLanguages() 'VBA550 Dim colDataLang As HMIDataLanguages
2158
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
DataLanguages Object (Listing) (Page1842) DataLanguage Object (Page1841)
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. 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
See also
TextList Object (Page1964)
2159
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Document Object (Page1847)
2160
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
HMIObject Object (Page1882) Editing Layers with VBA (Page1603)
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
2161
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Layer00Value Property (Page2163) Layer00Color Property (Page2162) 3DBarGraph Object (Page1805)
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
See also
Layer00Checked Property (Page2161) 3DBarGraph Object (Page1805)
2162
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer00Checked Property (Page2161) 3DBarGraph Object (Page1805)
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 1 will be monitored:
Sub HMI3DBarGraphConfiguration() 'VBA557 Dim obj3DBar As HMI3DBarGraph Set obj3DBar = ActiveDocument.HMIObjects.AddHMIObject("3DBar1", "HMI3DBarGraph")
2163
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Layer01Value Property (Page2165) Layer01Color Property (Page2164) 3DBarGraph Object (Page1805)
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
2164
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Layer01Checked Property (Page2163) 3DBarGraph Object (Page1805)
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
See also
Layer01Checked Property (Page2163) 3DBarGraph Object (Page1805)
2165
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer02Value Property (Page2167) Layer02Color Property (Page2166) 3DBarGraph Object (Page1805)
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
2166
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Layer02Checked Property (Page2165) 3DBarGraph Object (Page1805)
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
See also
Layer02Checked Property (Page2165) 3DBarGraph Object (Page1805)
2167
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Limit value and representation are defined with the Layer03Value and Layer03Color properties.
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer03Value Property (Page2169) Layer03Color Property (Page2168) 3DBarGraph Object (Page1805)
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()
2168
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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
See also
Layer03Checked Property (Page2167) 3DBarGraph Object (Page1805)
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
See also
Layer03Checked Property (Page2167) 3DBarGraph Object (Page1805)
2169
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer04Value Property (Page2171) Layer04Color Property (Page2170) 3DBarGraph Object (Page1805)
2170
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer04Checked Property (Page2170) 3DBarGraph Object (Page1805)
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
See also
Layer00Checked Property (Page2161) 3DBarGraph Object (Page1805)
2171
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer05Value Property (Page2173) Layer05Color Property (Page2172) 3DBarGraph Object (Page1805)
2172
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer05Checked Property (Page2172) 3DBarGraph Object (Page1805)
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
See also
Layer05Checked Property (Page2172) 3DBarGraph Object (Page1805)
2173
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer06Value Property (Page2175) Layer06Color Property (Page2174) 3DBarGraph Object (Page1805)
2174
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer06Checked Property (Page2174) 3DBarGraph Object (Page1805)
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
See also
Layer06Checked Property (Page2174) 3DBarGraph Object (Page1805)
2175
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer07Value Property (Page2177) Layer07Color Property (Page2176) 3DBarGraph Object (Page1805)
2176
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer07Checked Property (Page2176) 3DBarGraph Object (Page1805)
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
See also
Layer07Checked Property (Page2176) 3DBarGraph Object (Page1805)
2177
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer08Value Property (Page2179) Layer08Color Property (Page2178) 3DBarGraph Object (Page1805)
2178
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer08Checked Property (Page2178) 3DBarGraph Object (Page1805)
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
See also
Layer08Checked Property (Page2178) 3DBarGraph Object (Page1805)
2179
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer09Value Property (Page2181) Layer09Color Property (Page2180) 3DBarGraph Object (Page1805)
2180
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer09Checked Property (Page2180) 3DBarGraph Object (Page1805)
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
See also
Layer09Checked Property (Page2180) 3DBarGraph Object (Page1805)
2181
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "HMI3DBarGraphConfiguration()" procedure accesses the properties of the 3DBarGraph object. In this example, limit 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
See also
Layer10Value Property (Page2183) Layer10Color Property (Page2182) 3DBarGraph Object (Page1805)
2182
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer10Checked Property (Page2182) 3DBarGraph Object (Page1805)
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
2183
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Layer10Checked Property (Page2182) 3DBarGraph Object (Page1805)
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
See also
Document Object (Page1847) Editing Layers with VBA (Page1603)
2184
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Note If the "Layers" property is used, the sequence of HMI objects in the HMIObjects listing can change.
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
See also
Name Property (Page2228) MinZoom Property (Page2226) MaxZoom Property (Page2208) Layers Object (Listing) (Page1895) Layer Object (Page1894)
2185
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
StaticText Object (Page1956) OptionGroup Object (Page1916) LanguageFonts Object (Listing) (Page1890) CheckBox Object (Page1827) Button Object (Page1824)
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
2186
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
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
See also
MenuItem Object (Page1906) Menu Object (Page1903)
Example:
Use the LDNames property to return the LanguageTexts listing. In the following example all multilingual layer names will be output:
2187
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer Object (Page1894) LanguageTexts Object (Listing) (Page1893) FolderItem Object (Page1867)
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
2188
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
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
See also
ToolbarItem Object (Page1970) MenuItem Object (Page1906) Menu Object (Page1903)
2189
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Button Object (Page1824) StaticText Object (Page1956) OptionGroup Object (Page1916) CheckBox Object (Page1827)
Example
The "CreateToolbar()" procedure creates a user-defined toolbar with two icons. Two multilingual Tooltip texts are assigned to the first icon:
Sub CreateToolbar()
2190
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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 *.ICO-Graphic '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 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).LDTooltipTexts For Each objLangText In colLangTexts iAnswer = MsgBox(objLangText.DisplayName, vbOKCancel) If vbCancel = iAnswer Then Exit For Next objLangText End Sub
See also
ToolbarItem Object (Page1970) HMIObject Object (Page1882)
2191
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
View Object (Page1991) HMIObject Object (Page1882)
Example:
The "BarGraphConfiguration()" procedure configures In this example the number of digits to the left of the decimal point will be set to "4".
Sub BarGraphConfiguration()
2192
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'VBA599 Dim objBarGraph As HMIBarGraph Set objBarGraph = ActiveDocument.HMIObjects.AddHMIObject("Bar1", "HMIBarGraph") With objBarGraph .LeftComma = 4 End With End Sub
See also
BarGraph Object (Page1819)
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
See also
3DBarGraph Object (Page1805)
2193
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TypeLimitHigh4 Property (Page2318) CheckLimitHigh4 Property (Page2057) BarGraph Object (Page1819)
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
2194
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TypeLimitHigh5 Property (Page2318) CheckLimitHigh5 Property (Page2058) BarGraph Object (Page1819)
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
2195
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
CheckLimitLow4 Property (Page2059) TypeLimitLow4 Property (Page2319) BarGraph Object (Page1819)
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
See also
BarGraph Object (Page1819) TypeLimitLow5 Property (Page2320) CheckLimitLow5 Property (Page2060)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2196
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
DataFormat Property (Page2089) IOField Object (Page1886)
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
2197
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Dim objIOField As HMIIOField Set objIOField = ActiveDocument.HMIObjects.AddHMIObject("IOField1", "HMIIOField") With objIOField .DataFormat = 1 .LimitMin = 0 End With End Sub
See also
DataFormat Property (Page2089) IOField Object (Page1886)
Example
2198
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. 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
See also
TextList Object (Page1964)
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
2199
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
See also
LockStatus Property (Page2201) GroupDisplay Object (Page1874)
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.ApplicationDataPath & strFile, hmiOpenDocumentTypeInvisible) docOld.Width = docOld.Width + 1 docOld.Save ' MsgBox "LockedByCreatorID = " & docOld.LOckedByCreatorID, vbOKOnly, "Result" ' docOld.Close Set docOld = Nothing ' End Sub
2200
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example 2
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.ApplicationDataPath & 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
See also
SaveAs Method (Page1792) Document Object (Page1847)
2201
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
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
See also
LockStatus Property (Page2201) GroupDisplay Object (Page1874)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2202
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
LockStatus Property (Page2201) GroupDisplay Object (Page1874)
2203
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
BarGraph Object (Page1819)
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
BarGraph Object (Page1819)
2204
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
AxisSection Property (Page2015) BarGraph Object (Page1819)
Example:
The "BarGraphConfiguration()" procedure configures 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
2205
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
BarGraph Object (Page1819)
4.4.8.10
Example:
In the following example, a user-defined menu with two menu entries is created, which retrieve two different VBA macros:
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
2206
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ToolbarItem Object (Page1970) MenuItem Object (Page1906) How to Assign VBA Macros to Menus and Toolbars (Page1589)
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
BarGraph Object (Page1819)
Example:
The "BarGraphConfiguration()" procedure configures In this example the absolute value will be set to "10".
Sub BarGraphConfiguration()
2207
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'VBA618 Dim objBarGraph As HMIBarGraph Set objBarGraph = ActiveDocument.HMIObjects.AddHMIObject("Bar1", "HMIBarGraph") With objBarGraph .Max = 10 End With End Sub
See also
Slider object (Page1952) BarGraph Object (Page1819) 3DBarGraph Object (Page1805)
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
See also
ApplicationWindow Object (Page1817)
2208
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Layer Object (Page1894) Editing Layers with VBA (Page1603)
MCGUBackColorOff-Eigenschaft 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 write-read access.
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
2209
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Set objGroupDisplay = ActiveDocument.HMIObjects.AddHMIObject("GroupDisplay1", "HMIGroupDisplay") With objGroupDisplay .MCGUBackColorOff = RGB(255, 0, 0) End With End Sub
See also
GroupDisplay Object (Page1874)
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
See also
GroupDisplay Object (Page1874)
2210
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
2211
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
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)
2212
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
GroupDisplay Object (Page1874)
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
See also
GroupDisplay Object (Page1874)
2213
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
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")
2214
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
With objGroupDisplay .MCKOBackColorOn = RGB(255, 255, 255) End With End Sub
See also
GroupDisplay Object (Page1874)
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
See also
GroupDisplay Object (Page1874)
2215
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
2216
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
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
See also
GroupDisplay Object (Page1874)
2217
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
2218
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
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
See also
GroupDisplay Object (Page1874)
2219
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
2220
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
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
2221
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
GroupDisplay Object (Page1874)
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
See also
MessageClass Property (Page2224) GroupDisplay Object (Page1874)
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
2222
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Menu Object (Page1903) MenuItem Object (Page1906)
Example:
The "ShowMenuTypes()" procedure outputs the types for the menu entries in the first userdefined menu:
Sub ShowMenuTypes() 'VBA641 Dim iMaxMenuItems As Integer Dim iMenuItemType As Integer
2223
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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).MenuItemType Select Case iMenuItemType Case 0 strMenuItemType = "Trennstrich (Separator)" Case 1 strMenuItemType = "Untermen (SubMenu)" Case 2 strMenuItemType = "Meneintrag (MenuItem)" End Select MsgBox iIndex & ". Menuitemtype: " & strMenuItemType Next iIndex End Sub
See also
MenuItem Object (Page1906) Menu Object (Page1903)
2224
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
GroupDisplay Object (Page1874)
Example:
The "BarGraphConfiguration()" procedure configures 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
2225
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Slider object (Page1952) BarGraph Object (Page1819) 3DBarGraph Object (Page1805)
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
See also
Layer Object (Page1894) Editing Layers with VBA (Page1603)
2226
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ScriptInfo Object (Page1948) Document Object (Page1847)
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")
2227
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PictureWindow Object (Page1919) ApplicationWindow Object (Page1817)
4.4.8.11
N-O
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
2228
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Trigger Object (Page1974) SymbolLibrary Object (Page1962) Property Object (Page1932) HMIObject Object (Page1882) Layer Object (Page1894) FolderItem Object (Page1867) Document Object (Page1847) Application Object (Page1814)
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).Name End Sub
See also
FolderItem Object (Page1867) Accessing the component library with VBA (Page1593)
2229
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeBool .BinaryResultInfo.NegativeValue = 20 .BinaryResultInfo.PositiveValue = 40 End With End Sub
See also
VBA Reference (Page1664) PositiveValue Property (Page2258) BinaryResultInfo Object (Page1822)
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)
2230
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
iIndex = iIndex + 1 If vbCancel = iAnswer Then Exit For Next objLayer End Sub
See also
Layer Object (Page1894)
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 ' 'Insert new TextList in current picture: Set objTextList = ActiveDocument.HMIObjects.AddHMIObject("myTextList", "HMITextList") With objTextList .NumberLines=3 End With
2231
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
See also
TextList Object (Page1964)
2232
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiActionCreationTypeDirectConnection) 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
2233
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Type Property (Page2315) SourceLink Property (Page2293) DestinationLink Property (Page2090) AutomationName Property (Page2011) SourceLink Object (Page1955) DestLink Object (Page1843)
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
See also
Document Object (Page1847) Editing Layers with VBA (Page1603)
2234
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
PictureWindow Object (Page1919)
2235
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
PictureWindow Object (Page1919)
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
2236
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ApplicationWindow Object (Page1817)
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
2237
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
HMIObject Object (Page1882) Document Object (Page1847)
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
See also
OperationReport Property (Page2238) TextList Object (Page1964) Slider object (Page1952) OptionGroup Object (Page1916) IOField Object (Page1886) CheckBox Object (Page1827)
2238
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
OperationMessage Property (Page2238) TextList Object (Page1964) Slider object (Page1952) OptionGroup Object (Page1916) IOField Object (Page1886) CheckBox Object (Page1827)
2239
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TextList Object (Page1964) StaticText Object (Page1956) OptionGroup Object (Page1916) IOField Object (Page1886) CheckBox Object (Page1827) Button Object (Page1824)
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 decimals 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"
2240
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
DataFormat Property (Page2089) IOField Object (Page1886)
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
See also
TextList Object (Page1964) IOField Object (Page1886)
4.4.8.12
P-Q
2241
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
2242
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Toolbars Object (Listing) (Page1968) Menu Object (Page1903) Document Object (Page1847) Views Object (Listing) (Page1993) View Object (Page1991) VariableTriggers Object (Listing) (Page1990) VariableTrigger Object (Page1989) VariableStateValues Object (Listing) (Page1987) VariableStateValue Object (Page1986) Trigger Object (Page1974) ToolbarItems Object (Listing) (Page1973) ToolbarItem Object (Page1970) Toolbar Object (Page1967) TextList Object (Page1964) SymbolLibraries Object (Listing) (Page1963) SymbolLibrary Object (Page1962) StatusDisplay Object (Page1959) StaticText Object (Page1956) SourceLink Object (Page1955) Slider object (Page1952) Selection Object (Listing) (Page1949) ScriptInfo Object (Page1948) RoundRectangle Object (Page1945) RoundButton Object (Page1942) Rectangle Object (Page1939) Properties Object (Listing) (Page1931) Property Object (Page1932) PolyLine Object (Page1928) Polygon Object (Page1925) PictureWindow Object (Page1919) PieSegment Object (Page1922) OptionGroup Object (Page1916) OLEObject Object (Page1914) MenuItems Object (Listing) (Page1909) MenuItem Object (Page1906)
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008, Line Object (Page1897)
Menus Object (Listing) (Page1904) 2243 Layers Object (Listing) (Page1895) Layer Object (Page1894) LanguageTexts Object (Listing) (Page1893)
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
You must first define the operator authorizations in the User Administrator.
Example:
--
See also
HMIObject Object (Page1882)
2244
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In this example the path to the folder of the active picture will be output:
Sub ShowDocumentPath() 'VBA663 MsgBox ActiveDocument.Path End Sub
See also
Document Object (Page1847)
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).PathName End Sub
See also
FolderItem Object (Page1867) Accessing the component library with VBA (Page1593)
PicDeactReferenced-Eigenschaft 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 write-read access.
2245
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
RoundButton Object (Page1942)
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 transparent when 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)
2246
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PicDeactUseTransColor Property (Page2247) RoundButton Object (Page1942)
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 transparent when 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
See also
PicDeactTransparent Property (Page2246) RoundButton Object (Page1942)
2247
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
RoundButton Object (Page1942)
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 transparent when in the "Deactivated" status.
Sub RoundButtonConfiguration() 'VBA669 Dim objRoundButton As HMIRoundButton Set objRoundButton = ActiveDocument.HMIObjects.AddHMIObject("RButton1", "HMIRoundButton") With objRoundButton .PicDownTransparent = RGB(255, 255, 0)
2248
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PicDownUseTransColor Property (Page2249) RoundButton Object (Page1942)
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 transparent when in the "Deactivated" 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
See also
PicDownTransparent Property (Page2248) RoundButton Object (Page1942)
2249
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "GraphicObjectConfiguration()" procedure accesses the properties of the graphics 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
See also
GraphicObject Object (Page1870)
Example:
The "GraphicObjectConfiguration()" procedure accesses the properties of the graphics object. In this example the color "Blue" assigned in the Bitmap object is to be displayed transparent:
Sub GraphicObjectConfiguration() 'VBA672 Dim objGraphicObject As HMIGraphicObject Set objGraphicObject = ActiveDocument.HMIObjects.AddHMIObject("GraphicObject1", "HMIGraphicObject") With objGraphicObject .PicTransColor = 16711680 .PicUseTransColor = True
2250
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
GraphicObject Object (Page1870)
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
See also
RoundButton Object (Page1942) PicReferenced Property (Page2249)
2251
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
The picture (*.BMP or *.DIB) must be located in the "GraCS" directory of the current project so that it can be integrated.
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
See also
RoundButton Object (Page1942)
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
2252
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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
See also
PictureWindow Object (Page1919)
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
2253
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
RoundButton Object (Page1942) Button Object (Page1824)
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
See also
RoundButton Object (Page1942)
2254
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 transparent in the status "Off".
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
See also
PicUpUseTransColor Property (Page2255) RoundButton Object (Page1942)
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 transparent in the status "Off":
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
2255
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PicUpTransparent Property (Page2254) RoundButton Object (Page1942)
Example:
The "GraphicObjectConfiguration()" procedure accesses the properties of the graphics object. In this example the color "Blue" assigned in the Bitmap object is to be displayed 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
See also
PicTransColor Property (Page2250) GraphicObject Object (Page1870)
2256
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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("PolyLine1", "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
List of links
See also
Index Property (Page2145) ActualPointTop Property (Page1998) ActualPointLeft Property (Page1997) PolyLine Object (Page1928) Polygon Object (Page1925)
2257
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ToolbarItem Object (Page1970) MenuItem Object (Page1906) Menu Object (Page1903) InsertSubmenu Method (Page1767)
Example:
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
2258
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Dim objDynDialog As HMIDynamicDialog Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle_C", "HMICircle") Set objDynDialog = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeBool .BinaryResultInfo.NegativeValue = 20 .BinaryResultInfo.PositiveValue = 40 End With End Sub
See also
NegativeValue Property (Page2229) BinaryResultInfo Object (Page1822) VBA Reference (Page1664)
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
2259
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
End Sub
See also
3DBarGraph Object (Page1805)
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
See also
RoundButton Object (Page1942)
2260
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Slider object (Page1952) OptionGroup Object (Page1916) CheckBox Object (Page1827) BarGraph Object (Page1819) 3DBarGraph Object (Page1805)
Example:
In this example the name of the "Graphics Designer" application will be output:
Sub ShowProfileName() 'VBA688 MsgBox Application.ProfileName End Sub
See also
Application Object (Page1814)
2261
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ActiveXControl Object (Page1811) AddActiveXControl Method (Page1714)
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
2262
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Application Object (Page1814)
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
2263
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Application Object (Page1814)
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"
See also
HMIObject Object (Page1882) Customized Objects (Page1626) Group Objects (Page1618) Editing Objects with VBA (Page1606)
2264
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiActionCreationTypeVBScript) MsgBox objVBScript.Prototype End Sub
See also
ScriptInfo Object (Page1948)
Example:
In the following example the radius of a circle is given dynamics with the 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() 'VBA816
2265
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Dim objDynDialog As HMIDynamicDialog Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle_A", "HMICircle") Set objDynDialog = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDynamicDialog, "'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 .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
See also
DynamicDialog Object (Page1851)
2266
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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() 'VBA817 Dim objDynDialog As HMIDynamicDialog Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle_A", "HMICircle") Set objDynDialog = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDynamicDialog, "'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 .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
See also
DynamicDialog Object (Page1851) QualityCodeStateValues Object (Listing) (Page1936)
2267
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.8.13
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
See also
RoundButton Object (Page1942) PieSegment Object (Page1922) CircularArc Object (Page1831) Circle Object (Page1828)
2268
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "EllipseConfiguration()" procedure accesses the properties of the ellipse object. In this example the horizontal 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
See also
RadiusWidth Property (Page2269) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853)
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
2269
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
RadiusHeight Property (Page2268) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) Ellipse Object (Page1853)
Example:
An example showing how to use the RangeTo property can be found in this documentation under the heading "AnalogResultInfos Object (Listing)".
See also
Value Property (Page2331) AnalogResultInfos Object (Listing) (Page1813) AnalogResultInfo Object (Page1812)
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 and 50% of the object height:
Sub PolyLineConfiguration() 'VBA696 Dim objPolyLine As HMIPolyLine Set objPolyLine = ActiveDocument.HMIObjects.AddHMIObject("PolyLine1", "HMIPolyLine") With objPolyLine
2270
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
RotationAngle Property (Page2274) ReferenceRotationTop Property (Page2271) PolyLine Object (Page1928) Polygon Object (Page1925) Line Object (Page1897)
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 and 50% of the object height:
Sub PolyLineConfiguration() 'VBA697 Dim objPolyLine As HMIPolyLine Set objPolyLine = ActiveDocument.HMIObjects.AddHMIObject("PolyLine1", "HMIPolyLine") With objPolyLine .ReferenceRotationLeft = 50 .ReferenceRotationTop = 50 End With End Sub
2271
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
RotationAngle Property (Page2274) ReferenceRotationLeft Property (Page2270) PolyLine Object (Page1928) Polygon Object (Page1925) Line Object (Page1897)
Example:
The "GroupDisplayConfiguration()" procedure accesses the properties of the Group Display. In this example the object for forming the group display will be considered:
Sub GroupDisplayConfiguration() 'VBA698 Dim objGroupDisplay As HMIGroupDisplay Set objGroupDisplay = ActiveDocument.HMIObjects.AddHMIObject("GroupDisplay1", "HMIGroupDisplay") With objGroupDisplay .Relevant = True End With End Sub
See also
Group Object (Page1873)
2272
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeBool .BinaryResultInfo.NegativeValue = 20 .BinaryResultInfo.PositiveValue = 40 End With End Sub
See also
DynamicDialog Object (Page1851)
Example:
The "BarGraphConfiguration()" procedure configures In this example the number of decimal places 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
See also
BarGraph Object (Page1819)
2273
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
T-piece
Defines or returns the orientation of a T-piece in degrees. The attribute can only assume one of four values: 0 90 180 270 The standard position of the T-piece is the shape of the letter "T" The "leg" of the "T" points towards the left The "leg" of the "T" points upwards The "leg" of the "T" points to the right
Other values are automatically converted to modulus 360 and rounded up or down to the nearest permissible value. The T-piece is shown rotated around the center point in the project and in Runtime.
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
2274
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ReferenceRotationTop Property (Page2271) ReferenceRotationLeft Property (Page2270) PolyLine Object (Page1928) Polygon Object (Page1925) Line Object (Page1897)
Example:
The "RoundRectangleConfiguration()" procedure accesses the properties of the object RoundRectangle. 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
See also
RoundCornerWidth Property (Page2275) RoundRectangle Object (Page1945)
2275
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "RoundRectangleConfiguration()" procedure accesses the properties of the object RoundRectangle. 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
See also
RoundCornerHeight Property (Page2275) RoundRectangle Object (Page1945)
4.4.8.14
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
2276
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
GroupDisplay Object (Page1874)
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
Scaling Property (Page2278) BarGraph Object (Page1819)
2277
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 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
See also
BarGraph Object (Page1819)
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
2278
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
BarGraph Object (Page1819)
Example
Example:
The "BarGraphConfiguration()" procedure configures In this example the bar scaling will be set to "Linear":
Sub BarGraphConfiguration() 'VBA708 Dim objBarGraph As HMIBarGraph
2279
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Set objBarGraph = ActiveDocument.HMIObjects.AddHMIObject("Bar1", "HMIBarGraph") With objBarGraph .ScalingType = 0 .Scaling = True End With End Sub
See also
Scaling Property (Page2278) BarGraph Object (Page1819)
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(hmiActionCreationTypeVBScript) Select Case objVBScript.ScriptType Case 0
2280
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
strScriptType = "VB script is used" Case 1 strScriptType = "C-Skript is used" End Select MsgBox strScriptType End Sub
See also
ScriptInfo Object (Page1948)
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
See also
PictureWindow Object (Page1919)
2281
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
PictureWindow Object (Page1919)
2282
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
PictureWindow Object (Page1919)
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
2283
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ScrollPosY Property (Page2284) View Object (Page1991)
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
See also
ScrollPosX Property (Page2283) View Object (Page1991)
2284
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 object TextList. 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 einfgen: Set objTextList = ActiveDocument.HMIObjects.AddHMIObject("myTextList", "HMITextList") With objTextList .SelBGColor = RGB (255, 0, 0) End With End Sub
See also
TextList Object (Page1964)
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
2285
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
HMIObject Object (Page1882)
Example:
In the following example all the objects in the active picture are selected:
Sub SelectAllObjectsInActiveDocument() 'VBA715 ActiveDocument.Selection.SelectAll End Sub
See also
Selection Object (Listing) (Page1949) Document Object (Page1847)
2286
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. 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
See also
TextList Object (Page1964)
2287
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ActiveXControl Object (Page1811)
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
2288
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.PictureName = "Test.PDL" .ScrollBars = True .ServerPrefix = "my_Server::" .TagPrefix = "Struct." .UpdateCycle = 5 .Zoom = 100 End With End Sub
See also
PictureWindow Object (Page1919)
Example:
In the following example, a user-defined menu with two menus entries and a submenu with two entries will be created in the active picture. The submenu will be visually distinguished by
2289
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
a dividing line. The first menu entry receives the shortcut key sequence <CTRL+SHIFT+M> for retrieval:
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") ' '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).ShortCut = "CTRL+SHIFT+M" End Sub
See also
Configuring Menus and Toolbars (Page1572) ToolbarItem Object (Page1970) MenuItem Object (Page1906)
Example:
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2290
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
GroupDisplay Object (Page1874)
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
2291
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Underlined Property (Page2324) Parent Property (Page2241) LanguageID Property (Page2158) Italic Property (Page2151) FontFamily Property (Page2127) Bold Property (Page2034) Application Property (Page2008) LanguageFont Object (Page1889)
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
See also
PictureWindow Object (Page1919) ApplicationWindow Object (Page1817)
2292
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Slider object (Page1952)
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
See also
Document Object (Page1847)
2293
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 ' 'Directconnection is initiated by mouseclick: Set objDirConnection = objButton.Events(1).Actions.AddAction(hmiActionCreationTypeDirectConnection) 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
2294
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Type Property (Page2315) ObjectName Property (Page2232) AutomationName Property (Page2011) SourceLink Object (Page1955) DirectConnection Object (Page1845)
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 .Top = 100 .Left = 100
2295
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiActionCreationTypeVBScript) objVBScript.SourceCode = strCode Select Case objVBScript.Compiled Case True MsgBox "Compilation ok!" Case False MsgBox "Error on compilation!" End Select End Sub
See also
Compiled Property (Page2080) ScriptInfo Object (Page1948)
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
2296
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
EndAngle Property (Page2098) PieSegment Object (Page1922) EllipseSegment Object (Page1859) EllipseArc Object (Page1856) CircularArc Object (Page1831)
Example:
In the following example, a user-defined menu with two menus 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") ' 'Assign statustexts to every menuitem With objDocMenu .MenuItems(1).StatusText = "My first menuitem" .MenuItems(2).StatusText = "My second menuitem"
2297
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.MenuItems(4).SubMenu.Item(1).StatusText = "My first submenuitem" .MenuItems(4).SubMenu.Item(2).StatusText = "My second submenuitem" End With End Sub
See also
ToolbarItem Object (Page1970) MenuItem Object (Page1906)
Example:
In the following example, a user-defined menu with two menus 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
2298
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
MenuItem Object (Page1906)
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
See also
Application Object (Page1814)
4.4.8.15
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()
2299
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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
See also
HMIObject Object (Page1882)
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
2300
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
TabOrderOtherAction Property (Page2303) TabOrderMouse Property (Page2302) TabOrderKeyboard Property (Page2301) Document Object (Page1847)
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
See also
Document Object (Page1847)
2301
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TabOrderOtherAction Property (Page2303) TabOrderMouse Property (Page2302) TabOrderAllHMIObjects Property (Page2300) Document Object (Page1847)
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
2302
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
TabOrderOtherAction Property (Page2303) TabOrderKeyboard Property (Page2301) TabOrderAllHMIObjects Property (Page2300) Document Object (Page1847)
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
See also
TabOrderMouse Property (Page2302) TabOrderKeyboard Property (Page2301) TabOrderAllHMIObjects Property (Page2300) Document Object (Page1847)
2303
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example, a user-defined menu with two menus 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") ' 'To place an additional information: With objDocMenu .MenuItems(1).Tag = "This is the first menuitem" End With End Sub
See also
ToolbarItem Object (Page1970) MenuItem Object (Page1906)
2304
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 EA1, EA2, EA3; one element each 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 period. Specify the tag prefix as, say, Struct2. (the period 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): EA1 Output value (second I/O field): EA2 Output value (third I/O field): EA3 The current tag connection in the picture window is then Output value (first I/O field): Struct2.EA1 Output value (second I/O field): Struct2.EA2 Output value (third I/O field): Struct2.EA3
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 .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
2305
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
PictureWindow Object (Page1919)
2306
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Button Object (Page1824) StaticText Object (Page1956) OptionGroup Object (Page1916) CheckBox Object (Page1827)
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
See also
RoundButton Object (Page1942)
2307
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphLimitConfiguration()" procedure configures the properties of the 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
See also
TypeToleranceHigh Property (Page2321) CheckToleranceHigh Property (Page2061) BarGraph Object (Page1819)
2308
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphLimitConfiguration()" procedure configures the properties of the 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
See also
TypeToleranceLow Property (Page2322) CheckToleranceLow Property (Page2061) BarGraph Object (Page1819)
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")
2309
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Set objToolbarItem = objToolbar.ToolbarItems.InsertToolbarItem(3, "tItem1_3", "My second symbol-icon") Set objToolbarItem = objToolbar.ToolbarItems.InsertSeparator(2, "tSeparator1_2") End Sub
See also
ToolbarItem Object (Page1970) Toolbar Object (Page1967)
Example:
The "RectangleConfiguration()" procedure accesses the properties of the Rectangle object. In this example a tool tip 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
Note If you want to make the "ToolTipText" property dynamic with the dynamic dialog, you must initialize before the dynamization. Example:
Sub Dyn() Dim objCircle As HMICircle Dim doc As Document Dim objDynDialog As HMIDynamicDialog Set doc = ActiveDocument Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle","HMICircle")
2310
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
objCircle.ObjectName = "Circle1" objCircle.BorderColor = RGB(255, 0, 0) objCircle.BackColor = RGB(0, 255, 0) objCircle.ToolTipText = "Text" Set objDynDialog = objCircle.ToolTipText.CreateDynamic(hmiDynamicCreationTypeDynamicDialog, "'Var'") End Sub
See also
ToolbarItem Object (Page1970) HMIObject Object (Page1882) How to Dynamize a Property with Dynamic Dialog (Page1636)
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
See also
View Object (Page1991) HMIObject Object (Page1882)
2311
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
An example showing how to use the BottomConnectedObjectName property can be found in this documentation under the heading "ObjConnection Object".
See also
objConnection Object (Page1912)
Example:
An example showing how to use the BottomConnectedObjectName property can be found in this documentation under the heading "ObjConnection Object".
See also
objConnection Object (Page1912)
2312
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example
Sub addTransparentObject() 'VBA849 Dim objHMICircle As HMICircle Set objHMICircle = ActiveDocument.HMIObjects.AddHMIObject("Circle", "HMICircle") objHMICircle.Transparency = 40 End Sub
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
BarGraph Object (Page1819)
2313
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
Trend Property (Page2313) BarGraph Object (Page1819)
2314
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiDynamicCreationTypeVBScript) With objVBScript .Trigger.Type = hmiTriggerTypeStandardCycle .Trigger.CycleType = hmiCycleType_2s .Trigger.Name = "Trigger1" End With End Sub
See also
Trigger Object (Page1974) ScriptInfo Object (Page1948)
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
2315
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
Trigger Object (Page1974) ToolbarItem Object (Page1970) SourceLink Object (Page1955) Property Object (Page1932) HMIObject Object (Page1882) FolderItem Object (Page1867) DestLink Object (Page1843)
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
2316
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
ColorAlarmHigh Property (Page2066) CheckAlarmHigh Property (Page2055) AlarmHigh Property (Page2002) BarGraph Object (Page1819)
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
See also
ColorAlarmLow Property (Page2067) CheckAlarmLow Property (Page2056) AlarmLow Property (Page2002) BarGraph Object (Page1819)
2317
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
LimitHigh4 Property (Page2193) CheckLimitHigh4 Property (Page2057) BarGraph Object (Page1819)
2318
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
LimitHigh5 Property (Page2194) CheckLimitHigh5 Property (Page2058) BarGraph Object (Page1819)
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
2319
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.TypeLimitLow4 = False 'Activate monitoring .CheckLimitLow4 = True 'Set barcolor = "green" .ColorLimitLow4 = RGB(0, 255, 0) 'Set lower limit = "5" .LimitLow4 = 5 End With End Sub
See also
LimitLow4 Property (Page2195) ColorLimitLow4 Property (Page2071) CheckLimitLow4 Property (Page2059) BarGraph Object (Page1819)
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
2320
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
LimitLow5 Property (Page2196) ColorLimitLow5 Property (Page2072) CheckLimitLow5 Property (Page2060) BarGraph Object (Page1819)
Example:
The "BarGraphLimitConfiguration()" procedure configures the properties of the 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
See also
ColorToleranceHigh Property (Page2073) CheckToleranceHigh Property (Page2061) BarGraph Object (Page1819)
2321
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphLimitConfiguration()" procedure configures the properties of the 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
See also
ToleranceLow Property (Page2308) ColorToleranceLow Property (Page2074) CheckToleranceLow Property (Page2061) BarGraph Object (Page1819)
2322
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
WarningHigh Property (Page2406) ColorWarningHigh Property (Page2076) CheckWarningHigh Property (Page2062) BarGraph Object (Page1819)
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
2323
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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
See also
WarningLow Property (Page2407) ColorWarningLow Property (Page2077) CheckWarningLow Property (Page2063) BarGraph Object (Page1819)
4.4.8.16
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
2324
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Size Property (Page2291) Parent Property (Page2241) LanguageID Property (Page2158) Italic Property (Page2151) FontFamily Property (Page2127) Bold Property (Page2034) Application Property (Page2008) LanguageFont Object (Page1889)
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. In this example the colors will be defined for entries that are not selected in the selection list:
Sub TextListConfiguration()
2325
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'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
See also
TextList Object (Page1964)
Example:
The "TextListConfiguration()" procedure accesses the properties of the object TextList. 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
See also
TextList Object (Page1964)
2326
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
PictureWindow Object (Page1919)
2327
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
UserValue4 Property (Page2330) UserValue3 Property (Page2329) UserValue2-Eigenschaft (Page2328) GroupDisplay Object (Page1874)
UserValue2-Eigenschaft Description
Defines or returns any value in the case of the GroupDisplay object. The value can be evaluated by a script, for example. This value is neither evaluated nor displayed in Runtime.
2328
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
UserValue4 Property (Page2330) UserValue3 Property (Page2329) UserValue1 Property (Page2328) GroupDisplay Object (Page1874)
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
2329
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
UserValue4 Property (Page2330) UserValue2-Eigenschaft (Page2328) UserValue1 Property (Page2328) GroupDisplay Object (Page1874)
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
See also
UserValue3 Property (Page2329) UserValue2-Eigenschaft (Page2328) UserValue1 Property (Page2328) GroupDisplay Object (Page1874)
2330
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
4.4.8.17 Value
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_Gauge2", "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
See also
Property Object (Page1932)
2331
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle is given dynamics with the The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2332
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_MAX_LIMIT Property (Page2365) VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VariableStateValue Object (Page1986)
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog
2333
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
2334
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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() 'VBA818 Dim objDynDialog As HMIDynamicDialog Dim objCircle As HMICircle Set objCircle = ActiveDocument.HMIObjects.AddHMIObject("Circle_A", "HMICircle") Set objDynDialog = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2335
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_BAD_DEVICE Property (Page2340) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) QualityCodeStateValue Object (Page1934)
2336
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2337
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2338
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2339
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_MISCSTATES Property (Page2389) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2340
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2341
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2342
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2343
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_ENGVONLIM Property (Page2381) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2344
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2345
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_ENGVONLIM Property (Page2381) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2346
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2347
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_HIGHLIMITED Property (Page2359) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2348
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2349
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_BAD_CONFERROR Property (Page2338) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2350
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2351
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_LUV Property (Page2385) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2352
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2353
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_PROCRELNOM Property (Page2393) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2354
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2355
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog
2356
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
2357
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2358
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_MAX_RANGE Property (Page2367) VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog
2359
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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 .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
2360
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2361
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2362
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog
2363
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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 .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
2364
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_BAD_PROCRELSUB Property (Page2352) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2365
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2366
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_MIN_LIMIT Property (Page2369) VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MAX_RANGE Property (Page2367) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog
2367
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
2368
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2369
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog
2370
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
2371
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2372
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog
2373
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_STARTUP_VALUE Property (Page2375) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
2374
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2375
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VariableStateChecked Property (Page2400) VALUE_TIMEOUT Property (Page2376) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If the tag does not 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(hmiDynamicCreationTypeDynamicDialog, "'NewDynamic1'") With objDynDialog .ResultType = hmiResultTypeAnalog
2376
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
See also
VariableStateChecked Property (Page2400) VALUE_STARTUP_VALUE Property (Page2375) VALUE_SERVERDOWN Property (Page2373) VALUE_NOT_ESTABLISHED Property (Page2372) VALUE_MIN_RANGE Property (Page2370) VALUE_MIN_LIMIT Property (Page2369) VALUE_MAX_RANGE Property (Page2367) VALUE_MAX_LIMIT Property (Page2365) VALUE_INVALID_KEY Property (Page2361) VALUE_HARDWARE_ERROR Property (Page2358) VALUE_HANDSHAKE_ERROR Property (Page2356) VALUE_CONVERSION_ERROR Property (Page2354) VALUE_ADDRESS_ERROR Property (Page2333) VALUE_ACCESS_FAULT Property (Page2331) VariableStateValue Object (Page1986)
2377
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2378
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_BAD_PROCRELSUB Property (Page2352) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2379
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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 will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2380
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_PROCRELNOM Property (Page2393) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2381
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2382
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_SIMVAL Property (Page2395) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2383
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle is given dynamics with the 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2384
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_LUV Property (Page2385) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2385
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2386
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_HIGHLIMITED Property (Page2359) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2387
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2388
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_NONSPECIFIC Property (Page2391) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2389
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2390
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_LOWLIMITED Property (Page2363) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2391
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2392
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_MAINTDEM Property (Page2387) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2393
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2394
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_BAD_COMMNUV Property (Page2336) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2395
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2396
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_BAD_PROCRELNOM Property (Page2350) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SUBSTSET Property (Page2397) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MISCSTATES Property (Page2389) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
2397
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the radius of a circle will be dynamically configured using 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(hmiDynamicCreationTypeDynamicDialog, "'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 .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
2398
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VALUE_UNCERT_MISCSTATES Property (Page2389) QualityCodeStateChecked Properties (Page2265) VALUE_UNCERT_SIMVAL Property (Page2395) VALUE_UNCERT_PROCRELNOM Property (Page2393) VALUE_UNCERT_NONSPECIFIC Property (Page2391) VALUE_UNCERT_MAINTDEM Property (Page2387) VALUE_UNCERT_LUV Property (Page2385) VALUE_UNCERT_INITVAL Property (Page2383) VALUE_UNCERT_ENGVONLIM Property (Page2381) VALUE_UNCERT_ENGVLOWLIM Property (Page2379) VALUE_UNCERT_ENGVHIGHLIM Property (Page2378) VALUE_LOWLIMITED Property (Page2363) VALUE_HIGHLIMITED Property (Page2359) VALUE_BAD_PROCRELSUB Property (Page2352) VALUE_BAD_PROCRELNOM Property (Page2350) VALUE_BAD_OUTOFSERV Property (Page2348) VALUE_BAD_NOTCONNECTED Property (Page2346) VALUE_BAD_NONSPECIFIC Property (Page2344) VALUE_BAD_MISCSTATES Property (Page2342) VALUE_BAD_DEVICE Property (Page2340) VALUE_BAD_CONFERROR Property (Page2338) VALUE_BAD_COMMNUV Property (Page2336) VALUE_BAD_COMMLUV Property (Page2335) QualityCodeStateValue Object (Page1934)
Example:
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2399
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
DynamicDialog Object (Page1851)
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. 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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
2400
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
DynamicDialog Object (Page1851)
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() 'VBA819 Dim objDyn As HMIDynamicDialog Set objDyn = ActiveDocument.Properties("Width").CreateDynamic(hmiDynamicCreationTypeDynamicDialog, "'TestVal'") MsgBox objDyn.VariableStateType objDyn.Delete End Sub
See also
DynamicDialog Object (Page1851)
Example:
In the following example the radius of a circle will be dynamically configured using the Dynamic dialog. The dynamization takes place be evaluating the status of a tag. If a tag does not return
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2401
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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(hmiDynamicCreationTypeDynamicDialog, "'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 .VALUE_MIN_RANGE = 120 .VALUE_NOT_ESTABLISHED = 130 .VALUE_SERVERDOWN = 140 .VALUE_STARTUP_VALUE = 150 .VALUE_TIMEOUT = 160 End With End Sub
See also
VariableStateValues Object (Listing) (Page1987) DynamicDialog Object (Page1851)
2402
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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_VariableTrigger", "HMICircle") Set objVBScript = objCircle.Radius.CreateDynamic(hmiDynamicCreationTypeVBScript) With objVBScript 'Triggername and cycletime are defined by add-methode Set objVarTrigger = .Trigger.VariableTriggers.Add("VarTrigger", hmiVariableCycleType_10s) .SourceCode = "" End With End Sub
See also
VariableTriggers Object (Listing) (Page1990)
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
2403
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
See also
VariableStateValue Object (Page1986)
Example:
In the following example the current VBA version number is output:
Sub ShowVBAVersion() 'VBA789 MsgBox Application.VBAVersion End Sub
See also
Application Object (Page1814)
Example:
--
See also
Application Object (Page1814)
2404
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
In the following example the version number of the Graphics Designer is output:
Sub ShowVersionOfGraphicsDesigner() 'VBA791 MsgBox Application.Version End Sub
See also
Application Object (Page1814)
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
See also
Views Object (Listing) (Page1993)
2405
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
ToolbarItem Object (Page1970) MenuItem Object (Page1906) HMIObject Object (Page1882) Document Object (Page1847) Toolbar Object (Page1967) Menu Object (Page1903) Application Object (Page1814)
4.4.8.18
W-Z
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
2406
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
TypeWarningHigh Property (Page2322) ColorWarningHigh Property (Page2076) CheckWarningHigh Property (Page2062) BarGraph Object (Page1819)
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
2407
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
'Set barcolor = "magenta" .ColorWarningLow = RGB(255, 0, 255) 'Set lower limit = "12" .WarningLow = 75 End With End Sub
See also
TypeWarningLow Property (Page2323) ColorWarningLow Property (Page2077) CheckWarningLow Property (Page2063) BarGraph Object (Page1819)
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
2408
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
.Width = 120 .BackColor = RGB(255, 0, 0) .Selected = True End With MsgBox "Objects selected!" ActiveDocument.Selection.SameWidth End Sub
See also
HMIObject Object (Page1882)
Example
Example:
The "ApplicationWindowConfig" procedure accesses the properties of the application window. In this example the application window will
Sub ApplicationWindowConfig() 'VBA797 Dim objAppWindow As HMIApplicationWindow
2409
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
PictureWindow Object (Page1919) ApplicationWindow Object (Page1817)
Example
2410
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example
Example
2411
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
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
See also
Application Object (Page1814)
2412
VBA for Automated Configuration 4.4 The object model of the Graphics Designer
Example:
The "BarGraphConfiguration()" procedure configures 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
See also
ZeroPointValue Property (Page2413) ScalingType Property (Page2279) Scaling Property (Page2278) BarGraph Object (Page1819)
Example:
The "BarGraphConfiguration()" procedure configures 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
2413
See also
ZeroPoint Property (Page2412) ScalingType Property (Page2279) Scaling Property (Page2278) BarGraph Object (Page1819) 3DBarGraph Object (Page1805)
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
See also
View Object (Page1991) PictureWindow Object (Page1919)
4.5
4.5.1
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 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 working on different computers during configuration and frequently use VBA macros, you can combine these VBA macros in one or
2414
See also
Loading an Addin in the Graphics Designer (Page2417) Example: Creating Add Ins (Page2418) Linking Add Ins (Page2415)
4.5.2
Requirements
An addin must be registered in the operating system. To register a new addin, double click on the appropriate DLL file. Note For the registration to wok on a double-click, 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 that can be used in the Graphics Designer will behave on loading. To start the Addin Manager, go to the Graphics Designer and select the command "Macros" > "AddIn Manager":
2415
2416
See also
Loading an Addin in the Graphics Designer (Page2417) Example: Creating Add Ins (Page2418) AddIns (Page2414)
4.5.3
Requirements
An addin must be registered in the operating system. To register a new addin, double click on the appropriate DLL file. Note For the registration to wok on a double-click, the DLL files must be linked to the application RegSvr32.exe.
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" > "AddIn Manager". The Addin Manager opens. The "Available Add-Ins" list shows all the addins that are available, together with their current load status:
2417
Result
Depending how the addin is programmed, the function contained in the addin is either listed in the "Tools" > "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.
See also
Linking Add Ins (Page2415) AddIns (Page2414)
4.5.4
4.5.4.1
Introduction
In order to create Addins, this documentation contains an example for Visual Basic 6.0, which creates a runable Addin for use in the Graphic Designer.
Requirements
MS Visual Studio 6.0 must be installed on the configuration computer. You should have programming experience if you wish to use the sample code as a basis for developing addins of your own.
See also
Example: Creating an Add In with Visual Basic 6.0 (Page2419) Linking Add Ins (Page2415)
2418
4.5.4.2
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" > "AddIns" menu to call the function contained in the addin.
Requirements
So that you can create an executable addin from the sample code, "MS Visual Studio 6.0" must You must also have referenced "WinCC Graphics Designer 1.0 Type Library" in "MS Visual Studio 6.0":
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.
2419
2420
2421
2422
2423
Result
The next time you open it, Graphics Designer will contain a user-defined menu called "DocMenu1". The menu "Tools" > "AddIns" contains an entry called "Create Rectangle", which pastes a rectangle into the active picture:
See also
Loading an Addin in the Graphics Designer (Page2417) Example: Creating Add Ins (Page2418)
4.6
4.6.1
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
2424
Requirements
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" > "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 TextLibrary, or customize messages.
2425
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", "DB1,DD0,QC", "NewOrExistingGroupName" '... Exit Sub ErrorHandlerHMIGO: MsgBox ("Error: " & Err.Number & " " & Err.Description& " " & Err.Source) Resume Next End Sub
See also
VBA in Alarm Logging (Page2478) VBA in the Text Library (Page2465) VBA in Tag Logging (Page2438) VBA in Tag Management (Page2426)
4.6.2
4.6.2.1
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
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2426
TagName TagGroupName
Yes/no Yes/no
TagConnection
Yes/no
2427
TagScaleValid
Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes
TagScaleParam1 Sets the value1 for the value range process. TagScaleParam2 Sets the value2 for the value range process. TagScaleParam3 Sets the value1 for the value range tag. TagScaleParam4 Sets the value2 for the value range tag. TagStartvaluePe rsistence TagSubst Defines whether an internal tag is set as persistent. Replacement value (only for external variables)
UseSubstValueO Set the replacement value for connection errors. nCommonError UseSubstValueO Set the replacement value for upper limit. nMaxLimit UseSubstValueO Set the replacement value for lower limit. nMinLimit UseSubstValueO Set the replacement value for the start value. nStartValue
You will find a description of the properties under the parameter descriptions for the corresponding functions.
2428
See also
ListTag function (Page2436) GetTag Function (Page2435) DeleteTag Function (Page2434) CreateTag Function (Page2432) CommitTag Function (Page2430) CloseTag Function (Page2429) VBA in Other WinCC Editors (Page2424)
4.6.2.2 Description
CloseTag Function
Closes the open tag. Note Modified parameters are not saved.
Syntax
Expression.CloseTag()
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
--
2429
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" 'open a tag objHMIGO.CloseTag 'current status is "EMPTY" MsgBox objHMIGO.ObjectStateTag, vbOKOnly, "Status Variable" Set objHMIGO = Nothing End Sub
See also
ListTag function (Page2436) GetTag Function (Page2435) DeleteTag Function (Page2434) CreateTag Function (Page2432) CommitTag Function (Page2430) VBA in Tag Management (Page2426)
4.6.2.3 Description
CommitTag Function
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.
2430
syntax
Expression.CommitTag()
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
--
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.TagStart = 10 'current status is "MODIFIED" 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
2431
See also
ListTag function (Page2436) GetTag Function (Page2435) DeleteTag Function (Page2434) CreateTag Function (Page2432) CloseTag Function (Page2429) VBA in Tag Management (Page2426)
4.6.2.4 Description
CreateTag Function
syntax
Expression.CreateTag(TagName,TagType,[Connection],[S7S5Address], [GroupName])
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) TagName (string) TagType (HMIGO_TAG_TYPE) Description Name of the tag to be created. 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_IEEE_ 754 TAG_FLOATINGPOINT_NUMBER_64BIT_IEEE_ 754 TAG_TEXT_TAG_8BIT_CHARACTER_SET TAG_TEXT_TAG_16BIT_CHARACTER_SET TAG_RAW_DATA_TYPE TAG_TEXT_REFERENCE
2432
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
2433
See also
ListTag function (Page2436) GetTag Function (Page2435) DeleteTag Function (Page2434) CommitTag Function (Page2430) CloseTag Function (Page2429) VBA in Tag Management (Page2426)
4.6.2.5 Description
DeleteTag Function
syntax
Expression.DeleteTag(TagName)
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) TagName (string) Description 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
2434
See also
ListTag function (Page2436) GetTag Function (Page2435) CreateTag Function (Page2432) CommitTag Function (Page2430) CloseTag Function (Page2429) VBA in Tag Management (Page2426)
4.6.2.6 Description
GetTag Function
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
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) TagName (string) Description 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
2435
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
See also
ListTag function (Page2436) DeleteTag Function (Page2434) CreateTag Function (Page2432) CommitTag Function (Page2430) CloseTag Function (Page2429) VBA in Tag Management (Page2426)
4.6.2.7 Description
ListTag function
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.
2436
Parameters
Parameter (Data Type) ListType (HMIGO_TAG_LIST_TYPE) Description 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) List with the requested content. Filters can be set optionally. Wildcards "*" and "?" are also possible.
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 varRange As Variant 'read all connections objHMIGO.ListTag TAG_CONNECTIONS, arrContent 'check result If (UBound(arrContent) - LBound(arrContent) + 1) <= 0 Then MsgBox "no entries because no connections are implemented" End If End Sub
See also
GetTag Function (Page2435) DeleteTag Function (Page2434) CreateTag Function (Page2432) CommitTag Function (Page2430) CloseTag Function (Page2429) VBA in Tag Management (Page2426)
2437
4.6.3
4.6.3.1
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 Tag Logging must not be open or be opened when editing with VBA. Before you use the trigger of the tag logging in VBA with a newly created WinCC project, you must first start the Editor "Tag Logging", create an archive and then again close the Editor. The triggers are created by the Editor.
2438
P, V P, V P, V P, V P, V
Yes/yes
2439
P, V P, V P, V
2440
Specifies whether archiving is to be carried Yes/yes out in the event of a change. Possible values of Enum HMIGO_TLG_TAG_ON_CHANGE: TLG_TAG_EVERY_VALUE (0) TLG_TAG_RELATIVE_HYSTERESE (1) TLG_TAG_ABSOLUTE_HYSTERESE (2)
TlgTagMethodType
Specifies the method by which the value is Yes/yes edited before archiving. Possible values of Enum HMIGO_TLG_TAG_METHOD_TYPE: TLG_TAG_ACTUAL (1) TLG_TAG_SUM (3) TLG_TAG_MaxValue (5) TLG_TAG_MinValue (4) TLG_TAG_AVERAGE (2)
P, V
TlgTagTriggerScan TlgTagTriggerArchiving
Name of the timer for the acquisition cycle Name of the timer for the archiving cycle.
P P P
TlgTagStartTriggerFunc Specifies the name of a script function by tion means of which a check is carried out for a start event for the start of archiving. TlgTagStartTriggerMod ule Specifies the name of a DLL from which the script function is called for the checking of a start event.
Yes/yes
TlgTagStopTriggerFunc Specifies the name of a script function by tion means of which a check is carried out for a stop event for the start of archiving. TlgTagTriggerFunction Specifies the name of a script function for the dynamic switching of the acquisition and archiving cycles. In the case of compressed archives, contains the name of the source archive. In the case of compressed archives, contains the name of the source tag. In the cast of process-controlled archives, contains the name of the raw-data tag. Name of the conversion DLL used for data conversion. Name of the process tag from which the value to be acquired is taken The alternative name by means of which the tag can be addressed (alias). Name of the tag by means of which the start of archiving is checked. Name of the tag by means of which the stopping of archiving is checked. Contains the factor for the display cycle as a multiple of the archiving cycle.
Yes/yes
Yes/yes
TlgTagNameCompress Archive TlgTagNameCompress Tag TlgTagNameRawValue TlgTagConvertModule TlgTagNameProcTag TlgTagAliasName TlgTagStartEvent TlgTagStopEvent TlgTagTriggerFactor TlgTagUpperLimit
V V P P P P P P P P
2441
See also
ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Other WinCC Editors (Page2424)
4.6.3.2 Description
CloseTlgArchive-Funktion
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.
Parameters
-MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2442
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" MsgBox objHMIGO.ObjectStateTlgArchive, vbOKOnly, "Status Tlg Archive" Set objHMIGO = Nothing End Sub
See also
ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) VBA in Tag Logging (Page2438)
4.6.3.3 Description
CloseTlgTag Function
2443
syntax
Expression.CloseTlgTag()
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
--
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" 'close tag logging tag objHMIGO.CloseTlgTag 'current status is "EMPTY" MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, "Status Tlg Archive" Set objHMIGO = Nothing End Sub
2444
See also
ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
4.6.3.4 Description
CommitTlgArchive Function
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
Necessary. An expression which returns a "HMIGO" type object.
Parameters
--
Example:
Sub CommitTlgArchive() ' HMIGO_008
2445
' 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" 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
See also
DeleteTlgArchive Function (Page2455) ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
4.6.3.5 Description
CommitTlgTag Function
2446
syntax
Expression.CommitTlgTag()
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
--
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" 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
2447
See also
ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
4.6.3.6 Description
CreateTlgArchive Function
syntax
Expression.CreateTlgArchive(ArchiveName,ArchiveType)
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) ArchiveName (String) ArchiveType (HMIGO_TLG_ARCHIVE_TYPE) Description Name of the archive to be created Type of the archive. The possible types are: TLG_PROCESSARCHIVE (131073) for a process value archive TLG_COMPRESSARCHIVE (131074) for a compressed archive
2448
TlgArchiveAccessLevelWri 0 te TlgArchiveArchiveState TlgArchiveBufferSize TlgArchiveBufferType TlgArchiveCompressRang e TLG_ARCHIVE_STATE_ACTIVAT ED (0) 1000 TLG_ARCHIVE_BUFFER_TYPE_D ISK (2) "1 Tag". This string must be created individually for each language (e.g. English: "1 day")
TlgArchiveCompressType
TLG_COMPRESS_TYPE_CALC (1) Only calculate compression values. Only relevant in the case of compressed tags.
Enum HMIGO_TLG_ARCHIVE_STATE
Parameters TLG_ARCHIVE_STATE_LOCKED (1) TLG_ARCHIVE_STATE_ACTIVATED (0) Description Archiving is disabled at system startup. Archiving is started at start of Runtime.
Enum HMIGO_TLG_ARCHIVE_BUFFER_TYPE
Parameters 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.
2449
Enum HMIGO_TLG_ARCHIVE_COMPRESS_TYPE
Parameters TLG_COMPRESS_TYPE_CALC (1) Description 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) TLG_COMPRESS_TYPE_CALC_COPY_D EL (4) The compression values are calculated and the original values then deleted. The compression values are calculated and the original values 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
See also
GetTlgArchive Function (Page2458) ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgTag Function (Page2451) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
2450
4.6.3.7 Description
CreateTlgTag Function
syntax
Expression.CreateTlgTag(ArchiveName,TagName,[TagType])
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) ArchiveName (String) TagName (string) TagType (HMIGO_TLG_TAG_TYPE, optional) Description Name of an existing archive in which the tag is to be entered Name of the tag to be created 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.
2451
TlgTagTriggerArchiving
1 second
1 TLG_TAG_LAST_VALUE (1) TLG_TAG_ALWAYS (4) TLG_TAG_ACTUAL (1) No function specified No function specified No function specified No value specified No value specified
TlgTagNameCompressArchi No archive name specified ve TlgTagNameCompressTag TlgTagNameRawValue TlgTagStartTriggerModule TlgTagNameProcTag TlgTagOnChange TlgTagHysterese TlgTagAliasName TlgTagStartEvent TlgTagStopEvent No tag name specified No raw-data tag specified No DLL name specified Corresponds to "TagName" TLG_TAG_EVERY_VALUE (0) 0 No value specified No tag specified No tag specified
2452
TLG_TAG_TRIGGER_TYPE
TLG_TAG_METHOD_TYPE
TLG_TAG_ON_CHANGE
Enum HMIGO_TLG_TAG_TYPE
Values TLG_TAG_TYP_ANALOG (65537) TLG_TAG_TYP_BINARY (65538) TLG_TAG_TYP_PROCESS (65544) TLG_TAG_TYP_COMPRESS (65540) Description Analog tag Binary Tags Process tag Compressed archive tag
Enum HMIGO_TLG_TAG_ARCHIVING
Values TLG_TAG_ACYCLIC (8388609) TLG_TAG_CYCLIC_CONTINUOUS (8388610) TLG_TAG_CYCLIC_SELECTIVE (8388612) TLG_TAG_ON_EVERY_CHANGE (8388616) Description Acyclic acquisition Cyclic-continuous acquisition Cyclic-selective acquisition Acquisition only in the event of a change
Enum HMIGO_TLG_TAG_ARCHIVING_STATE
Values TLG_TAG_LOCKED (1) TLG_TAG_ACTIVATED (0) Description Acquisition disabled at system startup Acquisition enabled at system startup
2453
Enum HMIGO_TLG_TAG_ON_ERROR
Values TLG_TAG_LAST_VALUE (1) TLG_TAG_SUBSTITUTE (2) Description The most recently acquired value is used. A substitute value is entered.
Enum HMIGO_TLG_TAG_TRIGGER_TYPE
Values TLG_TAG_FROM_0_TO_1 (2) TLG_TAG_FROM_1_TO_0 (3) TLG_TAG_ALWAYS (4) TLG_TAG_EVERY_CHANGE (1) Description Signal change from the value 0 to 1 Signal change from the value 1 to 0 Always archive. Archive at every signal change.
Enum HMIGO_TLG_TAG_METHOD_TYPE
Values TLG_TAG_ACTUAL (1) TLG_TAG_SUM (3) TLG_TAG_MaxValue (5) TLG_TAG_MinValue (4) TLG_TAG_AVERAGE (2) Description The current value is accepted. The sum is formed. The greatest value is saved. The smallest value is saved. The average value is saved.
Enum HMIGO_TLG_TAG_ON_CHANGE
Values TLG_TAG_EVERY_VALUE (0) Description The current value is accepted.
TLG_TAG_RELATIVE_HYSTERESE A hysteresis specified as a percentage is used for the (1) calculation as to whether the value is to be archived. TLG_TAG_ABSOLUTE_HYSTERES A hysteresis specified as an absolute value is used for the E (2) calculation as to whether the value is to be archived.
Example:
Sub CreateTlgTag() ' HMIGO_011 ' procedure to create a tag logging tag
2454
' 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
See also
ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CloseTlgArchive-Funktion (Page2442) CloseTlgTag Function (Page2443) VBA in Tag Logging (Page2438)
4.6.3.8 Description
DeleteTlgArchive Function
Syntax
Expression.DeleteTlgArchive(ArchiveName)
Expression
Necessary. An expression which returns a "HMIGO" type object.
2455
Parameters
Parameter (Data Type) ArchiveName (String) Description 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
See also
ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
2456
4.6.3.9 Description
DeleteTlgTag Function
syntax
Expression.DeleteTlgTag(ArchiveName,TagName)
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) ArchiveName (String) TagName (string) Description Name of the archive containing the archive tag to be deleted 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
2457
See also
ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgArchive Function (Page2455) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
4.6.3.10 Description
GetTlgArchive Function
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 TagLogging".
syntax
Expression.GetTlgArchive(ArchiveName)
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) ArchiveName (String) Description Name of the archive whose values are to be read in.
Example:
Sub GetTlgArchive() ' HMIGO_014
2458
' 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
See also
CreateTlgTag Function (Page2451) ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
4.6.3.11 Description
GetTlgTag Function
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 TagLogging".
syntax
Expression.GetTlgTag(ArchiveName,TagName)
2459
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) ArchiveName (String) TagName Description Name of the archive containing the archive tag. Name of the archive tag whose parameters are to be read in.
Example:
Sub GetTlgTag() ' HMIGO_015 ' procedure to close 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 'current status is "OPENED" MsgBox objHMIGO.ObjectStateTlgTag, vbOKOnly, "Status Tlg Archive" Set objHMIGO = Nothing End Sub
2460
See also
CreateTlgTag Function (Page2451) ListTlgTag Function (Page2463) ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
4.6.3.12 Description
ListTlgArchive Function
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.
2461
Parameters
Parameter (Data Type) ListType (HMIGO_TLG_ARCHIVE_LIST_TYPE) Description Defines which content should be returned in a list. Possibilities are: TLG_ARCHIVE_NAMES (1) All created Tag Logging archives TLG_ARCHIVE_TRIGGER_NAMES (2) All created cycles / timers pListArray (Variant) Filter (String) List with the requested content. Filters can be set optionally. A trigger name can be used as a filter. Wildcards "*" and "?" are also possible.
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 varRange As Variant 'read all tlg archives objHMIGO.ListTlgArchive TLG_ARCHIVE_NAMES, arrContent 'check result If (UBound(arrContent) - LBound(arrContent) + 1) <= 0 Then MsgBox "no entries because no tag logging archives are implemented" End If End Sub
2462
See also
ListTlgTag Function (Page2463) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
4.6.3.13 Description
ListTlgTag Function
The ListTlgTag function returns all the tags created in a Tag Logging archive in a list.
syntax
Expression.ListTlgTag(ListType,ListArray,[ArchiveName],[Filter])
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) ListType (HMIGO_TLG_TAG_LIST_TYPE) Description 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) List with the requested content. Name of the archive in Tag Logging (optional). If the name of the archive is not specified, all,archive tags are returned. Filters can be set optionally. Wildcards "*" and "?" are also possible.
Filter (String)
2463
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 varRange 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) <= 0 Then MsgBox "no entries because no tag logging tags in specified archive are implemented" End If End Sub
See also
ListTlgArchive Function (Page2461) GetTlgArchive Function (Page2458) DeleteTlgTag Function (Page2457) DeleteTlgArchive Function (Page2455) CreateTlgTag Function (Page2451) CreateTlgArchive Function (Page2448) CommitTlgTag Function (Page2446) CommitTlgArchive Function (Page2445) CloseTlgTag Function (Page2443) CloseTlgArchive-Funktion (Page2442) VBA in Tag Logging (Page2438)
2464
4.6.4
4.6.4.1
Introduction
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 TextLibrary: 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 TextLibrary must not be open or be opened when editing using VBA.
See also
ModifyText Function (Page2476) ListText Function (Page2475) GetTextID Function (Page2473) GetText Function (Page2471) DeleteTextLanguage Function (Page2470) DeleteText Function (Page2468) CreateText Function (Page2467) CreateTextLanguage Function (Page2466) VBA in Other WinCC Editors (Page2424)
2465
4.6.4.2 Description
CreateTextLanguage Function
syntax
Expression.CreateTextLanguage(LanguageID)
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) LanguageID (Long) Description ID for the language to be created (e.g. 1031 for German, 1033 for English, etc.) For a table of all language codes refer to the WinCC online help on "Language Identifiers".
Example:
Sub CreateTextLanguage() ' HMIGO_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
2466
See also
ModifyText Function (Page2476) ListText Function (Page2475) GetTextID Function (Page2473) GetText Function (Page2471) DeleteTextLanguage Function (Page2470) DeleteText Function (Page2468) CreateText Function (Page2467) VBA in the Text Library (Page2465)
4.6.4.3 Description
CreateText Function
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.
Parameters
Parameter (Data Type) LanguageID (Long) Text (string) CreateMode (HMIGO_TEXT_CREATE_MODE) Description ID of the language for which the text will be created. Text to be created. 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) 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.
2467
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 'return value of ".CreateText" 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
See also
ModifyText Function (Page2476) ListText Function (Page2475) GetTextID Function (Page2473) GetText Function (Page2471) DeleteTextLanguage Function (Page2470) DeleteText Function (Page2468) CreateTextLanguage Function (Page2466) VBA in the Text Library (Page2465)
4.6.4.4 Description
DeleteText Function
Deletes a line of text. All the languages for the corresponding line of text and the line of text itself are deleted.
2468
syntax
Expression.DeleteText(TextID)
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) TextID (long) Description 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 'return value of GetTextID 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 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 & _
2469
"ErrDes.: " & Err.Description, vbOKOnly, "Error ocurred" 'reset errorhandler Err.Clear End Sub
See also
VBA in the Text Library (Page2465) ModifyText Function (Page2476) ListText Function (Page2475) GetTextID Function (Page2473) GetText Function (Page2471) DeleteTextLanguage Function (Page2470) CreateText Function (Page2467) CreateTextLanguage Function (Page2466)
4.6.4.5 Description
DeleteTextLanguage Function
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.
Parameters
Parameter (Data Type) LanguageID (Long) Description ID of the language to be deleted
2470
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 varRange 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
See also
GetText Function (Page2471) ModifyText Function (Page2476) ListText Function (Page2475) GetTextID Function (Page2473) DeleteText Function (Page2468) CreateText Function (Page2467) CreateTextLanguage Function (Page2466) VBA in the Text Library (Page2465)
4.6.4.6 Description
GetText Function
Returns the text for the selected text ID in the selected language.
syntax
Expression.GetText(LanguageID,TextID,Text)
2471
Expression
Necessary. An expression that returns an object of the type "HMIGeneralObjects".
Parameters
Parameter (Data Type) LanguageID (Long) TextID (long) Text (string) Description ID of the language of the text to be read ID of the line of text from which text is to be read 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
2472
See also
ModifyText Function (Page2476) ListText Function (Page2475) GetTextID Function (Page2473) DeleteTextLanguage Function (Page2470) DeleteText Function (Page2468) CreateText Function (Page2467) CreateTextLanguage Function (Page2466) VBA in the Text Library (Page2465)
4.6.4.7 Description
GetTextID Function
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 which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) LanguageID (Long) Text (string) TextID (long) Description ID of the language of the text searched for The text searched for ID of the line of text in which the text searched for was found
Example:
Sub GetTextID() ' HMIGO_020 ' procedure to search a TextID
2473
' text will be searched and a TextID will be returned ' declarations Dim objHMIGO As HMIGO Dim lngLanguageID As Long Dim lngTextID As Long 'return value of GetTextID 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 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
See also
ModifyText Function (Page2476) ListText Function (Page2475) GetText Function (Page2471) DeleteTextLanguage Function (Page2470) DeleteText Function (Page2468) CreateText Function (Page2467) CreateTextLanguage Function (Page2466) VBA in the Text Library (Page2465)
2474
4.6.4.8 Description
ListText Function
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
Exoression.ListText(ListType,pListArray,[LanguageID],[Filter])
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) ListType (HMIGO_TEXT_LIST_TYPE) Description 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) Filter (String) List with the requested content. The language ID whose text is to be returned. Filters can be set optionally. Wildcards "*" and "?" are also possible.
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 varRange As Variant Dim intLanguage As Integer 'set invalid language ID intLanguage = 1051 'language does not exist
2475
'read all texts objHMIGO.ListText TEXT_TEXTS, arrContent, intLanguage 'check result If (UBound(arrContent) - LBound(arrContent) + 1) <= 0 Then MsgBox "no entries because wrong language selection" End If End Sub
See also
ModifyText Function (Page2476) GetTextID Function (Page2473) GetText Function (Page2471) DeleteTextLanguage Function (Page2470) DeleteText Function (Page2468) CreateTextLanguage Function (Page2466) VBA in the Text Library (Page2465)
4.6.4.9 Description
ModifyText Function
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.
Parameters
Parameter (Data Type) LanguageID (Long) TextID (long) Text (string) Description ID of the language of the text to be changed. ID of the language of the text to be changed. New text to be inserted.
2476
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 'return value of GetTextID 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 '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
2477
See also
ListText Function (Page2475) GetTextID Function (Page2473) GetText Function (Page2471) DeleteTextLanguage Function (Page2470) DeleteText Function (Page2468) CreateText Function (Page2467) CreateTextLanguage Function (Page2466) VBA in the Text Library (Page2465)
4.6.5
4.6.5.1
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.
2478
2479
SingleAlarmTagNameProcessVal For the process values there are the properties Yes/yes ueXX SingleAlarmTagNameProcessValue1 through 10 XX = 1...10 If you want to delete a configured process value, you must describe this parameter with a tag of the type "Long", which has the value "0".1) SingleAlarmTagName SingleAlarmMessageBit SingleAlarmQuitTag SingleAlarmQuitBits SingleAlarmStateTag SingleAlarmStateBits SingleAlarmNormDLL SingleAlarmQuitSingle SingleAlarmHornActivate SingleAlarmArchiving SingleAlarmProtocol SingleAlarmFlankInvert SingleAlarmLockedOnStart SingleAlarmGlobalAPFunction SingleAlarmActionName SingleAlarmActionParams SingleAlarmInfoText SingleAlarmGroup
1)
Tag name for event Bits for bit reporting procedure Tag name for acknowledgment status Bit for bit reporting procedure Tag for status query Bit for status tag Name of the conversion DLL Acknowledgment of the messages, TRUE or FALSE possible Activation of the horn, TRUE or FALSE possible Archiving of the message, TRUE or FALSE possible Logging of the message, TRUE or FALSE possible Triggering of message at falling edge, TRUE or FALSE possible Message is disabled at system startup, TRUE or FALSE possible Forward message to global AP function, TRUE or FALSE possible Name of the action Parameters of the action Information text for message Name of the user-defined group message assigned to a message.
Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes Yes/yes
Sub DeleteSingleAlarmTagNameProcessValue1() 'HMIGO_033 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
2480
See also
ListSingleAlarm Function (Page2489) GetSingleAlarm Function (Page2488) DeleteSingleAlarm Function (Page2487) CreateSingleAlarm Function (Page2483) CommitSingleAlarm Function (Page2482) CloseSingleAlarm Function (Page2481) VBA in Other WinCC Editors (Page2424)
4.6.5.2 Description
CloseSingleAlarm Function
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
Necessary. An expression which returns a "HMIGO" type object.
Parameters
--
Example:
Sub CloseSingleAlarm() ' HMIGO_22 ' 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
2481
'current status is "EMPTY" MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly, "Status SingleAlarm" 'open a singlealarm objHMIGO.GetSingleAlarm lngMsgNumber 'current status is "OPENED" MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly, "Status SingleAlarm" 'close a singlealarm objHMIGO.CloseSingleAlarm 'current status is "EMPTY" MsgBox objHMIGO.ObjectStateSingleAlarm, vbOKOnly, "Status SingleAlarm" Set objHMIGO = Nothing End Sub
See also
ListSingleAlarm Function (Page2489) GetSingleAlarm Function (Page2488) DeleteSingleAlarm Function (Page2487) CreateSingleAlarm Function (Page2483) CommitSingleAlarm Function (Page2482) VBA in Alarm Logging (Page2478)
4.6.5.3 Description
CommitSingleAlarm Function
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
Necessary. An expression which returns a "HMIGO" type object.
Parameters
--
2482
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 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
See also
ListSingleAlarm Function (Page2489) GetSingleAlarm Function (Page2488) DeleteSingleAlarm Function (Page2487) CreateSingleAlarm Function (Page2483) CloseSingleAlarm Function (Page2481) VBA in Alarm Logging (Page2478)
4.6.5.4 Description
CreateSingleAlarm Function
2483
syntax
Expression.CreateSingleAlarm(MessageNumber,ClassID,MessageTypeID,Tex t1ID,MessageTagName,MessageBit)
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) MessageNumber (long) Description 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_IDS. 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) ID for the first user text. The ModifySingleAlarm function can be used to define nine further user texts (1-10). Tag name for the event. Bit in bit reporting process (0...31)
2484
SingleAlarmStateBits SingleAlarmNormDLL SingleAlarmQuitSingle SingleAlarmHornActivate SingleAlarmArchiving SingleAlarmProtocol SingleAlarmFlankInvert SingleAlarmLockedOnStart SingleAlarmGlobalAPIFunction SingleAlarmActionName SingleAlarmActionParams SingleAlarmInfoText SingleAlarmGroup
0 No name entered FALSE FALSE TRUE TRUE FALSE FALSE FALSE No name entered No parameters entered for the action No text entered No text entered
Enum HMIGO_SINGLE_ALARM_CLASS_IDS
The following message classes are available for selection:
Values 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) Description ----------------
2485
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 'bit number within the message variable Dim lngMsgTypeID As Long 'message type Dim lngMsgClassID 'SINGLE_ALARM_ERROR Dim lngMsgTextID As Long 'message text ID from textlibrary 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
2486
See also
ListSingleAlarm Function (Page2489) GetSingleAlarm Function (Page2488) DeleteSingleAlarm Function (Page2487) CommitSingleAlarm Function (Page2482) CloseSingleAlarm Function (Page2481) VBA in Alarm Logging (Page2478)
4.6.5.5 Description
DeleteSingleAlarm Function
syntax
Expression.DeleteSingleAlarm(MessageNumber)
Expression
Necessary. An expression which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) MessageNumber (long) Description 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
2487
See also
VBA in Alarm Logging (Page2478) ListSingleAlarm Function (Page2489) GetSingleAlarm Function (Page2488) CreateSingleAlarm Function (Page2483) CommitSingleAlarm Function (Page2482) CloseSingleAlarm Function (Page2481)
4.6.5.6 Description
GetSingleAlarm Function
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 which returns a "HMIGO" type object.
Parameters
Parameter (Data Type) MessageNumber (long) Description 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
2488
' 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
See also
ListSingleAlarm Function (Page2489) DeleteSingleAlarm Function (Page2487) CreateSingleAlarm Function (Page2483) CommitSingleAlarm Function (Page2482) CloseSingleAlarm Function (Page2481) VBA in Alarm Logging (Page2478)
4.6.5.7 Description
ListSingleAlarm Function
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.
2489
Parameters
Parameter (Data Type) ListType (HMIGO_SINGLE_ALARM_LIST_TYPE) Description Defines which content should be returned in a list. Possibilities are: SINGLE_ALARM_ACTION_NAMES (1) All actions created for Loop In Alarm 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_CLASSES (6) All message classes created SINGLE_ALARM_GROUP_MESSAGE_USER_DEF INED (7) All group messages created pListArray (Variant) Filter (String) List with the requested content. 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 varRange As Variant 'read all info texts objHMIGO.ListSingleAlarm SINGLE_ALARM_INFO_TEXTS, arrContent 'check result If (UBound(arrContent) - LBound(arrContent) + 1) <= 0 Then MsgBox "no entries because no info texts are implemented" End If End Sub
2490
See also
CreateSingleAlarm Function (Page2483) CommitSingleAlarm Function (Page2482) CloseSingleAlarm Function (Page2481) VBA in Alarm Logging (Page2478)
2491
Index
, 54 Action, 23, 38, 64, 66, 69, 74, 76, 1644 Cause for non-execution of an action, 802 Compiling, 802, 810 Configuring with VBA, 1644 Create, 55 Creating functions and actions, 763, 802 Creating new actions, 806 CrossReference, 55 Defining, 763 Deleting, 785 Dialog "Info", 66 Differences between actions and functions, 802 edit, 802 Edit, 55 Editing, 807, 829 Exporting, 821 Finding, 802 Importing, 821 Printing, 788 Protecting with a Password, 66 Protection against read and write access, 809 Renaming, 802, 822 Runtime behavior, 824 Saving, 810 Structuring, 763 Use of DLLs, 774 Using actions from outside the project, 823 Action configuring, 1644 with VBA, 1644 Action icon Features, 802 Action:Add Information, 64 Action:Configure a Trigger of Type "Tag", 76 Action:Configure a Trigger of Type "Timer", 74 Action:Corrective measure, 67 Action:Delete, 38 Action:Dialog "Info", 64 Action:Editing, 61 Action:new creation, 59 Action:Save, 67 Action:Trigger, 21 Activating, 82 Activating:of global actions in Runtime, 82 ActiveX controls, 1617 Inserting with VBA, 1617
A
abort, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 abs, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 AcknowledgeMessage, 836, 838 acos, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
2493
Index
AddIn, 2414 AddIn Manager, 2415 create (example), 2418 create with VB (example), 2419 load automatically, 2415 load manually, 2415 Loading (instructions), 2417 Loading behavior, 2415 unload, 2415 Use in Graphics Designer, 2414 Adding Timer trigger , 814 adding to picture, 85 Adding trigger, 815 Aktion:Renaming, 81 Aktion:use multiple times, 23 Alarm Control, 265 Alarm Logging, 2478 Creating message with VBA, 2478 Deleting message with VBA, 2478 Editing message with VBA, 2478 Modifying message with VBA, 2478 Alarm object, 115 AlarmControl, 236 AlarmLogs Object, 118 Alarms object (list), 116 Analog Clock, 239 Animation trigger, 73 Application-specific menu, 1573 Add menu entry, 1577 Assigning help text, 1586 Assigning status text, 1586 Assigning VBA macro, 1589 Configuring, 1572 Creating, 1575 creating multiple languages, 1580 Application-specific toolbar, 1573 Add icon, 1584 Assigning help text, 1586 Assigning status text, 1586 Assigning VBA macro, 1589 Configuring, 1572 Creating, 1582 asctime, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 asin, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940,
941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 atan, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 atan2, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 atof, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 atoi, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 atol, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 AttachDB, 643 Attribute:GSC Runtime, 89 Authorization Assigning, 820 Authorizations, 820 AXC_OnBtnAlarmHidingList, 858
2494
Index
AXC_OnBtnArcLong, 859 AXC_OnBtnArcShort, 860 AXC_OnBtnComment, 861 AXC_OnBtnEmergAckn, 862 AXC_OnBtnHideDlg, 863 AXC_OnBtnHideUnhideMsg, 864 AXC_OnBtnHit, 865 AXC_OnBtnHornAckn, 866 AXC_OnBtnInfo, 867 AXC_OnBtnLock, 868 AXC_OnBtnLockUnlock, 869 AXC_OnBtnLockWin, 870 AXC_OnBtnLoop, 871 AXC_OnBtnMsgFirst, 872 AXC_OnBtnMsgLast, 873 AXC_OnBtnMsgNext, 874 AXC_OnBtnMsgPrev, 875 AXC_OnBtnMsgWin, 876 AXC_OnBtnPrint, 877 AXC_OnBtnProtocol, 878 AXC_OnBtnScroll, 878 AXC_OnBtnSelect, 879 AXC_OnBtnSinglAckn, 880 AXC_OnBtnSortDlg, 881 AXC_OnBtnTimeBase, 882 AXC_OnBtnVisibleAckn, 883 AXC_SetFilter, 837
C
C action, 1648 Configuring on an event with VBA, 1648 C script, 1639 Dynamize property with VBA, 1639 c_bib, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 CalculateStatistic, 643 calloc, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ceil, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Change, 78 Change:Triggers, 78 char_io, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Class, 2424 HMIGO, 2424 clearerr, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
B
basics, 760 Basics from VBS, 760 Bookmark:delete in Debugger, 105 Bookmark:set in Debugger, 105 Bookmark:skip to, 105 Bookmarks, 105 Breakpoint, 103, 104 Breakpoint:Deleting, 104 Breakpoint:set in Debugger, 103 bsearch, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
2495
Index
clock, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Code, 45, 108 Code Templates, 61 Code templates for VBS, 45 Code:of a Procedure, 45 Code:print, 108 Collections, 1664 Overview, 1664 Color code, 778 ComboBox object, 1834 CommonVBSEventArea properties, 2078 CommonVBSPropertyArea property, 2079 Component library, 1593 Access with VBA, 1593 Copying an object with VBA, 1596 Creating a folder with VBA, 1596 Deleting a folder with VBA, 1596 Editing with VBA, 1596 Paste Object into a Picture with VBA, 1599 Computer properties, 91, 771 Runtime Tab, 91 Configuring, 1570, 1645, 1648 C action with VBA, 1648 Direct connection, 1645 for multiple languages with VBA, 1570 Trigger with VBA, 1652 VB action with VBA, 1650 Contents, 13 Controls WinCC Alarm Control, 265 WinCC MediaControl, 246 Controls:HMI Symbol Library 1.4.1, 233 Controls:WinCC Digital Analog Clock, 239 Controls:WinCC Function Trend Control, 267 Controls:WinCC FunctionTrendControl, 241 Controls:WinCC Online Table Control, 269 Controls:WinCC Online Trend Control, 271 Controls:WinCC OnlineTableControl, 247 Controls:WinCC OnlineTrendControl, 250 Controls:WinCC RulerControl, 257 Controls:WinCC Slider Control,WinCC:WinCC Slider Control, 259 Controls:WinCC UserArchiveControl, 263 CopyRows, 643
cos, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 cosh, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Create, 55, 59 Action, 55 Procedures, 39 Create:Action, 59 Create:Procedure, 42 CreateTagSet, 644 Cross-reference, 69 ctime, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ctype, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Customized Object, 1626 Access with VBA, 1626 Deleting, 1628 Editing with VBA, 1628 Properties, 1626 ungroup, 1628 CutRows, 645 Cyclic, 69
D
DataItem Object, 119 DataLogs-Objekt, 121
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2496
Index
DataSet-Objekt (List), 122 Debugger, 91, 93, 97, 99, 100, 102, 103, 104, 105, 106, 107 Activating in WinCC, 91 Opening after error message, 91 Opening automatically, 91 Starting for Global Script, 91 Starting for Graphics Runtime, 91 Debugger,Microsoft Script Debugger:Components, 95 Debugger:Basic Principles, 93, 102 Debugger:Call Stack, 95 Debugger:Change Picture During Debug, 93 Debugger:Command Window, 95 Debugger:Components, 95 Debugger:Delete bookmark, 105 Debugger:Deleting Breakpoints, 104 Debugger:Determine property values, 106 Debugger:Determine tag values, 106 Debugger:Executing Script Commands, 107 Debugger:modify property values, 106 Debugger:Modify tag values, 106 Debugger:Name of actions in the script file, 99 Debugger:Processing Scripts Step-by-Step, 102 Debugger:Running Documents, 95 Debugger:select running script, 100 Debugger:Set bookmark, 105 Debugger:Setting Breakpoints, 103 Debugger:skip to bookmark, 105 Debugger:Structure of the Script Files, 97 Declaration area, 61 Declaration Area:of an Action, 61 Delete:Actions and Procedures, 38 Delete:Trigger, 79 DeleteRows, 646 DeleteTextLanguage, 2470 Design of Global Script, 30 Design tool, 763 DetachDB, 646 Diagnostics, 84, 85, 86, 87, 88, 89, 90 Diagnostics:Attributes:GSC Diagnostics, 86 Diagnostics:Debugger, 90 Diagnostics:GSC Diagnostics, 84 Diagnostics:GSC Runtime, 87 Diagnostics:GSC Runtime Attributes, 89 Diagnostics:Inserting GSC Diagnostics Window into a Picture, 85 Diagnostics:Inserting GSC Runtime into a Picture, 88 Diagnostics:VBS:Diagnostics, 83 difftime, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940,
941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Digital Analog Clock, 239 Digital Clock, 239 Direct connection, 1645 Configuring with VBA, 1645 Directio, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 div, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Dynamic dialog, 1636 Dynamize property with VBA, 1636 Dynamization, 1632 Dynamic dialog with VBA, 1632 of properties with VBA, 1632 Scripts with VBA, 1632 Tag connection with VBA, 1632 Dynamizing, 1634, 1639 Property with C script with VBA, 1639 Property with Dynamic dialog with VBA, 1636 Property with Tag Connection, 1634 Property with VB script with VBA, 1642
E
Edit, 55, 647, 1603 Action, 55 Copy of a Picture with VBA, 1605 Layer with VBA, 1603 Procedures, 39 Edit window Working in the edit window, 778 Edit:Action, 61 Editing, 61
2497
Index
Editing function, 780 Editing functions with the keyboard, 780 Editing functions with the mouse, 780 Editing Objects with VBA, 1606 Editing Window, 32 Editing window:Color coding, 32 Editing Window:Global Script, 32 Editor, 28, 30, 36 Editor:Global Script, 28 Editor:Toolbars, 36 Editor:VBS-Editor in the Graphics Designer, 28 EigenschaftenProperties , 1664 Error, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Error codes, 407 Error Messages, 363, 732 Error types, 93 Error types:Logical error, 93 Error types:Runtime Error, 93 Error types:Syntax Error, 93 Error:syntax, 67 Event, 1655 application-specific, 1655 Forwarding, 1655 picture-specific, 1655 Event Handling, 1566, 1655, 1664 Activated event, 1671 Forwarding of events, 1562 Overview, 1664 prevent, 1655 Shutting down, 1655 Event-driven, 69 Event-HandlingVBAEvents , 1664
Events, 1664 Activated, 1671 BeforeClose, 1672 BeforeDocumentClose, 1673 BeforeDocumentSave, 1674 BeforeHMIObjectDelete, 1675 BeforeLibraryFolderDelete, 1676 BeforeLibraryObjectDelete, 1677 BeforeQuit, 1678 BeforeSave, 1679 BeforeVisibleFalse, 1680 ConnectionEvent, 1681 DataLanguageChanged, 1681 DesktopLanguageChanged, 1682 DocumentActivated, 1683 DocumentCreated, 1684 DocumentOpened, 1685 DocumentPropertyChanged, 1687 DocumentSaved, 1686 HMIObjectAdded, 1688 HMIObjectMoved, 1689 HMIObjectPropertyChanged, 1690 HMIObjectResized, 1691 LibraryFolderRenamed, 1692 LibraryObjectAdded, 1694 LibraryObjectRenamed, 1693 MenuItemClicked, 1695 NewLibraryFolder, 1696 NewLibraryObject, 1697 Opened, 1698 Saved, 1699 see reference:Events, 1664 SelectionChanged, 1699 Started, 1700 ToolbarItemClicked, 1701 VBA Event Handling, 1664 ViewCreated, 1702 WindowStateChange, 1704 Example for VBS, 734 Example in WinCC:Configuring a diagnostics output via Trace, 738 Example in WinCC:Configuring a language change, 736 Example in WinCC:Configuring a picture change globally, 737 Example in WinCC:Configuring a picture change via Property, 738 Example in WinCC:Defining the color of objects, 736 Examples, 734
2498
Index
Examples in WinCC, 735, 736, 737, 738, 739, 741, 743, 746 VBS in WinCC, 734 Writing object properties, 743 Examples in WinCC:Accessing objects in Graphics Designer, 735 Examples in WinCC:Deactivate Runtime, 737 Examples in WinCC:Read tag values, 741 Examples in WinCC:Start an Action on the Server (Logging Object), 746 Executing, 1566 VBA Macros, 1566 exit, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ExitWinCC, 1465 exp, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Export, 647 External application, 1658 Access with VBA, 1658 Accessing MS Excel with VBA, 1659 log on, 1658
F
fabs, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 FaceplateObject object, 1865 FaceplateType property, 2104 fclose, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973,
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Features, 802 LockStatus, 2201 LockText, 2202 LockTextColor, 2203 LongStrokesBold, 2203 LongStrokesOnly, 2204 LongStrokesSize, 2205 LongStrokesTextEach, 2205 Marker, 2207 Max, 2207 MaximizeButton, 2208 MaxZoom, 2208 MCGUBackColorOff, 2209 MCGUBackColorOn, 2210 MCGUBackFlash, 2211 MCGUTextColorOff, 2211 MCGUTextColorOn, 2212 MCGUTextFlash, 2213 MCKOBackColorOff, 2213 MCKOBackColorOn, 2214 MCKOBackFlash, 2215 MCKOTextColorOff, 2215 MCKOTextColorOn, 2216 MCKOTextFlash, 2217 MCKQBackColorOff, 2218 MCKQBackColorOn, 2218 MCKQBackFlash, 2219 MCKQTextColorOff, 2220 MCKQTextColorOn, 2220 MCKQTextFlash, 2221 MCText, 2222 MenuItems, 2222 MenuItemType, 2223 MessageClass, 2224 Min, 2225 MinZoom, 2226 Modified, 2227 Moveable, 2227 Name, 2228 NegativeValue, 2229 Number, 2230 ObjectName, 2232 ObjectSizeDecluttering, 2234 OffsetLeft, 2235 feof, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974,
2499
Index
975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ferror, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fflush, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fgetc, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fgetpos, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fgets, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 File, 787, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Searching, 787
File_pos, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 FillDiagnoseInTags, 1468 floor, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fmod, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Font style Setting, 784 fopen, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Forwarding, 1655 of events, 1655 fputc, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fputs, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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,
2500
Index
985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fread, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 free, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 freopen, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 frexp, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fseek, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 fsetpos, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ftell, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941,
942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Function Application, 790 Compiling, 786, 790, 799 Creating, 763, 790 Creating new function, 793 Defining, 763 Differences between actions and functions, 802 Editing, 790 Finding, 790 Functions from other sources, 801 Printing, 788 Protection against read and write access, 798 Renaming, 800 Saving, 799 Structuring, 763 Use of DLLs, 774 Using internal functions, 795 Function code, 794 Writing, 794 Function Trend Control, 267
2501
Index
Functions, 2435 CloseSingleAlarm (VBA), 2481 CloseTag (VBA), 2429 CloseTlgArchive (VBA), 2442 CloseTlgTag (VBA), 2443 CommitSingleAlarm (VBA), 2482 CommitTag (VBA), 2430 CommitTlgArchive (VBA), 2445 CommitTlgTag (VBA), 2446 CreateSingleAlarm (VBA), 2483 CreateTag (VBA), 2432 CreateText (VBA), 2467 CreateTextLanguage (VBA), 2466 CreateTlgArchive (VBA), 2448 CreateTlgTag (VBA), 2451 DeleteSingleAlarm (VBA), 2487 DeleteTag (VBA), 2434 DeleteText (VBA), 2468 DeleteTlgArchive (VBA), 2455 DeleteTlgTag (VBA), 2457 GetSingleAlarm (VBA), 2488 GetTag (VBA), 2435 GetText (VBA), 2471 GetTextID (VBA), 2473 GetTlgArchive (VBA), 2458 GetTlgTag (VBA), 2459 ListSingleAlarm (VBA), 2489 ListTag (VBA), 2436 ListText (VBA), 2475 ListTlgArchive (VBA), 2461 ListTlgTag (VBA), 2463 ModifyText (VBA), 2476 FunctionTrendControl, 241 fwrite, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
G
Gauge Control, 243 GCreateMyOperationMsg, 838 GCS-Runtime, 87 GCS-Runtime:Attribute, 89 General Examples, 755, 756, 758, 760 General examples:Configuring a database connection with VBS, 756
General examples:Retrieve MS automation interfaces, 758 General examples:Starting external application, 760 Get_Focus, 1039 GetActualPointLeft, 1048 GetActualPointTop, 1048 GetAdaptBorder, 1105 GetAdaptPicture, 1106 GetAdaptSize, 1107 GetAlarmHigh, 1073 GetAlarmLow, 1074 GetAlignment, 1004 GetAlignmentLeft, 1040 GetAlignmentTop, 1041 GetAssignments, 1062 GetAssumeOnExit, 1063 GetAssumeOnFull, 1064 GetAverage, 1108 GetAxisSection, 1005 GetBackBorderWidth, 1160 GetBackColor, 1013 GetBackColor2, 1013 GetBackColor3, 1014 GetBackColorBottom, 1015 GetBackColorTop, 1015 GetBackFlashColorOff, 1031 GetBackFlashColorOn, 1031 GetBasePicReferenced, 1152 GetBasePicTransColor, 1153 GetBasePicture, 1154 GetBasePicUseTransColor, 1154 GetBitNumber, 1064 GetBorderBackColor, 1016 GetBorderColor, 1017 GetBorderColorBottom, 1017 GetBorderColorTop, 1018 GetBorderEndStyle, 1160 GetBorderFlashColorOff, 1032 GetBorderFlashColorOn, 1033 GetBorderStyle, 1161 GetBorderWidth, 1162 GetBoxAlignment, 1162 GetBoxCount, 1049 GetBoxType, 1108 GetButtonColor, 1019 GetCaption, 1109 GetCheckAlarmHigh, 1074 GetCheckAlarmLow, 1075 GetCheckLimitHigh4, 1076 GetCheckLimitHigh5, 1077 GetCheckLimitLow4, 1077 GetCheckLimitLow5, 1078
2502
Index
GetCheckToleranceHigh, 1079 GetCheckToleranceLow, 1080 GetCheckWarningHigh, 1081 GetCheckWarningLow, 1081 GetClearOnError, 1065 GetClearOnNew, 1066 GetCloseButton, 1110 GetColorAlarmHigh, 1082 GetColorAlarmLow, 1083 GetColorBottom, 1019 GetColorChangeType, 1111 GetColorLimitHigh4, 1083 GetColorLimitHigh5, 1084 GetColorLimitLow4, 1085 GetColorLimitLow5, 1085 GetColorToleranceHigh, 1086 GetColorToleranceLow, 1087 GetColorTop, 1020 GetColorWarningHigh, 1087 GetColorWarningLow, 1088 GetColumn, 648 GetColumnCollection, 649 GetCursorControl, 1111 GetCursorMode, 1112 GetDataFormat, 1067 GetDirection, 1049 GetEditAtOnce, 1113 GetEndAngle, 1050 getenv, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 GetExponent, 1006 GetExtendedOperation, 1114 GetFillColor, 1021 GetFilling, 1029 GetFillingIndex, 1030 GetFillStyle, 1163 GetFillStyle2, 1164 GetFlashBackColor, 1033 GetFlashBorderColor, 1034 GetFlashFlashPicture, 1155 GetFlashForeColor, 1035 GetFlashPicReferenced, 1155 GetFlashPicTransColor, 1156 GetFlashPicture, 1157 GetFlashPicUseTransColor, 1157 GetFlashRateBackColor, 1036
GetFlashRateBorderColor, 1036 GetFlashRateFlashPic, 1158 GetFlashRateForeColor, 1037 GetFontBold, 1041 GetFontItalic, 1042 GetFontName, 1043 GetFontSize, 1044 GetFontUnderline, 1044 GetForeColor, 1022 GetForeFlashColorOff, 1038 GetForeFlashColorOn, 1038 GetGrid, 1051 GetGridColor, 1022 GetGridHeight, 1051 GetGridWidth, 1052 GetHeight, 1053 GetHiddenInput, 1067 GetHitlistColumn, 650 GetHitlisteColumnCollection, 651 GetHotkey, 1115 GetHWDiag, 850 GetHWDiagLevel, 852 GetHysteresis, 1115 GetHysteresisRange, 1116 GetIndex, 1159 GetInputValueChar, 1068 GetInputValueDouble, 1069 GetItemBorderBackColor, 1023 GetItemBorderColor, 1024 GetItemBorderStyle, 1165 GetItemBorderWidth, 1165 GetKopFupAwl, 853 GetKopFupAwlLevel, 854 GetLanguage, 1466 GetLanguageSwitch, 1116 GetLastChange, 1117 GetLayer, 1047 GetLeft, 1053 GetLeftComma, 1006 GetLimitHigh4, 1089 GetLimitHigh5, 1089 GetLimitLow4, 1090 GetLimitLow5, 1091 GetLimitMax, 1091 GetLimitMin, 1092 GetLink, 1104 GetLinkedVariable, 842 GetListType, 1069 GetLocalPicture, 842 GetLongStrokesBold, 1007 GetLongStrokesOnly, 1008 GetLongStrokesSize, 1008
2503
Index
GetLongStrokesTextEach, 1009 GetMarker, 1093 GetMax, 1118 GetMaximizeButton, 1118 GetMessageBlock, 652 GetMessageBlockCollection, 653 GetMessageColumn, 654 GetMessageColumnCollection, 655 GetMin, 1119 GetMoveable, 1120 GetNumberLines, 1070 GetOffsetLeft, 1121 GetOffsetTop, 1121 GetOnTop, 1122 GetOperation, 1122 GetOperationMessage, 1123 GetOperationReport, 1124 GetOperatorMessage, 656 GetOperatorMessageCollection, 657 GetOrientation, 1045 GetOutputFormat, 1071 GetOutputValueChar, 1071 GetOutputValueDouble, 1072 GetParentPicture, 844 GetParentPictureWindow, 844 GetPasswordLevel, 1125 GetPicDeactReferenced, 1137 GetPicDeactTransparent, 1138 GetPicDeactUseTransColor, 1139 GetPicDownReferenced, 1140 GetPicDownTransparent, 1140 GetPicDownUseTransColor, 1141 GetPicReferenced, 1142 GetPicTransColor, 1143 GetPictureDeactivated, 1143 GetPictureDown, 1144 GetPictureName, 1126 GetPictureUp, 1145 GetPicUpReferenced, 1146 GetPicUpTransparent, 1146 GetPicUpUseTransColor, 1147 GetPicUseTransColor, 1148 GetPointCount, 1054 GetPosition, 1135 GetPressed, 1166 GetProcess, 1127 GetPropBOOL, 1149 GetPropChar, 1150 GetPropDouble, 1150 GetPropWord, 1151 GetRadius, 1054 GetRadiusHeight, 1055
GetRadiusWidth, 1056 GetRangeMax, 1136 GetRangeMin, 1136 GetReferenceRotationLeft, 1056 GetReferenceRotationTop, 1057 GetRightComma, 1010 GetRotationAngle, 1058 GetRoundCornerHeight, 1058 GetRoundCornerWidth, 1059 GetRulerBlock, 658 GetRulerBlockCollection, 659 GetRulerColumn, 660 GetRulerColumnCollection, 661 GetRulerData, 662 GetScaleColor, 1024 GetScaleTicks, 1010 GetScaling, 1011 GetScalingType, 1012 GetScrollBars, 1127 GetSelBGColor, 1025 GetSelTextColor, 1026 GetServerName, 1128 GetServerTagPrefix, 1469 GetSizeable, 1129 GetSmallChange, 1129 GetStartAngle, 1060 GetStatisticAreaColumn, 662 GetStatisticAreaColumnCollection, 663 GetStatisticResultColumn, 664 GetStatisticResultColumnCollection, 665 GetStatusbarElement, 666 GetStatusbarElementCollection, 667 GetTagBit, 1409 GetTagBitState, 1369 GetTagBitStateQC, 1389 GetTagBitStateQCWait, 1377 GetTagBitStateWait, 1359 GetTagBitWait, 1400 GetTagByte, 1410 GetTagByteState, 1370 GetTagByteStateQC, 1390 GetTagByteStateQCWait, 1378 GetTagByteStateWait, 1360 GetTagByteWait, 1401 GetTagChar, 1410 GetTagCharState, 1370 GetTagCharStateQC, 1391 GetTagCharStateQCWait, 1379 GetTagCharStateWait, 1361 GetTagCharWait, 1401 GetTagDouble, 1411 GetTagDoubleState, 1371
2504
Index
GetTagDoubleStateQC, 1392 GetTagDoubleStateQCWait, 1380 GetTagDoubleStateWait, 1362 GetTagDoubleWait, 1402 GetTagDWord, 1411 GetTagDWordState, 1372 GetTagDWordStateQC, 1393 GetTagDWordStateQCWait, 1381 GetTagDWordStateWait, 1362 GetTagDWordWait, 1403 GetTagFloat, 1412 GetTagFloatState, 1373 GetTagFloatStateQC, 1394 GetTagFloatStateQCWait, 1382 GetTagFloatStateWait, 1363 GetTagFloatWait, 1403 GetTagMultiStateQCWait, 1383 GetTagMultiStateWait, 1364 GetTagMultiWait, 1404 GetTagPrefix, 1130 GetTagRaw, 1413 GetTagRawState, 1373 GetTagRawStateQC, 1395 GetTagRawStateQCWait, 1384 GetTagRawStateWait, 1365 GetTagRawWait, 1405 GetTagSByte, 1414 GetTagSByteState, 1374 GetTagSByteStateQC, 1396 GetTagSByteStateQCWait, 1385 GetTagSByteStateWait, 1366 GetTagSByteWait, 1406 GetTagSDWord, 1414 GetTagSDWordState, 1375 GetTagSDWordStateQC, 1397 GetTagSDWordStateQCWait, 1386 GetTagSDWordStateWait, 1367 GetTagSDWordWait, 1406 GetTagSWord, 1415 GetTagSWordState, 1376 GetTagSWordStateQC, 1397 GetTagSWordStateQCWait, 1387 GetTagSWordStateWait, 1367 GetTagSWordWait, 1407 GetTagValue, 1415 GetTagValueStateQC, 1398 GetTagValueStateQCWait, 1387 GetTagValueWait, 1408 GetTagWord, 1416 GetTagWordState, 1377 GetTagWordStateQC, 1399 GetTagWordStateQCWait, 1388
GetTagWordStateWait, 1368 GetTagWordWait, 1409 GetText, 1046 GetTimeAxis, 668 GetTimeAxisCollection, 669 GetTimeColumn, 670 GetTimeColumnCollection, 671 GetToggle, 1167 GetToleranceHigh, 1093 GetToleranceLow, 1094 GetToolbarButton, 672 GetToolbarButtonCollection, 673 GetTop, 1060 GetTrend, 674, 1131 GetTrendCollection, 675 GetTrendColor, 1026 GetTrendWindow, 676 GetTrendWindowCollection, 677 GetTypeAlarmHigh, 1095 GetTypeAlarmLow, 1095 GetTypeLimitHigh4, 1096 GetTypeLimitHigh5, 1097 GetTypeLimitLow4, 1098 GetTypeLimitLow5, 1099 GetTypeToleranceHigh, 1099 GetTypeToleranceLow, 1100 GetTypeWarningHigh, 1101 GetTypeWarningLow, 1102 GetUnselBGColor, 1027 GetUnselTextColor, 1028 GetUpdateCycle, 1131 GetValueAxis, 678 GetValueAxisCollection, 679 GetValueColumn, 680 GetValueColumnCollection, 681 GetVisible, 1132 GetWarningHigh, 1102 GetWarningLow, 1103 GetWidth, 1061 GetWindowBorder, 1133 GetWindowsStyle, 1167 GetXAxis, 682 GetXAxisCollection, 683 GetYAxis, 684 GetYAxisCollection, 685 GetZeroPoint, 1062 GetZeroPointValue, 1134 GetZoom, 1134 Global action, 770 Application, 770 Characteristics, 770
2505
Index
Global C tags, 772 Application, 772 Definition, 772 Global script Definition of global C tags, 772 Use of global C tags, 772 Validity range, 772
Global Script, 775 Action icon, 802 Action structure, 763 Adding action-related information, 807 Adding function-related Information, 797 Assigning authorization, 820 Authorizations, 820 Cause for non-execution of an action, 802 Changing trigger, 817 Characteristics of global actions, 770 Characteristics of internal functions, 768 Characteristics of local actions, 769 Characteristics of project functions, 766 Characteristics of standard functions, 767 Color code, 778 Compiling action, 802, 810 Compiling function, 786, 790, 799 Computer properties, 771 Creating action, 763, 802 Creating function, 763 Creating internal function, 793 Creating new actions, 806 Creating new function, 793 Defining action, 763 Defining function, 763 Deleting action, 785 Deleting project functions, 785 Deleting standard functions, 785 Deleting trigger, 818 Design tool, 763 Differences between actions and functions, 802 Editing action, 802, 807, 829 Editing function, 790 Editing functions with the keyboard, 780 Editing functions with the mouse, 780 Effect of triggers on actions, 811 Exporting action, 821 Features, 802 Finding actions, 802 Finding functions, 790 Function structure, 763 Generating new header, 786 GSC Diagnose toolbar, GSC Runtime, 825 GSC Runtime attributes, 829 Identification of actions in the navigation window, 811 Import action, 821 Including Global Script Runtime in the startup list of the project , 771 Including GSC Runtime in a process picture, 828 Inserting GSC Diagnose in a process picture, 831 New trigger of type Trigger:new trigger of type
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2506
Index
Global Script:Adding trigger, 814 New trigger of type Trigger:New trigger of type TagGlobalScript:Adding trigger , 815 Opening, 821 Opening page view, 789 Password input, 798, 809 Printing action, 788 Printing function, 788 Printing project documentation, 789 Properties, 797, 798, 807, 809, 817, 818 Protecting function against read and write access, 798 Protection against read and write access, 809 Renaming action, 802, 822 Renaming function, 800 Runtime behavior of actions, 824 Saving action, 810 Saving file as, 821 Saving function, 799 Searching files, 787 Setting different views, 784 Setting print parameters, 788 Setting the font style, 784 Structure of Global Script editor, 775 System behavior, 802 Trigger type, 763 Use of DLLs in actions, 774 Use of DLLs in functions, 774 Use of global actions, 770 Use of Internal Functions, 768 Use of local actions, 769 Use of project functions, 766 Use of standard functions, 767 Using "Save As...", 784 Using actions from other sources, 823 Using functions, 790 Using Functions from other sources, 801 Using internal functions, 795 Using project functions, 796 Using standard functions, 796 WinCC coding rules, 805 Working in the edit window, 778 Working with toolbars, 781 Writing function code, 794 Global Script editor, 30, 775 Structure, 775 Global Script Runtime, 771 Adding to startup list of the project, 771 Global Script:Deleting Actions and Procedures, 38 Global Script:Toolbars, 36 Global Script:Working in the Editing Window, 32 Global Tag, 27
Global tag:Use in VBS, 27 GMsgFunction, 840 gmtime, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Graphic object, 152 Graphic Object:Properties, 152 Graphic Object:Types in VBS, 152 Graphic object:WinCC Gauge Control, 243 Graphics Designer, 1569 @GLOBAL.PDT, 1562 @PROJECT.PDT, 1562 Access to objects, 1606 Access to the component library with VBA, 1593 Access to the symbol library with VBA, 1593 Adapting with VBA, 1567, 1569 Add menu entry to user-defined menu, 1577 Adding a New Icon to the used-defined Toolbar, 1584 Application-specific menu, 1573 Application-specific toolbar, 1573 Assigning VBA macro to user-defined menu, 1589 Assigning VBA macro to user-defined toolbar, 1589 Configure user-defined menu, 1572 Configure user-defined toolbar, 1572 Create an application-specific menu, 1575 Create toolbar, 1582 Creating Menus in Multiple Languages, 1580 Editing objects with VBA, 1606 Editing Objects with VBA, 1606 Executing VBA macros, 1566 Exporting VBA code, 1565 Importing VBA code, 1565 Object model, 1664 Organizing the VBA code, 1562 Paste Object from the component library into a picture with VBA, 1599 Paste Object from the symbol library into a picture with VBA, 1599 picture-specific menu, 1573 picture-specific toolbar, 1573 Template file, 1562 User-defined menu, 1573 User-defined toolbar, 1573
2507
Index
Group Objects, 1618 Access to object properties, 1618 Adding an object with VBA, 1620 basics, 1618 Creating with VBA, 1620 Deleting with VBA, 1620 Editing existing objects, 1623 Editing with VBA, 1618, 1620 Removing an object with VBA, 1620 Ungrouping with VBA, 1620 Grouping, 1618 Access to object properties, 1618 Adding an object with VBA, 1620 basics, 1618 Creating with VBA, 1620 Deleting with VBA, 1620 Editing existing objects, 1623 Editing with VBA, 1618, 1620 Removing an object with VBA, 1620 Ungrouping with VBA, 1620 GSC Diagnose Including in process picture, 831 Toolbar, GSC Diagnostics, 86 GSC Diagnostics Attributes, 86 GSC Diagnostics: inserting into a Picture, 88 GSC Diagnostics:Attributes, 86 GSC Diagnostics:Toolbar, 86 GSC Runtime Attributes, 829 Including in process picture, 828 GSC Runtime:Inserting into a Picture, 88
H
Header, 786 Regenerating, 786 HideAlarm, 686 Highlight Syntax, 45, 61 HMIGO class, 2424 Error Handling, 2424 Usage, 2424 HMIObjects, 1664 see HMIObjects , 1664 see lists, 1664 HMIRuntime Object, 125
I
Information, 49, 64 Adding action-related information, 807
Information:add to action, 64 Information:add to module, 49 Information:add to procedure, 49 Insert:GSC Diagnostics, 85 Insert:GSC Runtime, 88 Intellisense, 45, 61 Internal function, 768 Application, 768 Characteristics, 768 isahum, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 isalpha, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 isdigit, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 isgraph, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 islower, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 isprint, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951,
2508
Index
952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ispunct, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 isspace, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 isupper, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 isxdigit, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Item Object, 126
L
labs, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Language, 406
Layer, 1603 Controlling the visibility with VBA, 1603 CS, 1603 Editing with VBA, 1603 RT, 1603 Layer Object, 127 Layers Object (Listing), 129 ldexp, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ldiv, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ListBox object, 1900 Lists Actions, 1810 AnalogResultInfo, 1813 Application, 1814 DataLanguages, 1842 Documents, 1850 Events, 1863 FolderItems, 1868 GroupedObjects, 1877 HMIDefaultObjects, 1878 HMIObjects, 1884 LanguageFonts, 1890 LanguageTexts, 1893 Layers, 1895 MenuItems, 1909 Menus, 1904 Overview, 1664 Properties, 1931 QualityCodeStateValues, 1936 Selection, 1949 SymbolLibraries, 1963 ToolbarItems, 1973 Toolbars, 1968 VariableStateValues, 1987 VariableTriggers, 1990 Views, 1993
2509
Index
Lists in VBS Alarms object (list), 116 DataSet Object (List), 122 Layers Object (Listing), 129 ProcessValues Object (Lists), 132 ScreenItems object (list), 138 Screens Object (Lists), 143 Tags Object (List), 149 TagSet Object (List), 151 Local actions, 769 Application, 769 Characteristics, 769 localtime, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 LockAlarm, 688 log, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 log10, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Logging Object, 130 Logical errors, 93 LoopInAlarm, 688 lpszPictureName, 835
M
malloc, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
math, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 MediaControl, 246 memchr, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 memcmp, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 memcpy, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 memmove, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 memory, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 memset, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951,
2510
Index
952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Menu, 1573, 1601 Add menu entry, 1577 application-specific, 1573 Assigning help text, 1586 Assigning status text, 1586 Assigning VBA macro, 1589 Configuring, 1572 Creating, 1575 creating multiple languages, 1580 picture-specific, 1573, 1601 Placement, 1573 Properties, 1573 User-defined, 1573 Menu bar, 775 Menus and toolbars VBScript, 14 Methods, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 688, 689, 690, 691, 692, 693, 694, 695,
696, 697, 702, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 725, 729, 730, 731, 732, 1664 Activate, 1704 Add, 1705 Add (AnalogResultInfos Listing), 1706 Add (CustomToolbars Listing), 1708 Add (Documents Listing), 1709 Add (GroupedObjects), 1710 Add (TagTriggers Listing), 1712 Add (Views Listing), 1713 AddAction, 1713 AddActiveXControl, 1714 AddFolder, 1716 AddFromClipboard, 1717 AddHMIObject, 1719 AddItem, 1720 AddOLEObject, 1722 AlignBottom, 1724 AlignLeft, 1725 AlignRight, 1726 AlignTop, 1727 ArrangeMinimizedWindows, 1728 BackwardOneLevel, 1729 BringToFront, 1730 CascadeWindows, 1731 CenterHorizontally, 1732 CenterVertically, 1733 CheckSyntax, 1734 Close, 1735 CloseAll, 1736 ConvertToScript, 1737 CopySelection, 1738 CopyToClipboard, 1740 CreateCustomizedObject, 1741 CreateDynamic, 1742 CreateGroup, 1743 Delete, 1745 DeleteAll, 1746 DeleteDynamic, 1747 Destroy, 1749 DuplicateSelection, 1750 EvenlySpaceHorizontally, 1751 EvenlySpaceVertically, 1752 Export, 1754 Find, 1755 FindByDisplayName, 1756 FlipHorizontally, 1757 FlipVertically, 1758 ForwardOneLevel, 1759 GetDeclutterObjectSize, 1744 GetItemByPath, 1760 InsertFromMenuItem, 1762 InsertMenu, 1763 InsertMenuItem, 1765 InsertSeparator, 1766 InsertSubmenu, 1767 2511 InsertToolbarItem, 1769 IsCSLayerVisible, 1770 IsRTLayerVisible, 1771 Item, 687, 1772 ItemByLcid, 1774
Index
Methods in VBS ActivateDynamic, 640 Create, 644 DeactivateDynamic, 646 Methods:Activate, 639 Methods:Add, 641 Methods:Read, 698 Methods:Refresh, 702 Methods:Remove, 703 Methods:RemoveAll, 707 Methods:Restore, 708 Methods:Stop, 723 Methods:Trace, 724 Methods:Write, 725 Microsoft Script Debugger, 90, 95 mktime, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 modf, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Module, 39, 42 Dialog "Info", 51 Editing, 39 Memory, 52 Name, 39 Protecting with a Password, 51 Module:Add Information, 49 Module:Create, 42 Module:Dialog "Info", 49 Module:Renaming, 54 MoveAxis, 689 MoveToFirst, 689 MoveToFirstLine, 689 MoveToFirstPage, 690 MoveToLast, 690 MoveToLastLine, 691 MoveToLastPage, 691 MoveToNext, 691 MoveToNextLine, 692 MoveToNextPage, 692 MoveToPrevious, 693
N
Names, 99 Names:of actions in VBScript Files, 99 Navigation window Identification of actions in the navigation window, 811 New, 42, 59 New:Action, 59 New:Procedure, 42 NextColumn, 694 NextTrend, 694
O
Object model, 1664 Lists, 113 Methods, 638 Objects, 113 Object model:Properties, 276 Object names, 99 Object Types Controls, 230 Customized object, 273 Object Types:Group, 274
2512
Index
Objects, 1664 3DBarGraph, 1805 ActiveXControl, 1811 AnalogResultInfo, 1812 ApplicationWindow, 1817 BarGraph, 1819 BinaryResultInfo, 1822 BitResultInfo, 1823 Button, 1824 CheckBox, 1827 Circle, 1828 CircularArc, 1831 ConnectorPoints (Listing), 1837 CustomizedObject, 1839 DataLanguage, 1841 DestLink, 1843 DirectConnection, 1845 Document, 1847 DynamicDialog, 1851 Ellipse, 1853 EllipseArc, 1856 EllipseSegment, 1859 Event, 1862 FolderItem , 1867 GraphicObject, 1870 Group, 1873 GroupDisplay, 1874 HMIObject, 1882 IOField, 1886 LanguageFont, 1889 LanguageText , 1892 Layer, 1894 Line, 1897 Menu, 1903 MenuItem , 1906 objConnection, 1912 OLEObject, 1914 OptionGroup, 1916 Overview, 1664 PictureWindow, 1919 PieSegment, 1922 Polygon, 1925 PolyLine, 1928 Property, 1932 QualityCodeStateValue, 1934 Rectangle, 1939 RoundButton, 1942 RoundRectangle, 1945 ScriptInfo, 1948 Slider, 1952 SourceLink, 1955 StaticText, 1956 StatusDisplay, 1959 SymbolLibrary, 1962 TextList, 1964 MDM - WinCC: Scripting (VBS, ANSI-C, VBA) Toolbar, 1967 System Manual, 11/2008, ToolbarItem , 1970 Trigger, 1974 VariableStateValue, 1986 VariableTrigger , 1989 View, 1991
Objects in VBA ComboBox , 1834 FaceplateObject, 1865 ListBox, 1900 MultiLineEdit, 1910 TubeArcObject, 1976 TubeDoubleTeeObject, 1979 TubePolyline, 1981 TubeTeeObject, 1984 Objects in VBS Alarm object, 115 AlarmLogs Object, 118 DataItem Object, 119 DataLogs Object, 121 HMIRuntime Object, 125 Item Object, 126 Layer Object, 127 Logging Object, 130 ProcessValue Object, 131 Project Object, 133 Screen Object, 140 ScreenItem Object, 134 Smart tags, 145 Tag Object, 146 ObjekteVBA-Referenz ObjekteundAuflistungen , 1664 Objektnames:define in Runtime, 99 OnDeactivateExecute, 855 OnErrorExecute, 856 OneToOneView, 695 Online Trend Control, 271 OnlineTableControl, 247 OnlineTrendControl, 250 OnTime, 857 OpenHomePicture, 1352 Opening, 821 OpenNextPicture, 1352 OpenPicture, 845 OpenPrevPicture, 1353 OpenStoredPicture, 1353 Output, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Output window, 775
2513
Index
P
Page view Opening, 789 Password, 51, 66 assign fro action, 66 for a module, 51 for a Procedure, 51 Password input, 798, 809 Paste, 85, 88 PasteRows , 695 Picture, 1605 Editing copy with VBA, 1605 Picture-specific menu, 1602 Assigning help text, 1586 Assigning status text, 1586 Assigning VBA macro, 1589 Configuring, 1572 Creating, 1602 creating multiple languages, 1580 Picture-specific toolbar, 1602 Assigning status text, 1586 Assigning VBA macro, 1589 Configuring, 1572 Creating, 1602 pow, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 PreviousColumn, 695 PreviousTrend, 696 Print, 696 Print parameters, 788 Setting, 788 Print:VBScript, 108 procedure, 1566 Creating, 39 Dialog "Info", 51 Editing, 39 Memory, 52 Name, 39 Protecting with a Password, 51 Version, 1566 Procedure:Add Information, 49 Procedure:Change, 45 Procedure:Delete, 38 Procedure:Dialog "Info", 49
Procedure:New creation, 42 Procedure:Project Procedure, 47 Procedure:Rename, 54 Procedure:Standard procedure, 47 Procedure:Storage location in WinCC, 23 Procedure:use multiple times, 23 Procedure:Write Code, 45 ProcessValue Object, 131 ProcessValues Object (List), 132 ProgramExecute, 858 Project documentation Printing, 789 Project function, 766 Application, 766 Applying, 796 Characteristics, 766 Deleting, 785 Project language, 1570 Access with VBA, 1570 Project Object, 133 Project Procedure:Use, 47
2514
Index
Properties, 797, 798, 807, 809, 817, 818 Actions, 1995 ActiveDocument, 1996 ActiveLayer, 1996 ActualPointLeft, 1997 ActualPointTop, 1998 AdaptBorder, 1999 AdaptPicture, 2000 AdaptSize, 2001 AlarmHigh, 2002 AlarmLow, 2002 Alignment, 2003 AlignmentLeft, 2004 AlignmentTop, 2005 AnalogResultInfos, 2006 AngleAlpha, 2006 AngleBeta, 2007 Application, 2008 ApplicationDataPath, 2008 Assignments, 2009 AssumeOnExit, 2010 AssumeOnFull, 2010 AutomationName, 2011 AvailableDataLanguages, 2013 Average, 2014 Axe, 2014 AxisSection, 2015 BackBorderWidth, 2016 BackColor, 2017 BackColor2, 2018 BackColor3, 2019 BackColorBottom, 2020 BackColorTop, 2020 BackFlashColorOff, 2021 BackFlashColorOn, 2022 Background, 2023 BackPictureAlignment, 2024 BackPictureName, 2025 BarDepth, 2025 BarHeight, 2026 BarWidth, 2026 BasePicReferenced, 2027 BasePicTransColor, 2027 BasePicture, 2028 BasePicUseTransColor, 2029 BaseX, 2030 BaseY, 2030 BinaryResultInfo, 2031 BitNotSetValue, 2031 BitNumber, 2032 BitResultInfo, 2033 BitSetValue, 2033 Bold, 2034 BorderBackColor, 2035 BorderColor, 2036 MDM - WinCC: Scripting (VBS, ANSI-C, VBA) BorderColorBottom, 2038 System Manual, 11/2008, BorderColorTop, 2038 BorderEndStyle, 2039 BorderFlashColorOff, 2040 BorderFlashColorOn, 2042 BorderStyle, 2043
Properties in VBA CommonVBSEventArea, 2078 CommonVBSPropertyArea, 2079 FaceplateType, 2104 TagScaleParam1, 2306 TagScaleParam2, 2306 TagScaleParam3, 2306 TagScaleParam4, 2306 Properties in VBS, 276 AlarmID, 282 BackStyle, 299 Comment, 344 ComputerName, 345 Context, 345 FillStyle, 369 FillStyleAlignment, 371 GlobalColorScheme, 386 HiddenInput, 285, 286, 392, 430, 459, 484, 514, 606, 635 HitlistMaxSourceItems, 395 HitlistMaxSourceItemsWarn, 395 HitlistRelTimeFactor, 396 HitlistRelTimeFactorType, 396 IndependentWindow, 399 Index, 400 InputValue, 402 Instance, 402 ItemProviderClsid, 404 LineJoinStyle, 427 NumberLines, 454 ProcessValue, 485 RotationAngle, 493 SavedTrend, 498 Selected Trend, 505 SelIndex, 508 SelText, 508 Smart tag, 517 SortOrder, 517 State, 524 TableFocusOnButtonCommand, 530 Transparency, 577 UserName, 606 WinCCStyle, 627 WindowMonitorNumber, 628 WindowPositionMode, 628 WindowsStyle, 628 Properties in VBS/ScrollPositionX, 502 Properties in VBS/ScrollPositionY, 502 Properties in VBS: DesiredCurveSourceUAColumnY, 357 Properties in VBS:AccessPath, 276 Properties in VBS:Activate, 277
2515
Index
Properties in VBS:ActiveProject, 278 Properties in VBS:ActiveScreen, 278 Properties in VBS:ActiveScreenItem, 279 Properties in VBS:Actualize, 279 Properties in VBS:ActualPointLeft, 280 Properties in VBS:ActualPointTop, 280 Properties in VBS:AdaptBorder, 280 Properties in VBS:AdaptPicture, 281 Properties in VBS:AdaptSize, 281 Properties in VBS:AdjustRuler, 282 Properties in VBS:AlarmHigh, 282 Properties in VBS:AlarmLogs, 283 Properties in VBS:AlarmLow, 283 Properties in VBS:Alignment, 283 Properties in VBS:AlignmentLeft, 283 Properties in VBS:AlignmentTop, 284 Properties in VBS:AllowPersistence, 285 Properties in VBS:AllServer, 285 Properties in VBS:Analog, 286 Properties in VBS:AngleAlpha, 286 Properties in VBS:AngleBeta, 286 Properties in VBS:AngleMax, 287 Properties in VBS:AngleMin, 287 Properties in VBS:Application, 287 Properties in VBS:Archive, 288 Properties in VBS:Assignments, 289 Properties in VBS:AssumeOnExit, 289 Properties in VBS:AssumeOnFull, 289 Properties in VBS:AutoRange, 291 Properties in VBS:AutoRangeX, 291 Properties in VBS:AutoRangeY, 291 Properties in VBS:AutoScroll, 291 Properties in VBS:AutoSize, 293 Properties in VBS:Average, 294 Properties in VBS:Axe, 294 Properties in VBS:Axis, 537 Properties in VBS:AxisSection, 294 Properties in VBS:BackBorderWidth, 295 Properties in VBS:BackColor, 295 Properties in VBS:BackColor2, 296 Properties in VBS:BackColor3, 296 Properties in VBS:BackColorBottom, 297 Properties in VBS:BackColorTop, 297 Properties in VBS:BackFlashColorOff, 297 Properties in VBS:BackFlashColorOn, 297 Properties in VBS:Background, 298 Properties in VBS:Background Picture, 298 Properties in VBS:BackPictureAlignment, 298 Properties in VBS:BackPictureName, 298 Properties in VBS:BarBackColor, 300 Properties in VBS:BarDepth, 300 Properties in VBS:BarFillColor, 300
Properties in VBS:BarHeight, 300 Properties in VBS:BarWidth, 301 Properties in VBS:BasePicReferenced, 301 Properties in VBS:BasePicTransColor, 301 Properties in VBS:BasePicture, 302 Properties in VBS:BasePicUseTransColor, 302 Properties in VBS:BaseScreenName, 302 Properties in VBS:BaseX, 303 Properties in VBS:BaseY, 303 Properties in VBS:BeginTime, 304 Properties in VBS:BeginValue, 304 Properties in VBS:BeginWidth, 307 Properties in VBS:BeginX, 304 Properties in VBS:BeginY, 305 Properties in VBS:BevelColorDown, 305 Properties in VBS:BevelColorUp, 305 Properties in VBS:Bevellnner, 306 Properties in VBS:BevelOuter, 306 Properties in VBS:BitNumber, 307 Properties in VBS:BlinkColor, 307 Properties in VBS:BlinkMode, 307 Properties in VBS:BlinkSpeed, 308 Properties in VBS:BorderBackColor, 312 Properties in VBS:BorderColor, 313 Properties in VBS:BorderColorBottom, 313 Properties in VBS:BorderColorTop, 313 Properties in VBS:BorderEndStyle, 314 Properties in VBS:BorderFlashColorOff, 314 Properties in VBS:BorderFlashColorOn, 314 Properties in VBS:BorderStyle, 314 Properties in VBS:BorderWidth, 315 Properties in VBS:BottomConnectedConnectionPointIndex, 315 Properties in VBS:BottomConnectedObjectName, 316 Properties in VBS:BoxAlignment, 316 Properties in VBS:BoxCount, 316 Properties in VBS:BoxType, 317 Properties in VBS:Button1Width, 318 Properties in VBS:Button2Width, 319 Properties in VBS:Button3Width, 319 Properties in VBS:Button4Width, 319 Properties in VBS:ButtonColor, 317 Properties in VBS:ButtonCommand, 317 Properties in VBS:Caption, 320 Properties in VBS:CaptionColor, 320 Properties in VBS:CaptionFont, 321 Properties in VBS:CaptionOffset, 321 Properties in VBS:CaptionText, 321 Properties in VBS:CellCut, 322 Properties in VBS:CenterColor, 323 Properties in VBS:CenterScale, 323
2516
Index
Properties in VBS:CheckAlarmHigh, 324 Properties in VBS:CheckAlarmLow, 324 Properties in VBS:CheckLimitHigh4, 324 Properties in VBS:CheckLimitHigh5, 325 Properties in VBS:CheckLimitLow4, 325 Properties in VBS:CheckLimitLow5, 325 Properties in VBS:CheckToleranceHigh, 326 Properties in VBS:CheckToleranceLow, 326 Properties in VBS:CheckWarningHigh, 326 Properties in VBS:CheckWarningLow, 327 Properties in VBS:ClearOnError, 327 Properties in VBS:ClearOnNew, 327 Properties in VBS:Closeable, 327 Properties in VBS:CloseButton, 328 Properties in VBS:CoarseGrid, 328 Properties in VBS:CoarseGridValue, 329 Properties in VBS:CoarseGridValueX, 330 Properties in VBS:CoarseGridValueY, 330 Properties in VBS:CoarseGridX, 329 Properties in VBS:CoarseGridY, 329 Properties in VBS:CollectValue, 330 Properties in VBS:ColMove, 331 Properties in VBS:Color, 331 Properties in VBS:ColorAlarmHigh, 331 Properties in VBS:ColorAlarmLow, 332 Properties in VBS:ColorBottom, 332 Properties in VBS:ColorChangeType, 332 Properties in VBS:ColorLimitHigh4, 333 Properties in VBS:ColorLimitHigh5, 333 Properties in VBS:ColorLimitLow4, 333 Properties in VBS:ColorLimitLow5, 334 Properties in VBS:ColorToleranceHigh, 334 Properties in VBS:ColorToleranceLow, 334 Properties in VBS:ColorTop, 335 Properties in VBS:ColorWarningHigh, 335 Properties in VBS:ColorWarningLow, 335 Properties in VBS:ColTitle, 336 Properties in VBS:ColWidth, 343 Properties in VBS:Command, 344 Properties in VBS:CommonTime, 344 Properties in VBS:CommonX, 345 Properties in VBS:CommonY, 345 Properties in VBS:ContinuousChange, 346 Properties in VBS:Count, 346 Properties in VBS:CurrentContext, 347 Properties in VBS:Cursor, 348 Properties in VBS:CursorControl, 348 Properties in VBS:CurveForm, 349 Properties in VBS:Danger, 350 Properties in VBS:DangerColor, 350, 353 Properties in VBS:DataFormat, 350 Properties in VBS:DataIndex, 351
Properties in VBS:DataLogs, 351 Properties in VBS:DataSet, 351 Properties in VBS:DataX, 352 Properties in VBS:DataXY, 352 Properties in VBS:DataY, 352 Properties in VBS:DeleteData, 354 Properties in VBS:Delta, 355 Properties in VBS:DesiredCurveColor, 355 Properties in VBS:DesiredCurveCurveForm, 355 Properties in VBS:DesiredCurveSourceNumberOfUAValues, 356 Properties in VBS:DesiredCurveSourceUAArchive, 356 Properties in VBS:DesiredCurveSourceUAArchiveStartID, 356 Properties in VBS:DesiredCurveSourceUAColumnX, 357 Properties in VBS:DesiredCurveVisible, 357 Properties in VBS:Direction, 357 Properties in VBS:DisplayOptions, 358 Properties in VBS:Edit, 359 Properties in VBS:Editable, 359 Properties in VBS:EditAtOnce, 360 Properties in VBS:Enabled, 360 Properties in VBS:EndAngle, 361 Properties in VBS:EndTime, 362 Properties in VBS:EndValue, 362 Properties in VBS:EndX, 363 Properties in VBS:EndY, 363 Properties in VBS:ErrorDescription, 363 Properties in VBS:Exponent, 364 Properties in VBS:ExtendedOperation, 367 Properties in VBS:ExtendedZoomingEnable, 367 Properties in VBS:FillColor, 368 Properties in VBS:Filling, 368 Properties in VBS:FillingIndex, 369 Properties in VBS:FillStyle2, 370 Properties in VBS:FineGrid, 371 Properties in VBS:FineGridValue, 371 Properties in VBS:FineGridValueX, 372 Properties in VBS:FineGridValueY, 372 Properties in VBS:FineGridX, 372 Properties in VBS:FineGridY, 373 Properties in VBS:FlashBackColor, 373 Properties in VBS:FlashBorderColor, 373 Properties in VBS:FlashFlashPicture, 373 Properties in VBS:FlashForeColor, 374 Properties in VBS:FlashPicReferenced, 374 Properties in VBS:FlashPicTransColor, 374 Properties in VBS:FlashPicture, 375 Properties in VBS:FlashPicUseTransColor, 375 Properties in VBS:FlashRate, 375
2517
Index
Properties in VBS:FlashRateBackColor, 376 Properties in VBS:FlashRateBorderColor, 376 Properties in VBS:FlashRateFlashPic, 376 Properties in VBS:FlashRateForeColor, 377 Properties in VBS:Flip, 377 Properties in VBS:FocusColor, 378 Properties in VBS:FocusRect, 378 Properties in VBS:FocusWidth, 378 Properties in VBS:Font, 379 Properties in VBS:FontBold, 380 Properties in VBS:FontItalic, 380 Properties in VBS:FontName, 381 Properties in VBS:FontPosition, 381 Properties in VBS:FontSize, 382 Properties in VBS:FontStrikeThru, 382 Properties in VBS:FontUnderline, 382 Properties in VBS:ForeColor, 383 Properties in VBS:ForeFlashColorOff, 383 Properties in VBS:ForeFlashColorOn, 384 Properties in VBS:FrameColor, 384 Properties in VBS:FrameColorDown, 385 Properties in VBS:FrameColorUp, 385 Properties in VBS:FramePicture, 385 Properties in VBS:FrameScale, 385 Properties in VBS:FrameWidth, 386 Properties in VBS:FreezeProviderConnections, 386 Properties in VBS:GraphDirection, 387 Properties in VBS:GridLineHorz, 388 Properties in VBS:Gridlines, 387, 388 Properties in VBS:GridLinesValueX, 388 Properties in VBS:GridLinesValueY, 389 Properties in VBS:GridlinesX, 389 Properties in VBS:GridLinesY, 389 Properties in VBS:GridLineValue, 390 Properties in VBS:GridLineVert, 390 Properties in VBS:HandFillColor, 390 Properties in VBS:Handtype, 391 Properties in VBS:HeaderSort, 391 Properties in VBS:Height, 391 Properties in VBS:HiddenInput, 392 Properties in VBS:Hotkey, 397 Properties in VBS:HourNeedleHeight, 398 Properties in VBS:HourNeedleWidth, 398 Properties in VBS:Hysteresis, 399 Properties in VBS:HysteresisRange, 399 Properties in VBS:InnerBevelOffset, 401 Properties in VBS:InnerBevelStyle, 401 Properties in VBS:InnerBevelWidth, 401 Properties in VBS:InsertData, 402 Properties in VBS:ItemBorderBackColor, 403 Properties in VBS:ItemBorderColor, 403 Properties in VBS:ItemBorderStyle, 403
Properties in VBS:ItemBorderWidth, 404 Properties in VBS:ItemVisible, 404 Properties in VBS:Label, 405 Properties in VBS:LabelColor, 405 Properties in VBS:LabelX, 405 Properties in VBS:LabelY, 406 Properties in VBS:Language-IDs, 406 Properties in VBS:LanguageSwitch, 406 Properties in VBS:LastError, 407 Properties in VBS:Layer, 408 Properties in VBS:Layer00Checked, 409 Properties in VBS:Layer00Color, 412 Properties in VBS:Layer00Value, 419 Properties in VBS:Layer01Checked, 409 Properties in VBS:Layer01Color, 413 Properties in VBS:Layer01Value, 419 Properties in VBS:Layer02Checked, 410 Properties in VBS:Layer02Color, 413 Properties in VBS:Layer02Value, 420 Properties in VBS:Layer03Checked, 410 Properties in VBS:Layer03Color, 413 Properties in VBS:Layer03Value, 420 Properties in VBS:Layer04Checked, 410 Properties in VBS:Layer04Color, 413 Properties in VBS:Layer04Value, 420 Properties in VBS:Layer05Checked, 410 Properties in VBS:Layer05Color, 414 Properties in VBS:Layer05Value, 420 Properties in VBS:Layer06Checked, 411 Properties in VBS:Layer06Color, 414 Properties in VBS:Layer06Value, 421 Properties in VBS:Layer07Checked, 411 Properties in VBS:Layer07Color, 414 Properties in VBS:Layer07Value, 421 Properties in VBS:Layer08Checked, 411 Properties in VBS:Layer08Color, 415 Properties in VBS:Layer08Value, 421 Properties in VBS:Layer09Checked, 412 Properties in VBS:Layer09Color, 415 Properties in VBS:Layer09Value, 422 Properties in VBS:Layer10Checked, 412 Properties in VBS:Layer10Color, 415 Properties in VBS:Layer10Value, 422 Properties in VBS:LayerDeclutteringEnable, 422 Properties in VBS:Layers, 423 Properties in VBS:Left, 423 Properties in VBS:LeftComma, 424 Properties in VBS:LightEffect, 424 Properties in VBS:LimitHigh4, 424 Properties in VBS:LimitHigh5, 425 Properties in VBS:LimitLow4, 425 Properties in VBS:LimitLow5, 425
2518
Index
Properties in VBS:LimitMax, 426 Properties in VBS:LimitMin, 426 Properties in VBS:LineFont, 426 Properties in VBS:LineHeight, 427 Properties in VBS:LineTitle, 427 Properties in VBS:LineWidth, 428 Properties in VBS:ListType, 428 Properties in VBS:LoadDataImmediately, 429 Properties in VBS:LocaleID, 429 Properties in VBS:LockBackColor, 430 Properties in VBS:LockStatus, 430 Properties in VBS:LockText, 430 Properties in VBS:LockTextColor, 431 Properties in VBS:Logging, 431 Properties in VBS:LongStrokesBold, 431 Properties in VBS:LongStrokesOnly, 432 Properties in VBS:LongStrokesSize, 432 Properties in VBS:LongStrokesTextEach, 432 Properties in VBS:LowerLimit, 433 Properties in VBS:LowerLimitColor, 434 Properties in VBS:LowerLimitValue, 434 Properties in VBS:Marker, 435 Properties in VBS:Max, 435 Properties in VBS:MaximizeButton, 435 Properties in VBS:MCGUBackColorOff, 436 Properties in VBS:MCGUBackColorOn, 436 Properties in VBS:MCGUBackFlash, 436 Properties in VBS:MCGUTextColorOff, 437 Properties in VBS:MCGUTextColorOn, 437 Properties in VBS:MCGUTextFlash, 437 Properties in VBS:MCKOBackColorOff, 437 Properties in VBS:MCKOBackColorOn, 438 Properties in VBS:MCKOBackFlash, 438 Properties in VBS:MCKOTextColorOff, 438 Properties in VBS:MCKOTextColorOn, 439 Properties in VBS:MCKOTextFlash, 439 Properties in VBS:MCKQBackColorOff, 439 Properties in VBS:MCKQBackColorOn, 439 Properties in VBS:MCKQBackFlash, 440 Properties in VBS:MCKQTextColorOff, 440 Properties in VBS:MCKQTextColorOn, 440 Properties in VBS:MCKQTextFlash, 441 Properties in VBS:MCText, 441 Properties in VBS:MeasurePoints, 441 Properties in VBS:MessageClass, 447 Properties in VBS:Min, 449 Properties in VBS:MinuteNeedleHeight, 450 Properties in VBS:MinuteNeedleWidth, 450 Properties in VBS:Movable, 451 Properties in VBS:MsgCtrlFlags, 451 Properties in VBS:MsgFilterSQL, 452 Properties in VBS:Name, 452
Properties in VBS:NeedleColor, 453 Properties in VBS:NormalColor, 454 Properties in VBS:NumItems, 454 Properties in VBS:Object, 455 Properties in VBS:ObjectName, 455 Properties in VBS:ObjectSizeDeclutteringEnable, 456 Properties in VBS:ObjectSizeDeclutteringMax, 457 Properties in VBS:ObjectSizeDeclutteringMin, 457 Properties in VBS:OffsetLeft, 458 Properties in VBS:OffsetTop, 458 Properties in VBS:Online, 459 Properties in VBS:OnTop, 460 Properties in VBS:OperationMessage, 460 Properties in VBS:OperationReport, 461 Properties in VBS:Orientation, 468 Properties in VBS:OuterBevelStyle, 468 Properties in VBS:OuterBevelWidth, 469 Properties in VBS:Outline, 469 Properties in VBS:OutputFormat, 469 Properties in VBS:OutputValue, 470 Properties in VBS:Parent, 471 Properties in VBS:PasswordLevel, 472 Properties in VBS:Path, 473 Properties in VBS:PersistentRT, 474 Properties in VBS:PersistentRTCS, 474 Properties in VBS:PersistentRTCSPermission, 475 Properties in VBS:PersistentRTPermission, 475 Properties in VBS:PicDeactReferenced, 476 Properties in VBS:PicDeactTransparent, 476 Properties in VBS:PicDeactUseTransColor, 476 Properties in VBS:PicDownReferenced, 477 Properties in VBS:PicDownTransparent, 477 Properties in VBS:PicDownUseTransColor, 477 Properties in VBS:PicReferenced, 477 Properties in VBS:PicTransColor, 478 Properties in VBS:Picture, 478 Properties in VBS:PictureBack, 478 Properties in VBS:PictureDeactivated, 479 Properties in VBS:PictureDown, 479 Properties in VBS:PictureName, 480 Properties in VBS:PictureSelected, 480 Properties in VBS:PictureThumb, 480 Properties in VBS:PictureUnselected, 480 Properties in VBS:PictureUp, 479 Properties in VBS:PicUpReferenced, 481 Properties in VBS:PicUpTransparent, 481 Properties in VBS:PicUpUseTransColor, 481 Properties in VBS:PicUseTransColor, 482 Properties in VBS:PointCount, 482 Properties in VBS:Position, 482 Properties in VBS:Precisions, 483
2519
Index
Properties in VBS:PrecisionX, 483 Properties in VBS:PrecisionY, 483 Properties in VBS:PredefinedAngles, 484 Properties in VBS:Pressed, 484 Properties in VBS:PrintJob, 484 Properties in VBS:Process, 485 Properties in VBS:ProjectPath, 486 Properties in VBS:ProviderClsID, 486 Properties in VBS:ProviderType, 486 Properties in VBS:QualityCode, 487 Properties in VBS:Radius, 488 Properties in VBS:RadiusHeigth, 488 Properties in VBS:RadiusWidth, 488 Properties in VBS:RangeMax, 489 Properties in VBS:RangeMin, 489 Properties in VBS:Rectangular, 489 Properties in VBS:ReferenceRotationLeft, 490 Properties in VBS:ReferenceRotationTop, 490 Properties in VBS:RelayCurves, 490 Properties in VBS:Relevant, 491 Properties in VBS:Replacement, 491 Properties in VBS:ReplacementColor, 491 Properties in VBS:RightComma, 492 Properties in VBS:Rotation, 492 Properties in VBS:RoundCornerHeight, 493 Properties in VBS:RoundCornerWidth, 494 Properties in VBS:RulerPrecisions, 496 Properties in VBS:RulerPrecisionX, 496 Properties in VBS:RulerPrecisionY, 497 Properties in VBS:SameSize, 497 Properties in VBS:ScaleColor, 498 Properties in VBS:ScaleTicks, 498 Properties in VBS:Scaling, 498 Properties in VBS:ScalingType, 499 Properties in VBS:ScalingTypeX, 499 Properties in VBS:ScalingTypeY, 500 Properties in VBS:Screen, 501 Properties in VBS:ScreenItems, 501 Properties in VBS:ScreenName, 500 Properties in VBS:Screens, 283 Properties in VBS:ScrollBars, 502 Properties in VBS:SecondNeedleHeight, 503 Properties in VBS:SecondNeedleWidth, 503 Properties in VBS:SelBGColor, 504 Properties in VBS:SelectionMode, 506 Properties in VBS:SelectionRectColor, 506 Properties in VBS:SelectionRectWidth, 507 Properties in VBS:SelectionType, 507 Properties in VBS:SelTextColor, 508 Properties in VBS:ServerData, 509 Properties in VBS:ServerNames, 509 Properties in VBS:ServerPrefix, 509
Properties in VBS:ShowBar, 510 Properties in VBS:ShowDanger, 510 Properties in VBS:ShowDecimalPoint, 510 Properties in VBS:ShowNormal, 511 Properties in VBS:ShowPeak, 511 Properties in VBS:ShowPosition, 511 Properties in VBS:ShowRulerImmediately, 512 Properties in VBS:ShowThumb, 514 Properties in VBS:ShowValuesExponentialX, 515 Properties in VBS:ShowValuesExponentialY, 515 Properties in VBS:ShowWarning, 515 Properties in VBS:SignificantMask, 516 Properties in VBS:SmallChange, 517 Properties in VBS:SourceBeginTime, 518 Properties in VBS:SourceEndTime, 519 Properties in VBS:SourceNumberOfUAValues, 519 Properties in VBS:SourceNumberOfValues, 519 Properties in VBS:SourceTagNameX, 520 Properties in VBS:SourceTagNameY, 520 Properties in VBS:SourceTagProviderDataX, 520 Properties in VBS:SourceTagProviderDataY, 521 Properties in VBS:SourceTimeRange, 521 Properties in VBS:SourceUAArchive, 521 Properties in VBS:SourceUAArchiveStartID, 522 Properties in VBS:SourceUAColumnX, 522 Properties in VBS:SourceUAColumnY, 523 Properties in VBS:SquareExtent, 523 Properties in VBS:StartAngle, 523 Properties in VBS:Statusbar, 524 Properties in VBS:StatusbarPanes, 528 Properties in VBS:StatusbarStretch, 529 Properties in VBS:Tag, 624 Properties in VBS:TagName, 531 Properties in VBS:TagPrefix, 531 Properties in VBS:TagProviderClsid, 532 Properties in VBS:Tags, 531 Properties in VBS:Template, 532 Properties in VBS:Text, 533 Properties in VBS:ThumbBackColor, 534 Properties in VBS:TicColor, 534 Properties in VBS:TicFont, 534 Properties in VBS:Ticks, 536 Properties in VBS:TicksColor, 536 Properties in VBS:TickStyle, 537 Properties in VBS:TicOffset, 535 Properties in VBS:TicTextColor, 535 Properties in VBS:TicTextOffset, 535 Properties in VBS:TicWidth, 536 Properties in VBS:TimeAxisFormat, 539 Properties in VBS:TimeAxisX, 544 Properties in VBS:TimeColumnAlignment, 545 Properties in VBS:TimeFormat, 553
2520
Index
Properties in VBS:TimeJump, 553 Properties in VBS:TimeJumpColor, 554 Properties in VBS:TimeOverlap, 554 Properties in VBS:TimeOverlapColor, 555 Properties in VBS:TimeRange, 555 Properties in VBS:TimeRangeBase, 556 Properties in VBS:TimeRangeFactor, 556 Properties in VBS:TimeStamp, 556 Properties in VBS:TimeZone, 558 Properties in VBS:TitleCut, 559 Properties in VBS:Titleline, 560 Properties in VBS:Toggle, 561 Properties in VBS:ToleranceHigh, 562 Properties in VBS:ToleranceLow, 562 Properties in VBS:Toolbar, 562 Properties in VBS:ToolbarAlignment, 563 Properties in VBS:ToolbarButtons, 571 Properties in VBS:ToolbarHotKeys, 572 Properties in VBS:ToolTipText, 574 Properties in VBS:Top, 575 Properties in VBS:TopConnectedConnectionPointIndex, 576 Properties in VBS:TopConnectedObjectName, 576 Properties in VBS:Transparent, 577 Properties in VBS:Trend, 577 Properties in VBS:TrendColor, 579 Properties in VBS:Type, 596 Properties in VBS:TypeAlarmHigh, 598 Properties in VBS:TypeAlarmLow, 598 Properties in VBS:TypeLimitHigh4, 599 Properties in VBS:TypeLimitHigh5, 599 Properties in VBS:TypeLimitLow4, 599 Properties in VBS:TypeLimitLow5, 600 Properties in VBS:TypeToleranceHigh, 600 Properties in VBS:TypeToleranceLow, 600 Properties in VBS:TypeWarningHigh, 600 Properties in VBS:TypeWarningLow, 601 Properties in VBS:UnitColor, 601 Properties in VBS:UnitFont, 601 Properties in VBS:UnitOffset, 602 Properties in VBS:UnitText, 602 Properties in VBS:UnselBGColor, 602 Properties in VBS:UnselTextColor, 603 Properties in VBS:UpdateCycle, 603 Properties in VBS:UpperLimit, 603 Properties in VBS:UpperLimitColor, 604 Properties in VBS:UpperLimitValue, 604 Properties in VBS:UserValue1, 607 Properties in VBS:UserValue2, 607 Properties in VBS:UserValue3, 607 Properties in VBS:UserValue4, 608 Properties in VBS:Value, 610
Properties in VBS:ValueColumnAlignment, 617 Properties in VBS:ValueMax, 623 Properties in VBS:ValueMin, 624 Properties in VBS:Visible, 624 Properties in VBS:Warning, 625 Properties in VBS:WarningColor, 625 Properties in VBS:WarningHigh, 626 Properties in VBS:WarningLow, 626 Properties in VBS:Width, 626 Properties in VBS:WindowBorder, 627 Properties in VBS:WindowsStyle, 629 Properties in VBS:WindowType, 629 Properties in VBS:WithAxes, 629 Properties in VBS:WithLabels, 630 Properties in VBS:ZeroPoint, 636 Properties in VBS:ZeroPointValue, 637 Properties in VBS:Zoom, 637 Protect VBA Code, 1562 Push Button Control, 253 putc, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
Q
qsort, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 QuitHorn, 697 QuitSelected, 697 QuitVisible, 697
R
rand, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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,
2521
Index
985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 ReadTags, 702 realloc, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Reference, 1664 Event Handling, 1664 Methods, 1664 Object model, 1664 Objects and Lists, 1664 Properties, 1664 VBA Object Model, 1664 References, 1562 Registry2, 846 remove, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 rename, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Rename:Module, 54 Renaming, 54, 81 Renaming:Action, 81 Renaming:Procedure, 54 ReportJob, 884 rewind, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 RPTJobPreview, 847 RPTJobPrint, 848 RptShowError, 849
S
Save, 67 Module, 52 procedure, 52 Save As... Applying, 784 Save:Action, 67 Saving file as, 821 Screen Object, 140 ScreenItem, 246, 250, 257, 263, 271 Control, 193 Controls, 230 Customized object, 273 Faceplate instance, 199 WinCC Alarm Control, 265 WinCC AlarmControl, 236 ScreenItem Object, 134 ScreenItem:3D bar, 182 ScreenItem:Application window, 186 ScreenItem:Bar, 188 ScreenItem:Button, 214 ScreenItem:Check Box, 217 ScreenItem:Circle, 160 ScreenItem:Circle segment, 164 ScreenItem:Circular arc, 162 ScreenItem:Combobox, 202 ScreenItem:Connector, 180 ScreenItem:Double T-piece, 228 ScreenItem:Ellipse, 154 ScreenItem:Ellipse arc, 156 ScreenItem:Ellipse segment, 158 ScreenItem:Graphic Object, 200 ScreenItem:Group, 274 ScreenItem:Group Display, 208 ScreenItem:HMI Symbol Library 1.4.1, 233 ScreenItem:I/O Field, 196 ScreenItem:Line, 166 ScreenItem:ListBox, 203 ScreenItem:Multiline Text, 204 ScreenItem:Object types, 152 ScreenItem:OLE Element, 205 ScreenItem:Picture window, 191 ScreenItem:Polygon, 168 ScreenItem:Polygon Tube, 226 ScreenItem:Polyline, 170 ScreenItem:Radio Box, 219 ScreenItem:Rectangle, 172
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2522
Index
ScreenItem:Roundbutton, 221 ScreenItem:Rounded Rectangle, 175 ScreenItem:Slider, 223 ScreenItem:Static Text, 178 ScreenItem:Status Display, 212 ScreenItem:Text list, 210 ScreenItem:T-piece, 227 ScreenItem:Tube Arc, 229 ScreenItem:WinCC Digital Analog Clock, 239 ScreenItem:WinCC Function Trend Control, 267 ScreenItem:WinCC FunctionTrendControl, 241 ScreenItem:WinCC Gauge Control, 243 ScreenItem:WinCC Online Table Control, 269 ScreenItem:WinCC OnlineTableControl, 247 ScreenItem:WinCC Push Button Control, 253 ScreenItem:WinCC Slider Control, 259 ScreenItems object (list), 138 Screens Object (List), 143 Script file, 97 Script File:Action Names, 99 Script file:open in Debugger, 100 Script File:Permissible action name length, 99 Script File:Set bookmark, 105 Script files of VBScripts, 97 SelectedStatisticArea, 712 ServerExport, 712 ServerImport, 712 Set_Focus, 1215 SetActualPointLeft, 1225 SetActualPointTop, 1226 SetAlarmHigh, 1252 SetAlarmLow, 1253 SetAlignment, 1169 SetAlignmentLeft, 1216 SetAlignmentTop, 1217 SetAssumeOnExit, 1243 SetAssumeOnFull, 1244 SetAverage, 1293 SetAxisSection, 1170 SetBackBorderWidth, 1341 SetBackColor, 1179 SetBackColor2, 1180 SetBackColor3, 1181 SetBackColorBottom, 1182 SetBackColorTop, 1183 SetBackFlashColorOff, 1203 SetBackFlashColorOn, 1204 SetBasePicTransColor, 1334 SetBasePicUseTransColor, 1335 SetBitNumber, 1245 SetBorderBackColor, 1184 SetBorderColor, 1185
SetBorderColorBottom, 1186 SetBorderColorTop, 1187 SetBorderEndStyle, 1342 SetBorderFlashColorOff, 1205 SetBorderFlashColorOn, 1206 SetBorderStyle, 1343 SetBorderWidth, 1344 SetBoxAlignment, 1345 SetBoxCount, 1227 SetBoxType, 1294 setbuf, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 SetButtonColor, 1188 SetCheckAlarmHigh, 1253 SetCheckAlarmLow, 1254 SetCheckLimitHigh4, 1255 SetCheckLimitHigh5, 1256 SetCheckLimitLow4, 1257 SetCheckLimitLow5, 1258 SetCheckToleranceHigh, 1259 SetCheckToleranceLow, 1260 SetCheckWarningHigh, 1261 SetCheckWarningLow, 1261 SetClearOnError, 1246 SetClearOnNew, 1247 SetColorAlarmHigh, 1262 SetColorAlarmLow, 1263 SetColorBottom, 1189 SetColorChangeType, 1295 SetColorLimitHigh4, 1264 SetColorLimitHigh5, 1265 SetColorLimitLow4, 1266 SetColorLimitLow5, 1267 SetColorToleranceHigh, 1268 SetColorToleranceLow, 1269 SetColorTop, 1190 SetColorWarningHigh, 1270 SetColorWarningLow, 1271 SetCursorControl, 1296 SetCursorMode, 1297 SetDirection, 1228 SetEditAtOnce, 1298 SetEndAngle, 1229 SetExponent, 1170 SetExtendedOperation, 1299 SetFillColor, 1191
2523
Index
SetFilling, 1201 SetFillingIndex, 1202 SetFillStyle, 1345 SetFillStyle2, 1346 SetFlashBackColor, 1207 SetFlashBorderColor, 1208 SetFlashFlashPicture, 1336 SetFlashForeColor, 1209 SetFlashPicTransColor, 1337 SetFlashPicUseTransColor, 1338 SetFlashRateBackColor, 1210 SetFlashRateBorderColor, 1211 SetFlashRateFlashPic, 1339 SetFlashRateForeColor, 1212 SetFontBold, 1218 SetFontItalic, 1219 SetFontName, 1220 SetFontSize, 1221 SetFontUnderline, 1222 SetForeColor, 1192 SetForeFlashColorOff, 1213 SetForeFlashColorOn, 1214 SetHeight, 1230 SetHiddenInput, 1248 SetHysteresis, 1300 SetHysteresisRange, 1301 SetIndex, 1340 SetItemBorderBackColor, 1193 SetItemBorderColor, 1194 SetItemBorderStyle, 1347 SetItemBorderWidth, 1348 SetLanguage, 1467 SetLeft, 1231 SetLeftComma, 1171 SetLimitHigh4, 1272 SetLimitHigh5, 1273 SetLimitLow4, 1274 SetLimitLow5, 1275 SetLimitMax, 1276 SetLimitMin, 1277 SetLink, 1292 SetLongStrokesBold, 1172 SetLongStrokesOnly, 1173 SetLongStrokesSize, 1174 SetMarker, 1277 SetMax, 1301 SetMin, 1302 SetNumberLines, 1249 SetOffsetLeft, 1303 SetOffsetTop, 1304 SetOperation, 1305 SetOperationMessage, 1306
SetOperationReport, 1306 SetOrientation, 1223 SetOutputValueChar, 1250 SetOutputValueDouble, 1250 SetPasswordLevel, 1307 SetPicDeactTransparent, 1319 SetPicDeactUseTransColor, 1320 SetPicDownTransparent, 1321 SetPicDownUseTransColor, 1322 SetPicTransColor, 1323 SetPictureDeactivated, 1324 SetPictureDown, 1325 SetPictureName, 1308 SetPictureUp, 1326 SetPicUpTransparent, 1327 SetPicUpUseTransColor, 1328 SetPicUseTransColor, 1328 SetPointCount, 1232 SetPosition, 1316 SetPressed, 1349 SetProcess, 1309 SetPropBOOL, 1330 SetPropChar, 1331 SetPropDouble 0, 1332 SetPropWord, 1333 SetRadius, 1232 SetRadiusHeight, 1233 SetRadiusWidth, 1234 SetRangeMax, 1317 SetRangeMin, 1318 SetReferenceRotationLeft, 1235 SetReferenceRotationTop, 1236 SetRightComma, 1175 SetRotationAngle, 1237 SetRoundCornerHeight, 1238 SetRoundCornerWidth, 1239 SetScaleColor, 1195 SetScaleTicks, 1176 SetScaling, 1177 SetScalingType, 1178 SetSelBGColor, 1196 SetSelTextColor, 1197 SetSmallChange, 1310 SetStartAngle, 1240 SetTagBit, 1453 SetTagBitState, 1430 SetTagBitStateWait, 1418 SetTagBitWait, 1441 SetTagByte, 1454 SetTagByteState, 1431 SetTagByteStateWait, 1419
2524
Index
SetTagByteWait, 1442 SetTagChar, 1455 SetTagCharState, 1432 SetTagCharStateWait, 1420 SetTagCharWait, 1443 SetTagDouble, 1455 SetTagDoubleState, 1433 SetTagDoubleStateWait, 1421 SetTagDoubleWait, 1444 SetTagDWord, 1456 SetTagDWordState, 1434 SetTagDWordStateWait, 1422 SetTagDWordWait, 1445 SetTagFloat, 1457 SetTagFloatState, 1435 SetTagFloatStateWait, 1423 SetTagFloatWait, 1446 SetTagMultiStateWait, 1424 SetTagMultiWait, 1447 SetTagPrefix, 1311 SetTagRaw, 1458 SetTagRawState, 1436 SetTagRawStateWait, 1425 SetTagRawWait, 1447 SetTagSByte, 1459 SetTagSByteState, 1437 SetTagSByteStateWait, 1426 SetTagSByteWait, 1448 SetTagSDWord, 1460 SetTagSDWordState, 1438 SetTagSDWordStateWait, 1427 SetTagSDWordWait, 1449 SetTagSWord, 1461 SetTagSWordState, 1439 SetTagSWordStateWait, 1428 SetTagSWordWait, 1450 SetTagValue, 1462 SetTagValueWait, 1451 SetTagWord, 1463 SetTagWordState, 1440 SetTagWordStateWait, 1429 SetTagWordWait, 1452 SetText, 1224 SetToggle, 1350 SetToleranceHigh, 1278 SetToleranceLow, 1279 SetTop, 1240 SetTrend, 1312 SetTrendColor, 1198 SetTypeAlarmHigh, 1280 SetTypeAlarmLow, 1281 SetTypeLimitHigh4, 1282
SetTypeLimitHigh5, 1283 SetTypeLimitLow4, 1284 SetTypeLimitLow5, 1285 SetTypeToleranceHigh, 1286 SetTypeToleranceLow, 1287 SetTypeWarningHigh, 1288 SetTypeWarningLow, 1289 SetUnselBGColor, 1199 SetUnselTextColor, 1200 setvbuf, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 SetVisible, 1313 SetWarningHigh, 1290 SetWarningLow, 1291 SetWidth, 1241 SetWindowsStyle, 1351 SetZeroPoint, 1242 SetZeroPointValue, 1314 SetZoom, 1315 ShowColumnSelection, 713 ShowComment, 713 ShowDisplayOptionsDialog, 714 ShowEmergencyQuitDialog, 714 ShowHelp, 714 ShowHideList, 715 ShowHitList, 715 ShowInfoText, 716 ShowLockDialog, 716 ShowLockList, 716 ShowLongTermArchiveList, 717 ShowMessageList, 717 ShowPercentageAxis, 718 ShowPropertyDialog, 718 ShowSelectArchive, 718 ShowSelection, 719 ShowSelectionDialog, 720 ShowSelectTimeBase, 719 ShowShortTermArchiveList, 720 ShowSort, 720 ShowSortDialog, 721 ShowTagSelection, 721 ShowTimebaseDialog, 722 ShowTimeSelection, 722 ShowTrendSelection, 723 sin, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941,
2525
Index
942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 sinh, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Slider control, 259 Smart object, 1609 Editing with VBA, 1610 Smart objects Combobox, 202 Faceplate instance, 199 Smart Objects Control, 193 Smart objects:3D bar, 182 Smart objects:Application window, 186 Smart objects:Bar, 188 Smart Objects:Graphic Object, 200 Smart objects:Group Display, 208 Smart objects:I/O Field, 196 Smart objects:List Box, 203 Smart Objects:Multiline Text, 204 Smart Objects:OLE Element, 205 Smart objects:Picture window, 191 Smart objects:Status Display, 212 Smart objects:Text list, 210 Smart tag object, 145 SmartTag property, 517 sqrt, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 srand, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
Standard function Application, 767 Applying, 796 Characteristics, 767 Deleting, 785 Standard object, 1609 Editing with VBA, 1610 Standard Objects:Circle, 160 Standard Objects:Circle segment, 164 Standard Objects:Circular arc, 162 Standard Objects:Connector, 180 Standard Objects:Ellipse, 154 Standard Objects:Ellipse arc, 156 Standard Objects:Ellipse segment, 158 Standard Objects:Line, 166 Standard Objects:Polygon, 168 Standard Objects:Polyline, 170 Standard Objects:Rectangle, 172 Standard Objects:Rounded Rectangle, 175 Standard objects:Static Text, 178 Standard procedure, 47 Standard procedure:Use, 47 Start, 1566 VBA editor, 1562 VBA Macros, 1566 Starting Global Script, 30 StartStopUpdate, 723 Status bar, 775 stdio, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 stdlib, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 StorePicture, 1354 strcat, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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,
2526
Index
985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strchr, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strcmp, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strcpy, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strcspn, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strerror, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strftime, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 string, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940,
941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strlen, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strncat, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strncmp, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strncpy, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strpbrk, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strrchr, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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,
2527
Index
985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strspn, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strstr, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strtod, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strtok, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strtol, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 strtoul, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
Symbol library, 1593 Access with VBA, 1593 Copying an object with VBA, 1596 Creating a folder with VBA, 1596 Deleting a folder with VBA, 1596 Editing with VBA, 1596 Paste Object into a Picture with VBA, 1599 Symbol Library, 233 Syntax, 67 Syntax:Control, 67 Syntax:Error, 67 SysFree, 920 SysMalloc, 920 system, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 System behavior, 802
T
Table Control, 269 Tag, 27, 69, 76, 2426 Change limits with VBA, 2426 Change type with VBA, 2426 Creating with VBA, 2426 Define type with VBA, 2426 Deleting with VBA, 2426 Read limits with VBA, 2426 Read properties with VBA, 2426 Tag Logging, 2438 Create archive tag with VBA, 2438 Create process value archive with VBA, 2438 Delete archive tag with VBA, 2438 Delete process value archive with VBA, 2438 Edit archive tag with VBA, 2438 Edit process value archive with VBA, 2438 Tag Object, 146 Tag:Configure a Trigger to an Action, 76 Tag:global in VBS, 27 Tags Object (List), 149 TagScaleParam1 properties, 2306 TagScaleParam2 properties, 2306 TagScaleParam3 properties, 2306 TagScaleParam4 properties, 2306 TagSet Object (List), 151 tan, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941,
MDM - WinCC: Scripting (VBS, ANSI-C, VBA) System Manual, 11/2008,
2528
Index
942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 tanh, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Testing, 90 Testing:with the Debugger, 90 Text library, 2465 Changing text with VBA, 2465 Creating language with VBA, 2465 Creating text with VBA, 2465 Deleting text with VBA, 2465 Read text with VBA, 2465 Read TextID with VBA, 2465 time, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 Timer, 69, 74 Timer:Configure a Trigger to an Action, 74 TlgGetColumnPosition, 918 TlgGetNumberOfColumns, 912 TlgGetNumberOfRows, 913 TlgGetNumberOfTrends, 913 TlgGetRowPosition, 914 TlgGetRulerArchivNameTrend, 914 TlgGetRulerTimeTrend, 915 TlgGetRulerValueTrend, 916 TlgGetRulerVariableNameTrend, 916 TlgGetTextAtPos, 917 TlgTableWindowPressEditRecordButton, 885 TlgTableWindowPressFirstButton, 886 TlgTableWindowPressInsertRecordButton, 887 TlgTableWindowPressLastButton, 888 TlgTableWindowPressNextButton, 889 TlgTableWindowPressNextItemButton, 890 TlgTableWindowPressOpenArchiveVariableSelectio nDlgButton, 890 TlgTableWindowPressOpenDlgButton, 891
TlgTableWindowPressOpenItemSelectDlgButton, 892 TlgTableWindowPressOpenTimeSelectDlgButton, 893 TlgTableWindowPressPrevButton, 894 TlgTableWindowPressPrevItemButton, 894 TlgTableWindowPressRemoveRecordButton, 907 TlgTableWindowPressStartStopButton, 895 TlgTrendWindowActivateCurve, 918 TlgTrendWindowPressFirstButton, 896 TlgTrendWindowPressHelpButton, 897 TlgTrendWindowPressLastButton, 897 TlgTrendWindowPressLinealButton, 898 TlgTrendWindowPressNextButton, 899 TlgTrendWindowPressNextItemButton, 900 TlgTrendWindowPressOneToOneButton, 901 TlgTrendWindowPressOpenArchiveVariableSelectio nDlgButton, 902 TlgTrendWindowPressOpenDlgButton, 902 TlgTrendWindowPressOpenItemSelectDlgButton, 903 TlgTrendWindowPressOpenTimeSelectDlgButton, 904 TlgTrendWindowPressPrevButton, 905 TlgTrendWindowPressPrevItemButton, 906 TlgTrendWindowPressPrintButton, 906 TlgTrendWindowPressStartStopButton, 908 TlgTrendWindowPressStatsResultButton, 909 TlgTrendWindowPressStatsSelectRangeButton, 909 TlgTrendWindowPressZoomInButton, 910 TlgTrendWindowPressZoomOutButton, 911 tmpfile, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 tmpnam, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 tolower, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973,
2529
Index
974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 toolbar, 1601 Add icon, 1584 application-specific, 1573 Assigning help text, 1586 Assigning status text, 1586 Assigning VBA macro, 1589 Configuring, 1572 Creating, 1582 picture-specific, 1573, 1601 Placement, 1573 Properties, 1573 user-defined, 1573 Toolbar, 1573 Working with toolbars, 781 Toolbar:GSC Diagnostics, 86 toupper, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 TraceText, 1470 TraceTime, 1470 Trigger, 69 Changing, 817 Deleting, 818 Effect on actions, 811 Picture cycle, 1653 Standard cycle, 1653 Tag, 1653 Window Cycle, 1653 Trigger type, 763, 811 Trigger:Adding "Tag" Trigger, 76 Trigger:Adding type "Timer", 74 Trigger:Deleting, 79 Trigger:editing, 78 Triggers, 74, 76, 1652 Configuring with VBA, 1652 Tube objects:Double T-piece, 228 Tube objects:Polygon tube, 226 Tube objects:T-piece, 227 Tube objects:Tube Arc, 229 TubeArcObject object, 1976 TubeDoubleTeeObject object, 1979 TubePolyline object, 1981 TubeTeeObject object, 1984
U
ungetc, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 UnhideAlarm, 725 UnlockAlarm, 725 User interface language, 1570 Access with VBA, 1570 UserArchiveControl, 263 User-defined menu, 1566, 1573 Add menu entry, 1577 Assigning help text, 1586 Assigning status text, 1586 Assigning VBA macro, 1589 Configuring, 1572 Creating, 1575 creating multiple languages, 1580 Placement, 1573 Properties, 1573 User-defined toolbar, 1566, 1573 Add icon, 1584 Assigning help text, 1586 Assigning status text, 1586 Assigning VBA macro, 1589 Configuring, 1572 Creating, 1582 Placement, 1573 Properties, 1573
V
Validity range, 772 VB action, 1650 Configuring on an event with VBA, 1650 VB Scripts, 1642 Dynamize property with VBA, 1642
2530
Index
VBA, 1560 Access to a copy of the pictures, 1601 Access to external applications, 1658 Access to group objects, 1618 Access to layers, 1601 Access to objects in the Graphics Designer, 1606 Access to other programs, 1658 Access to the component library, 1593 Access to the symbol library, 1593 Accessing MS Excel with VBA, 1659 Action configuring, 1644 Add menu entry to user-defined menu, 1577 Adding a New Icon to the used-defined Toolbar, 1584 Alarm Logging, 2478 Assign help text to user-defined menu, 1586 Assign help text to user-defined toolbar, 1586 Assigning VBA macro to user-defined menu, 1589 Assigning VBA macro to user-defined toolbar, 1589 C Scripts (Delimitation), 1561 Configure user-defined menu, 1572 Configure user-defined toolbar, 1572 Configuring a Direct Connection, 1645 Configuring C Action on an Event, 1648 Configuring Dynamics in a Property with C Script, 1639 Configuring Dynamics in a Property with Dynamic Dialog, 1636 Configuring Dynamics in a Property with VB Script, 1642 Configuring event-controlled actions, 1644 Configuring Multiple Languages, 1570 Configuring triggers, 1652 Configuring VB Action on an Event, 1650 Controlling the visibility of layers, 1603 Create an application-specific menu, 1575 Create application-specific toolbar, 1582 Create user-defined menu, 1575 Create user-defined menu in multiple languages, 1580 Create user-defined toolbar, 1582 Creating a group object, 1620 Customized Object, 1626 Deleting Group Objects, 1620 Dynamic Wizards (Delimitation), 1561 Dynamization, 1631 Edit component library, 1596 Edit layers, 1603 Edit Smart object, 1610 Edit standard object, 1610 Edit Windows object, 1610 Editing a copy of a picture, 1605 Editing a group object, 1620 MDM - WinCC: Scripting (VBS, ANSI-C, VBA) Editing Customized Objects, 1628 System Manual, 11/2008, Editing objects in a group object, 1623 Editing objects in Graphic Designer, 1606 Editing objects in Graphics Designer, 1606 Editing picture, 1601 Editing symbol library, 1596
Picture, 1599 Paste Object from symbol library into a Picture, 1599 Paste Object into Picture, 1609 picture-specific VBA code, 1562 Project language, 1570 project-specific VBA Code, 1562 Tag Logging, 2438 Tag Management, 2426 Text library, 2465 Ungrouping Group Object, 1620 Usage, 1561 User interface language, 1570 User-defined menu, 1573 User-defined toolbar, 1573 VB Scripts (Delimitation), 1561 VBA Code, 1565 Execution sequence, 1562 Exporting, 1565 global, 1562 Importing, 1565 Organization within the WinCC Project, 1562 Password protection, 1562 picture-specific, 1562 project-specific, 1562 protecting, 1562 References, 1562 VBA editor, 1562 Start, 1562 VBA events see VBAEvents:VBA Event Handling, 1664 VBA in the Graphics Designer, 1567 VBA Macros, 1566 Specifics during the execution, 1562 Version, 1566 VBA Object Model, 1664 VBA Reference, 1664 Event Handling, 1664 Events, 1664 Methods, 1664 Object model, 1664 Properties, 1664 VBA Object Model, 1664
2531
Index
VBS, 27, 734 Application Scenarios, 14 Basics, 760 Examples, 755 Examples in WinCC, 734 Methods, 638 Object model, 109 Objects, 113 Reference, 109 Target Group of the Documentation, 14 VBS:Action, 21 VBS:CrossReference, 25 VBS:Editors, 28 VBS:Module, 18 VBS:Object Types, 152 VBS:Procedure, 18 VBS:Properties, 276 VBS:Standard Functions, 45 VBS:Using Global Tags, 27 VBScript Files, 97 VBScript Files:Structure, 97 VBScript:activate in Runtime, 82 VBScript:debugging, 90 VBScript:open in Debugger, 100 VBScript:print, 108 vfprintf, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003 View, 783 Setting different views, 783 Visual Basic Script in WinCC, 14 Visual Basic Scripts, 14 vsprintf, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 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, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1002, 1003
W
WinCC, 14, 152 Script Languages, 14 Visual Basic Scripts, 14 WinCC Alarm Control, 265 WinCC AlarmControl, 236 WinCC MediaControl, 246 WinCC coding rules, 805 WinCC:Graphic object types, 152 WinCC:WinCC Digital Analog Clock, 239 WinCC:WinCC Function Trend Control, 267 WinCC:WinCC FunctionTrendControl, 241 WinCC:WinCC Gauge Control, 243 WinCC:WinCC Online Table Control Online, 269 WinCC:WinCC Online Trend Control, 271 WinCC:WinCC OnlineTableControl, 247 WinCC:WinCC OnlineTrendControl, 250 WinCC:WinCC Push Button Control Controls:WinCC Push Button Control, 253 WinCC:WinCC RulerControl, 257 WinCC:WinCC UserArchiveControl, 263 Window, 84, 87 Windows object, 1609 Editing with VBA, 1610 Windows Objects:Button, 214 Windows Objects:Check Box, 217 Windows Objects:Radio Box, 219 Windows Objects:Roundbutton, 221 Windows Objects:Slider, 223 WriteTag, 729 Writing tag values, 739
Z
ZoomArea, 729 ZoomInOut, 730 ZoomInOutTime, 730 ZoomInOutValues, 730 ZoomInOutX, 731 ZoomInOutY, 731 ZoomMove, 732
2532