152
03.04 Contents Printout of the Online Help i Smart Tools Contents 1 EasyLanguage ..................................................................................... 1 1.1 Brief Description ........................................................................................ 1 1.2 Installing EasyLanguage ........................................................................... 2 1.3 Prefaces .................................................................................................... 3 1.4 Export Function ......................................................................................... 5 1.5 Import Function.......................................................................................... 6 1.6 Link File Structure (Import/Export File)...................................................... 7 1.7 Supplying the Language Information......................................................... 8 1.8 Control Characters .................................................................................... 9 2 Variable Export/Import ...................................................................... 11 2.1 Brief Description ...................................................................................... 11 2.2 Installation ............................................................................................... 12 2.3 Operation ................................................................................................. 13 2.4 The Variable Export/Import ..................................................................... 14 2.5 Connections............................................................................................. 15 2.6 File Structures ......................................................................................... 16 2.7 Tag........................................................................................................... 17 2.8 Appendix.................................................................................................. 19 3 The Tag Simulator ............................................................................. 21 3.1 Brief Description ...................................................................................... 21 3.2 Usage of the Tag Simulator ..................................................................... 22 3.2.1 Simulation of Tags without Process Peripherals ..................................... 22 3.2.2 Simulation of Tags with Process Peripherals Connected ....................... 22 3.3 The Simulator Functions ......................................................................... 23 3.4 Installing the Simulator ............................................................................ 24 3.5 Starting the Simulator .............................................................................. 24 3.6 Add/Remove Tags ................................................................................... 25 3.7 Configurability of the Functions ............................................................... 26 3.8 Activate/Deactivate Tags......................................................................... 27 3.9 Displaying the Tags ................................................................................. 28 3.10 Load/Save Simulation Data ..................................................................... 29 3.11 FAQ ......................................................................................................... 30 4 Dynamic Wizard Editor ...................................................................... 31 4.1 Brief Description ...................................................................................... 31 4.2 Method of Operation................................................................................ 32 4.3 Installation ............................................................................................... 35 4.4 Structure .................................................................................................. 36 4.4.1 Toolbar .................................................................................................... 37 4.4.2 Editing Window ........................................................................................ 39 4.4.3 Help Editor ............................................................................................... 40 4.4.4 Output Window ........................................................................................ 41 4.5 Structure of a Dynamic Wizard Function ................................................. 42 4.5.1 Dynamic Wizard Dialog ........................................................................... 43 4.5.2 Linking Header Files and DLL's............................................................... 44 4.5.3 Language Dependent Definitions ............................................................ 45 4.5.4 Wizard Flags............................................................................................ 46 4.5.5 Properties List.......................................................................................... 47 www.cadfamily.com EMail:[email protected] The document is for study only,if tort to your rights,please inform us,we will delete

WinCC SmartTools Tutorial

Embed Size (px)

Citation preview

Page 1: WinCC SmartTools Tutorial

03.04 Contents

Printout of the Online Help i Smart Tools

Contents

1 EasyLanguage ..................................................................................... 1 1.1 Brief Description ........................................................................................ 1 1.2 Installing EasyLanguage ........................................................................... 2 1.3 Prefaces .................................................................................................... 3 1.4 Export Function ......................................................................................... 5 1.5 Import Function.......................................................................................... 6 1.6 Link File Structure (Import/Export File)...................................................... 7 1.7 Supplying the Language Information......................................................... 8 1.8 Control Characters .................................................................................... 9

2 Variable Export/Import ...................................................................... 11 2.1 Brief Description ...................................................................................... 11 2.2 Installation ............................................................................................... 12 2.3 Operation................................................................................................. 13 2.4 The Variable Export/Import ..................................................................... 14 2.5 Connections............................................................................................. 15 2.6 File Structures ......................................................................................... 16 2.7 Tag........................................................................................................... 17 2.8 Appendix.................................................................................................. 19

3 The Tag Simulator ............................................................................. 21 3.1 Brief Description ...................................................................................... 21 3.2 Usage of the Tag Simulator..................................................................... 22 3.2.1 Simulation of Tags without Process Peripherals..................................... 22 3.2.2 Simulation of Tags with Process Peripherals Connected ....................... 22 3.3 The Simulator Functions ......................................................................... 23 3.4 Installing the Simulator ............................................................................ 24 3.5 Starting the Simulator .............................................................................. 24 3.6 Add/Remove Tags................................................................................... 25 3.7 Configurability of the Functions ............................................................... 26 3.8 Activate/Deactivate Tags......................................................................... 27 3.9 Displaying the Tags................................................................................. 28 3.10 Load/Save Simulation Data..................................................................... 29 3.11 FAQ ......................................................................................................... 30

4 Dynamic Wizard Editor...................................................................... 31 4.1 Brief Description ...................................................................................... 31 4.2 Method of Operation................................................................................ 32 4.3 Installation ............................................................................................... 35 4.4 Structure .................................................................................................. 36 4.4.1 Toolbar .................................................................................................... 37 4.4.2 Editing Window........................................................................................ 39 4.4.3 Help Editor............................................................................................... 40 4.4.4 Output Window........................................................................................ 41 4.5 Structure of a Dynamic Wizard Function................................................. 42 4.5.1 Dynamic Wizard Dialog ........................................................................... 43 4.5.2 Linking Header Files and DLL's............................................................... 44 4.5.3 Language Dependent Definitions ............................................................ 45 4.5.4 Wizard Flags............................................................................................ 46 4.5.5 Properties List.......................................................................................... 47

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 2: WinCC SmartTools Tutorial

Contents 03.04

ii Printout of the Online Help Smart Tools

4.5.6 System Interface...................................................................................... 48 4.5.7 Global Variables ...................................................................................... 50 4.5.8 Options List.............................................................................................. 51 4.5.9 Trigger List............................................................................................... 53 4.5.10 Display of the Parameterization .............................................................. 56 4.5.11 Wizard Functions for Parameter Entry .................................................... 57 4.5.11.1 CreateStatic............................................................................................. 57 4.5.11.2 CreateEdit................................................................................................ 59 4.5.11.3 CreateSpinEdit ........................................................................................ 61 4.5.11.4 CreateListBox .......................................................................................... 63 4.5.11.5 CreateCheckBox ..................................................................................... 66 4.5.11.6 CreateFrame ........................................................................................... 68 4.5.11.7 CreateRadioButton .................................................................................. 70 4.5.11.8 CreateFileBrowser................................................................................... 72 4.5.11.9 CreateVarBrowser / CreateVarBrowserEx.............................................. 75 4.5.11.10 CreatePackageBrowser/CreatePackageBrowserEx ............................... 78 4.5.11.11 CreateObjectBrowser .............................................................................. 80 4.5.12 Wizard functions for generating dynamics .............................................. 82 4.5.12.1 GenerateBLOB........................................................................................ 82 4.5.12.2 DeleteBLOB............................................................................................. 85 4.5.12.3 SetAction ................................................................................................. 86 4.5.12.4 AddTimeTrigger....................................................................................... 87 4.5.12.5 AddVarTrigger/AddVarTriggerEx ............................................................ 89 4.5.12.6 SetValidateFct ......................................................................................... 91 4.5.12.7 EnumProperty/EnumPropertyEx ............................................................. 93 4.5.13 Wizard WinCC Functions ........................................................................ 95 4.5.13.1 GetProjectName...................................................................................... 95 4.5.13.2 GetPictureName...................................................................................... 96 4.5.13.3 GetDefaultWNFPath................................................................................ 97 4.5.13.4 GetObjectName....................................................................................... 98 4.5.13.5 InsertXRefSection.................................................................................... 99 4.5.14 Wizard Progress Functions ................................................................... 101 4.5.14.1 CreateProgressDlg................................................................................ 102 4.5.14.2 Progress_SetStatus............................................................................... 103 4.5.14.3 Progress_Steplt ..................................................................................... 104 4.5.14.4 Progress_SetPos................................................................................... 105 4.5.14.5 DestroyProgressDlg .............................................................................. 106 4.5.15 Wizard Windows Functions ................................................................... 107 4.5.15.1 GetParent .............................................................................................. 108 4.5.15.2 GetWindowRect..................................................................................... 109 4.5.15.3 MoveWindow......................................................................................... 110 4.5.15.4 SendMessage........................................................................................ 111 4.5.15.5 GetWindow ............................................................................................ 112 4.5.15.6 ShowWindow......................................................................................... 113 4.5.15.7 MessageBox.......................................................................................... 114 4.6 Examples............................................................................................... 116 4.6.1 Demo Wizard......................................................................................... 116 4.6.1.1 How to create the Dynamic Wizard function for the demo Wizard........ 117 4.6.1.2 How to add the "Demo.wnf" script to the data basis ............................. 118 4.6.1.3 How to create the help text.................................................................... 119 4.6.2 Making Motor dynamic .......................................................................... 120 4.6.2.1 How to create the Dynamic Wizard function for the Motor.................... 121 4.6.2.2 How to add the "Motor.wnf" script to the database ............................... 122 4.6.2.3 Making the Customized Object "Motor" Dynamic ................................. 123 4.6.2.4 How to create the structure and the structure variables........................ 125

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 3: WinCC SmartTools Tutorial

03.04 Contents

Printout of the Online Help iii Smart Tools

5 WinCC Documentation Viewer ....................................................... 127 5.1 Brief Description .................................................................................... 127 5.2 Installing WinCC Documentation Viewer............................................... 128 5.3 Description............................................................................................. 129 5.4 Creating the emf file(s) .......................................................................... 130

6 WinCC CrossReferenceAssistant .................................................. 131 6.1 Brief Description .................................................................................... 131 6.2 Installation ............................................................................................. 132 6.3 General.................................................................................................. 133 6.4 Known Functions (Script Management) ................................................ 134 6.5 Project Selection.................................................................................... 137 6.6 File Selection ......................................................................................... 138 6.7 Conversion ............................................................................................ 139 6.8 Advanced Settings................................................................................. 140

7 Registry Files OnlOff.reg, OnlOn.reg ............................................. 143 7.1 Brief Description .................................................................................... 143

8 WinCC Communication Configurator ............................................ 145 8.1 Brief Description .................................................................................... 145 8.2 WinCC Communication Configurator .................................................... 145

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 4: WinCC SmartTools Tutorial

Contents 03.04

iv Printout of the Online Help Smart Tools

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 5: WinCC SmartTools Tutorial

03.04 EasyLanguage

Printout of the Online Help 1

Smart Tools

1 EasyLanguage

1.1 Brief Description

EasyLanguage is a tool for exporting and importing language-dependent objects into and out of WinCC process screens. EasyLanguage provides support in the creation of multilanguage screens by permitting you to export the language-dependent objects in a WinCC process screen to allow them to be translated outside of WinCC.

The objects managed by the WinCC Text Library are not processed by EasyLanguage .

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 6: WinCC SmartTools Tutorial

EasyLanguage 03.04

2 Printout of the Online Help

Smart Tools

1.2 Installing EasyLanguage

EasyLanguage can be installed in two different ways:

Procedure

1. Select "User defined" during setup of WinCC. The "Components" dialog will open.

2. Click in the left-hand window on the "Smart tools" component. Select "EasyLanguage" in the right-hand window.

3. Click on the "Next" button. Follow the instructions in the dialogs. The EasyLanguage application is started by "SIMATIC" > "WinCC" > "Tools".

Alternative Procedure

You can also install the EasyLanguage application from the WinCC CD.

1. Switch to the WinCC CD in the directory "WinCC\Setup\Products\CC_Smarttools\". Double-click setup.exe.

2. Select "EasyLanguage" in the "Components" dialog. 3. Click on the "Next" button. Follow the instruction in the dialogs.

This program can only be used in a meaningful manner, if WinCC has been installed as well.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 7: WinCC SmartTools Tutorial

03.04 EasyLanguage

Printout of the Online Help 3

Smart Tools

1.3 Prefaces

Functionality

EasyLanguage provides the option to translate the language-dependent objects from the process pictures of WinCC in an ASCII file. An exception to this are language-dependent objects managed by the WinCC Text Library.

The ASCII file is created by the EasyLanguage export function in a csv format (comma separated values) and can be reimported using the import function.

The ASCII file is translated using a text editor (e.g. Windows Notepad) or another application which can read and write csv files (e.g. MS Excel).

Special aspects when using MS Excel to process data

If MS Excel is used, in the Regional Settings on the Control Panel the semicolon (";") must be used as the list separation character so that Excel can properly read and write the csv files. MS-Excel uses the list sepatation character entered on the Control Panel, although the default setting is region-specific. The default setting for English is the comma and for German the semicolon. When saving the file, it must be saved in "csv" format. In particular the separation characters ";" and "|" must not be changed. The vertical line ("|", ASCII-124) is required to separate multi-lined text (in text fields and buttons). The line break in the object is converted to the symbol "|" during export because the file can otherwise not be edited in MS Excel or an editor. When imported, the text properties in the "|" are converted back into line breaks. Additionally the csv file may not be opened by double-clicking in Explorer. Otherwise Excel converts all lines beginning with a letter into text lines (between simple quotation marks). Then open files cannot be edited in columns in Excel and are therefore useless for the import when saved by Excel. You must a csv file in Excel via File/Open where "Text Files (*.prn,*.txt,*.csv)" must be selected as file type.

Operating modes

EasyLanguage provides the option to export the language-dependent objects of the process pictures of WinCC to a link file and, after translation, to reimport this filed.

Export

The export function is used to create the link file. After exporting, all objects have the properties "Text" and "ToolTip" in all selected languages. The languages for export are selected in a list field which presents all languages installed in the WinCC project. It is therefore necessary to install the target language beforehand via the WinCC Text Library.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 8: WinCC SmartTools Tutorial

EasyLanguage 03.04

4 Printout of the Online Help

Smart Tools

Import

The import function reads in the link file with the translated texts and transfers the changes to the corresponding objects.

Program operation

EasyLanguage provides the languages German and English for program operation. Which language is used depends on the language set in WinCC Explorer. A language change to Runtime is not provided.

Operation

EasyLanguage is a dialogbox-based application which provides the available operation options for the most part via buttons. The operating mode (Export or Import) is selected via the buttons of the operating mode change.

Operating mode change When exporting, a link file is created which contains all objects with "Text" and "ToolTip" properties of the selected WinCC process pictures. When importing, an existing link file can be selected which is imported into the corresponding WinCC project (is in the link file header). Use the "Start" button to run the selected process (Export or Import). You can only use the "Start" button if all the required selections (WinCC project, csv file, pictures, languages) have been made. Picture objects can only be imported and exported if the corresponding WinCC project is open and activated. EasyLanguage automatically opens and acticates the selected WinCC project so that some time can pass until the actual process begins.

Note: To be able to observer the messages from other applications, e.g. Graphics Designer, you must move the EasyLanguage window on top from the middle of the screen. If EasyLanguage activates the project, all program modules are also loaded which you defined in the start-up list. EasyLanguage only requires the Runtime of Graphics Runtime. Therefore it is recommended that only Graphics Runtime and Text Library Runtime are activated in the start-up list to use EasyLanguage.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 9: WinCC SmartTools Tutorial

03.04 EasyLanguage

Printout of the Online Help 5

Smart Tools

1.4 Export Function

To execute the export function, a WinCC project must be selected.

Selecting a WinCC Project If you click on the "Find..." button, the standard file selection dialog will open. After the selection of the project, the list-boxes "Existing Screens" and "Existing Languages" will display all PDL files of the WinCC project and installed languages. The selection of the screens and languages (into the list-boxes "Selected Screens" and "Selected Languages") is carried out with the buttons between the list-boxes.

Selection of the Languages and Screens The export is initiated by clicking on the "Start" button, which will create a link file with the selected screens/languages. During the export process, the currently processed screen/object will be displayed.

Note: Before the export, all screens that are open in the Graphics Designer will be closed without saving. Because of this, all changed screens must be saved before starting the export, otherwise changes made will be lost.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 10: WinCC SmartTools Tutorial

EasyLanguage 03.04

6 Printout of the Online Help

Smart Tools

1.5 Import Function

To import the screen objects, the operating mode must be switched to "Import". Afterwards, the link file can be selected.

Operating Mode - Switching After selecting the link file, the screens and languages contained in it will be displayed.

The list box "Selected Screens" displays all screens contained in the link file. If you do not want to import all screens (e.g. if the file has only been translated partially), you can remove the unwanted ones with the selection buttons.

The list box "Selected Languages" offers one of the languages contained in the link file for the import. If necessary, another language can be selected using the selection buttons. The selection of only one import language has been provided, because a translation usually involves two languages (e.g. English to German), where one language is the original language (in our example English) that is not necessary to be imported again. If more than one language is to be imported, the import process must be started multiple times. During the import process, the currently processed screen/object will be displayed.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 11: WinCC SmartTools Tutorial

03.04 EasyLanguage

Printout of the Online Help 7

Smart Tools

1.6 Link File Structure (Import/Export File)

The link file is divided into the following sections:

[Header] [Project] [Languages] [Pictures] [Picture: "Screen Name"]

The [Header] section contains the date and time of the export. In the [Project] section, the WinCC project associated with the link file is entered. For the import data transfer, this WinCC project will be offered for selection. In the [Languages] section, all languages selected for the export are entered. For the import, these languages will offered for selection. The [Screens] section lists all (exported) screens contained in the link file. For the import, these screens will be offered for selection.

Note: The Sections [Header] [Project] [Languages] [Pictures] may not be changed by the translator, since this information is required for the import process.

The translation process takes place in the [Picture: "Screen Name"] section. Each screen contained in the link file has its own [Picture: ...] section.

Format of the [Picture: ...] section

The first line in a Picture section is the header line. It contains the following entries that appear only once:

Object: Name of the screen object Index: The index of the screen object when used with a radiobutton or check box

Furthermore, it contains an entry for each language.

"Name_of_Language": Text in the respective language FontName: Name of the font used FontSize: Size of the font FontBold: Text is in bold font FontItalic: Text is in italic font FontUnderline: Text is underlined

Example:

Object;Index;Deutsch;FontName;FontSize;FontBold;FontItalic;FontUnderline;Englisch;...

In the following lines, the language information for all of the screen objects will be listed with the "Text" property. Immediately following them (without a caption), the language information of all screen objects with the "ToolTip" property are listed. These entries can be recognized by the "T" identifier placed after the object name.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 12: WinCC SmartTools Tutorial

EasyLanguage 03.04

8 Printout of the Online Help

Smart Tools

1.7 Supplying the Language Information

The translation of screens is performed by modifying the text lines in the [Picture: ...] sections of the link file.

In the following example, the label of a button is entered for the English version and the font size and style (from standard to bold) is changed.

Text line after the export of the text for German and English

Button1;0;Öffnen;Arial;10;FALSE;FALSE;FALSE;TEXT;Arial;10;FALSE;FALSE;FALSE . . .

Tool tip line after the export of the text for German and English

Button1;T;Bedienung;; Text line with English text and modification of the font size and style

Button1;0;Öffnen;Arial;10;FALSE;FALSE;FALSE;Open;Arial;12;TRUE;FALSE;FALSE . . .

The tool tip line after the translation

Button1;T;Bedienung;Operation;

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 13: WinCC SmartTools Tutorial

03.04 EasyLanguage

Printout of the Online Help 9

Smart Tools

1.8 Control Characters

The "csv" file uses the semicolon (";") and the vertical line ("|") as control characters – therefore these characters may not be used in the WinCC project.

";" (Semicolon):

The semicolon separates the properties in a command line. This character must not be used in the texts that are exported or imported.

"|" (Vertical Line):

This character represents a line break in static texts of the export/import file, since the actual control character used by WinCC cannot be used in a text file.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 14: WinCC SmartTools Tutorial

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 15: WinCC SmartTools Tutorial

03.04 Variable Export/Import

Printout of the Online Help 11

Smart Tools

2 Variable Export/Import

2.1 Brief Description

The program exports to a corresponding ASCII file all of the connections, data structures and tags from the currently open project. They can then be imported to a second project. The ASCII format allows the files to be processed by a spreadsheet program before the import.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 16: WinCC SmartTools Tutorial

Variable Export/Import 03.04

12 Printout of the Online Help

Smart Tools

2.2 Installation

Variable Export/Import can be installed in two different ways:

Procedure

1. Select "User defined" during setup of WinCC. The "Components" dialog will open.

2. Click in the left-hand window on the "Smart tools" component. Select Variable Export/Import in the right-hand window.

3. Click on the "Next" button. Follow the instructions in the dialogs. The Variable Export/Import application is started by "SIMATIC" > "WinCC" > "Tools".

Alternative Procedure

You can also install the Variable Export/Import application from the WinCC CD.

1. Switch to the WinCC CD in the directory "WinCC\Setup\Products\CC_Smarttools\". Double-click setup.exe.

2. Select "Variable Export/Import" in the "Components" dialog. 3. Click on the "Next" button. Follow the instruction in the dialogs. This program can only be used in a meaningful manner, if WinCC has been installed as well.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 17: WinCC SmartTools Tutorial

03.04 Variable Export/Import

Printout of the Online Help 13

Smart Tools

2.3 Operation

EXPORT

1. Start WinCC and open the project from which you want to export the tags. Start the "VAR_EXIM.EXE".

2. Select the path and name of the file to which you want to export. Initially, only the name of the file without extension is required.

3. Set the mode to "Export" 4. Click on "Execute". Confirm your entries in the message box 5. Wait until "End Export/Import" appears in the status field 6. You can view the generated files by setting the corresponding switches "tag"

(tags), "con" (connections), "dex" (structures) and "diag" (log book)

Empty groups will not be exported.

The underscore (_) is reserved for the generation of names. File names must not contain underscores.

IMPORT

1. Start WinCC and open the project into which you want to import the tags. 2. All channel drivers must be present in the project to which the connections are

being imported. Therefore, add any drivers that are missing to the project. 3. Start the "VAR_EXIM.EXE". 4. Select the path and name of the file from which you want to import. Initially,

only the name of the file without extension is required. If you use the selection dialog, click on one of the three exported files.

5. Set the mode to "Import" or "ImportOverwrite". In "ImportOverwrite" mode, any tag in the destination project, which has the same name as a tag that will be imported, will be overwritten. In "Import" mode, on the other hand, a message will written in the logbook file, the tag in the destination project remains unchanged.

6. Click on "Execute". Confirm your entries in the message box 7. Wait until "End Export/Import" appears in the status field 8. View the generated data in WinCC tag management.

An import in either mode is not possible when WinCC Runtime is active.

The technical details of "Tag Export/Import" are described in the remaining sections. Knowledge of these chapters is not required for the standard case, where the target computer has the same project configuration as the WinCC project from which the export has been made. Knowledge of the WinCC tag structure is required if you want to add new tags or modify existing ones in the ASCII files.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 18: WinCC SmartTools Tutorial

Variable Export/Import 03.04

14 Printout of the Online Help

Smart Tools

2.4 The Variable Export/Import

The "Variable Export/Import" tool is an independent application, which is based on the WinCC-API. It can be used for the export of all WinCC tags of a project into ASCII files and for the import of tags into a second project. In the process, three files are generated

• [name]_cex.csv for the logical connections

• [name]_dex.csv for the structure descriptions

• [name]_vex.csv for the tag descriptions

In the files, a header will be generated that provides information about the generated data. During import, these three files will be read back automatically.

The file [name]_cex.csv is imported first, since the tags can only be generated if the corresponding connection already exists. This is followed by the data structures, which are defined in the [name]_dex.csv file. These are user-defined data types that must be declared before creating a tag of this type. Following that, the tag definitions will be read from the [name]_vex.csv file.

Tag groups cannot be created independent of a tag. If a group does not exist, it will be created automatically with the tag. Because of this, no group file is created during export. If your project contains groups without tags, they will not be exported.

During the creation of a tag, its address, among other things, is configured that determines the physical location of the tag in the PLC. This address depends on the channel of the connection and on the connected PLC. During configuration, the WinCC Explorer provides the user with a channel-specific entry dialog box. When editing an import file of "Tag Export/Import", these specifics must be considered. Exported tags can only be safely imported to a second WinCC project, if this project has the same configuration as the project from which the data has been exported. If data is imported to a project, the addresses of already existing tags might have to be corrected manually. However, it cannot be ruled out that it may be possible to import tags from a project with a different channel configuration. The success depends on the channel and the PLC!

The exported structure types, on the other hand, are hardware-independent. All channel-specific or connection-specific parameters such as Connection, GroupName or Address Information will not be considered. These parameters are defined once the structure tag is created.

Note the following when Exporting Address Strings in szSpecific

During the creation of the tag, the address string is checked by the channel-specific software. These Channel-DLLs expect a certain syntax, which is country-specific and must not be changed. Because of this, address strings are enclosed by additional quotation marks " " during the export, which are removed during import. This ensures that applications such as MS Excel do not modify the address information (problem with the list separator).

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 19: WinCC SmartTools Tutorial

03.04 Variable Export/Import

Printout of the Online Help 15

Smart Tools

2.5 Connections

A connection can only be imported, when the corresponding channel driver has been configured. In addition, the parameters in the file [name]_cex.csv must match with the configured channel driver.

Should the target computer use a different channel than the project from which the exported data originates, then this is the first modification that must be made to the exported data.

Follow this procedure to easily determine the required connection data: Configure all connections on the target computer and start the export. The parameters of your target computer will now be contained in the file [name]_cex.csv.

Logical Connection Example:

Conname Channel Unit Common Specific Flag VerbAS1 Industrial

Ethernet General "" 0

VerbAS2 Profibus-FMS General "" 0

The second line shows the logical connection of an Industrial Ethernet driver from the Simatic S7 Protocol Suite. The third line contains the logical connection of a Profibus-FMS driver.

Below #ConName is the name of the logical connection. In the exported file, this logical connection name can be found in the data of the tags. This logical connection is used for the communication with the PLC to access external tags from the process.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 20: WinCC SmartTools Tutorial

Variable Export/Import 03.04

16 Printout of the Online Help

Smart Tools

2.6 File Structures

File structure of the file [name]_dex.csv:

#Structure Name

Type-ID Creator-ID Project Path

Rule_1 1001 2500 C:\Testdaten\Proj.mcp #Varname C.Vartype C.CreatorID C.VarLength etc. NewTag1 ... ... ... ... NewTag2 ... ... ... ... NewTag3 ... ... ... ... etc. ... ... ... ...

#: Comment Character #Structure Name:

The next line contains the name of a file structure with structure-specific parameters. The project path is only included for the documentation from which project the data has been exported. Data is imported automatically to the currently open project.

#Varname: The lines below contain the elements of the file structure until a new "#Structure Name" line is detected or until there are no more defined lines. Each line contains all parameters that are required for the definition of a tag.

Note for Users of the WinCC API:

The first line contains as the column title the names of the parameters from the corresponding file structures of the API calls. In an MS Excel spreadsheet, the data can then be displayed clearly. If a name consists of a letter followed by a period, this is done to facilitate the assignment to the API calls.

Example:

C.nnnnnn is contained in the substructure "Common" P.nnnnnn is contained in the substructure "Protocol" L.nnnnnn is contained in the substructure "Limits" S.nnnnnn is contained in the substructure "Scaling"

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 21: WinCC SmartTools Tutorial

03.04 Variable Export/Import

Printout of the Online Help 17

Smart Tools

2.7 Tag

Tags and connections consist of a general and a specific section. The specific section is always provided by the corresponding Channel-DLL. Although this section may be missing during configuration (it must be defined before activation), all objects will be ignored during import, whose specific section is missing. During export, these missing sections are replaced by " * ".

Importing Tags of a User-Defined Type

A predefined WinCC tag is identified by a data type, whose value lies between 1 - 18.

A user-defined structure type receives the TypeID as the data type, which is assigned by the data manager during the creation of the data structure. This TypeID is greater than 1000.

A structure type is defined by its name and data type.

The name of the data structure is identical on the export and import computers. The TypeID, however, needs or will not be identical.

To create a tag of the structure type, an assignment of the TypeID to the structure name has to be made.

Example:

The structure types are exported in the file [name]_dex.csv.

#Structure Name

Type-ID Creator-ID Project Path

ExternStr1 1046 0 G:\Testdaten\...

#Varname C.Vartype C.CreatorID C.VarLength C.VarProperty ... Variable1 1 0 2 ... ... Variable2 2 0 1 ... ... Variable3 3 0 1 ... ... Variable4 4 0 2 ... ...

The tags are exported in the file [name]_vex.csv.

#Varname Conn Group Spec Flag CTypeInstExStr1 VerbLp GruLp DB200,DBB10 0 1046 InstExStr1.Variable1 VerbLp GruLp DB200,D10.0 0 1 InstExStr1.Variable2 VerbLp GruLp DB200,DBB10 0 2 InstExStr1.Variable3 VerbLp GruLp DB200,DBB10 0 3 InstExStr1.Variable4 VerbLp GruLp DB200,DBB10 0 4

In the file [name]_dex.csv, a structure type with the name ExternStr1 and the TypeID 1046 is defined.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 22: WinCC SmartTools Tutorial

Variable Export/Import 03.04

18 Printout of the Online Help

Smart Tools

In the file [name]_vex.csv, a structure tag with the name InstExStr1 and the type ExternStr1 is defined. The assignment (that it is an ExternStr1 structure type) is made via the value in the CType column, which contains the TypeID 1046 of this structure type.

To import a structure tag, the structure type must be contained in the file [name]_dex.csv and the tags of this type in the file [name]_vex.csv.

"Tag Export/Import" memorizes the Name-TypeID assignment, which allows the structure tags to be instantiated, even if the TypeID on the target computer is different.

If you want to import tags of the "User-Defined" type without reading the data structure during import (e.g. no [name]_dex.csv file), the target computer's TypeID of this data structure must be added manually into the csv file. In this case, the TypeID is determined with the help of the exported file [name]_dex.csv of the target computer (as described above).

The property of a tag is displayed in the column CPro (as a decimal value in the exported file [name]_vex.csv). The following tag properties exist:

Tag Property Decimal Value

Hexadecimal Value

Internal Tag with project-wide Update

2 2

Internal Tag with computer-local Update

8194 2002

External Tag 4 4

If, for example, internal tags with a computer-local local update are exported from WinCC, but internal tags with a project-wide update are to be imported back into WinCC, the value (in the export file) of the tag property in the CPro column can be changed from 8194 to 2 for the appropriate tags. Following that, the modified export file is saved and then imported into WinCC.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 23: WinCC SmartTools Tutorial

03.04 Variable Export/Import

Printout of the Online Help 19

Smart Tools

2.8 Appendix

Tag Fields ---------------- Varname: char szVarName[MAX_DM_VAR_NAME +1]; Conn: char szConnection[MAX_DM_CONNECTION_NAME +3]; Group: char szGroupName[MAX_DM_GROUP_NAME +1]; Spec: char szSpecific[MAX_DM_VAR_SPECIFIC +1]; Flag: DWORD dwFlags; Common Ctyp: DWORD dwVarType; // Variable type CLen: DWORD dwVarLength; // Variable length CPro: DWORD dwVarProperty; // Variable property internal/external CFor: DWORD dwFormat; // Format conversion Protocol: P1 : BOOL bTopLimitErr; // error in top limit P2 : BOOL bBottomLimitErr; // error in bottom limit P3 : BOOL bTransformationErr; // transformation error P4 : BOOL bWriteErr; // write error P5 : BOOL bWriteErrApplication; P6 : BOOL bWriteErrProzess; Limits values LF1: double dTopLimit; LF2: double dBottomLimit; LF3: double dStartValue; LF4: double dSubstituteValue; Limits flags L1 : BOOL bTopLimit; // use substitute value on top limit L2 : BOOL bBottomLimit; // use substitute value on bottom limit L3 : BOOL bStartValue; // use substitute value on start L4 : BOOL bConnectionErr; // use substitute value on error connection L5 : BOOL bTopLimitValid; // value top limit is valid L6 : BOOL bBottomLimitValid; // value bottom limit is valid L7 : BOOL bStartValueValid; // value start is valid L8 : BOOL bSubstValueValid; // value substitute is valid Values for the field Ctyp ------------------------- BIT 1 SBYTE 2 BYTE 3 SWORD 4 WORD 5 SDWORD 6

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 24: WinCC SmartTools Tutorial

Variable Export/Import 03.04

20 Printout of the Online Help

Smart Tools

DWORD 7 FLOAT 8 DOUBLE 9 TEXT_8 10 TEXT_16 11 RAW 12 ARRAY 13 STRUCT 14 BITFIELD_8 15 BITFIELD_16 16 BITFIELD_32 17 TEXTREF 18 Description of connection fields -------------------------------- Conname: char szConnection[MAX_DM_CONNECTION_NAME +3]; Unit: char szUnitName [MAX_DM_UNIT_NAME+1]; Common: char szCommon [MAX_DM_CON_COMMON +1] Specific: char szSpecific [MAX_DM_CON_SPECIFIC +1] ;

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 25: WinCC SmartTools Tutorial

03.04 The Tag Simulator

Printout of the Online Help 21

Smart Tools

3 The Tag Simulator

3.1 Brief Description

The Tag Simulator is used to simulate internal tags and tags.

A typical area of application for the Tag Simulator is the testing of a configuration without connected process peripherals or with connected process but without a running process.

Without connected process , only internal tags can be simulated.

If the process has been connected, the Tag Simulator can supply values directly to the process tags. This allows you to perform a function test of the HMI system using the original hardware.

The updating time for tag values is one second. A modification takes effect on activating the functions or changing the project folder.

A maximum of 300 tags can be configured.

Another possible application for the Tag Simulator is the implementation of a project for demonstration purposes. A process connection is often not available for the presentation of the HMI system. In these cases, the simulation will control the internal tags.

A detailed description of the Tag Simulator can be found in the corresponding online help.

Safety Note: The Tag Simulator writes the process values to the connected PLC. This means that a reaction of any connected process must be considered.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 26: WinCC SmartTools Tutorial

The Tag Simulator 03.04

22 Printout of the Online Help

Smart Tools

3.2 Usage of the Tag Simulator

A typical area of application for the Tag Simulator is the testing of a configuration without connected process peripherals or with connected process peripherals but without a running process.

3.2.1 Simulation of Tags without Process Peripherals

Without connected process peripherals, only internal tags can be simulated. To simulate the process off-line, the following procedure is recommended:

1. Make a backup copy of your project by copying your project folder and renaming it to, for example, xxx_sim. Use this backup copy as your test object. Open WinCC with this copied project.

2. Use the functions “Cut” and “Paste” to add the tags, which you want to simulate, to the internal tags. Do not use “Copy” and “Paste”, otherwise WinCC Explorer will automatically generate an extension to the tag names to ensure that they are unique in the project. The address information of the tags that are declared as internal tags will thus be lost.

3. With the aid of the simulator, the tags can now be supplied with values. 4. Once the test phase is over, you can continue your work with the original

project.

3.2.2 Simulation of Tags with Process Peripherals Connected

If process peripherals have been connected, the simulator can supply values directly to the process tags. This allows you to perform a function test of the HMI system using the original hardware, such as e.g.

checking limit value levels or the output of messages.

Test the continuity of alarms, warnings, error messages and check status displays.

Preset, read and modify digital and analog inputs and outputs.

Alarm Simulation.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 27: WinCC SmartTools Tutorial

03.04 The Tag Simulator

Printout of the Online Help 23

Smart Tools

3.3 The Simulator Functions

The simulator provides 6 different functions to support the project engineer. With these functions, it is possible to supplied the configured object with realistic values.

To support the testing of different cases, the simulator has 6 functions. Each individual tag can be assigned to one of these 6 functions.

Sine

As a nonlinear periodic function.

Oscillation

To simulate jumps in a control input.

Random

The Random function delivers randomly generated values.

Increment

An up counter that restarts at its minimum value once it has reached its maximum.

Decrement

A down counter that restarts at its maximum value once it has reached its minimum.

Slider

A slider with which the user can set a fixed value.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 28: WinCC SmartTools Tutorial

The Tag Simulator 03.04

24 Printout of the Online Help

Smart Tools

3.4 Installing the Simulator

The Tag simulator can be installed in two different ways:

Procedure

1. Select "User defined" during setup of WinCC. The "Components" dialog will open.

2. Click in the left-hand window on the "Smart tools" component. Select "EasyLanguage" in the right-hand window.

3. Click on the "Next" button. Follow the instructions in the dialogs. The Tag simulator is started by "SIMATIC" > "WinCC" > "Tools".

Alternative Procedure

You can also install the Tag simulator application from the WinCC CD.

1. Switch to the WinCC CD in the directory "WinCC\Setup\Products\CC_Smarttools\". Double-click setup.exe.

2. Select the entry "WinCC Tag Simulator" in the "Components" dialog. 3. Click on the "Next" button. Follow the instructions in the dialogs.

3.5 Starting the Simulator

The simulator Simulation.exe can either be started via Windows Explorer, or you can enter it in the startup list of WinCC Explorers, whereby it will automatically start whenever a project is activated.

An activated project in WinCC Explorer is required for the proper operation of the simulator. If the simulator has been added to the startup list of the project, this prerequisite is satisfied automatically.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 29: WinCC SmartTools Tutorial

03.04 The Tag Simulator

Printout of the Online Help 25

Smart Tools

3.6 Add/Remove Tags

Add a New Tag

Via the menu commands "Edit/New Tag", tags can be added to the simulation. For this purpose, the tag selection dialog of the WinCC Explorer will be called, in which the desired tags from the active project can be selected. If new tags are to be created, this can be performed in the tag selection dialog as well. By confirming the selection via the "OK" button, the previously selected tag will be entered into the "Properties" tab of the simulator. There it can also be specified, in which manner the tag value is to change.

For the final transfer into the simulator, the "Tags" tab has to be selected before adding the next tag.

The configured tag simulation can be saved in a configuration file with the file extension "sim".

Removing a Tag

To remove a tag from the list of the simulator, select the tag and then the menu commands "Edit/Remove Tag". The selected tag will then be deleted from the list of simulated tags without asking for further confirmation.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 30: WinCC SmartTools Tutorial

The Tag Simulator 03.04

26 Printout of the Online Help

Smart Tools

3.7 Configurability of the Functions

The parameters of the functions can be set individually for each tag.

Sine

For the Sine function the value range can be set using the Amplitude parameter.

The zero point for the value range can be specified with Offset.

The period is set with the Oscillation Period parameter (set value * Cycle Time).

Oscillation

The Setpoint parameter is used to set the value to which the function settles.

The Damping parameter specifies how much the value can deviate from the setpoint when the damping is set to zero.

The Oscillation Period specifies the time interval. After the time interval elapses, the oscillation will begin again.

Random

The parameters Low Limit und High Limit are used to specify the interval for the random numbers.

Increment

The parameters Start Value and Stop Value are used to specify the Interval for the up counter.

Decrement

The parameters Start Value and Stop Value are used to specify the Interval for the down counter.

Slider

The parameters Min and Max are used to set the adjustment range of the slider.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 31: WinCC SmartTools Tutorial

03.04 The Tag Simulator

Printout of the Online Help 27

Smart Tools

3.8 Activate/Deactivate Tags

To insure a smooth transition from offline configuration to online configuration, each of the tags can be individually activated or deactivated via their own check box.

If a tag is activated, its value will be calculated by the simulation and passed to WinCC Explorer.

If the check box is not marked, the simulation will not pass any value WinCC Explorer.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 32: WinCC SmartTools Tutorial

The Tag Simulator 03.04

28 Printout of the Online Help

Smart Tools

3.9 Displaying the Tags

To simplify the control of the tags during the configuration phase, the following information will be shown on the "Tags" card:

• Current WinCC project

• Name of the Tag

• Assigned function

• Status (active / inactive)

• Current saved value

If the name of a tag is selected, additional parameters will be shown on the "Properties" card.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 33: WinCC SmartTools Tutorial

03.04 The Tag Simulator

Printout of the Online Help 29

Smart Tools

3.10 Load/Save Simulation Data

The simulation data can be saved to be available the next time that the simulator is started. This done using the menu items "File/Save", or "File/Save as...".

A simulation configuration that has been saved can be loaded using the menu item "File/Open".

When the simulator is started, the last configuration used for this WinCC project will be loaded.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 34: WinCC SmartTools Tutorial

The Tag Simulator 03.04

30 Printout of the Online Help

Smart Tools

3.11 FAQ

Error with DM-API, DLL not found

If an error related to DLL's occurs while starting the simulator, it may be that the necessary path information has not been added to the AUTOEXE.BAT. Please check if the following entry is present in the path statement of this file:

SET PATH = .....;“WinCC-Drive”:\“WinCC-Directory”\bin

e.g: SET PATH=C:\SIEMENS\WINCC\BIN;

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 35: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 31

Smart Tools

4 Dynamic Wizard Editor

4.1 Brief Description

The Dynamic Wizard Editor is a tool for creating your own Dynamic Wizards. With Dynamic Wizards, you can automate repetitive configuration sequences.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 36: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

32 Printout of the Online Help

Smart Tools

4.2 Method of Operation

The Dynamic Wizard brings additional functionality to Graphics Designer. It assists the user in handling frequently reoccurring configuration sequences. This reduces the configuration effort and the risk of configuration errors.

The Dynamic Wizard consists of a variety of Dynamic Wizard functions. A large number of Dynamic Wizard functions are already supplied. And these can be further extended with functions that you create yourself.

An editor is included for creating your own Dynamic Wizard functions. This editor is the program dynwizedit.exe.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 37: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 33

Smart Tools

All of the Dynamic Wizard functions are stored in a data basis (...\WinCC\wscript\Dynwiz.cwd) on the hard disk. The Dynamic Wizard has a standardized display and user-interface for selecting and parameterizing the Dynamic Wizard functions. After a Dynamic Wizard function has been selected, Dynamic Wizard will load it into memory and start it.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 38: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

34 Printout of the Online Help

Smart Tools

Dynamic Wizard and the Dynamic Wizard Functions – The Interface

The link between Dynamic Wizard and the Dynamic Wizard function is made using a system interface in the Dynamic Wizard function. The structure of this interface is defined. This interface contains information, which Dynamic Wizard can evaluate. The fundamental content of the interface is:

Reference to the process function

The process function is the intended function of the Dynamic Wizard. It contains the "service", which a Dynamic Wizard function offers the user, e.g. the creation of an action on a graphic object.

Options List

The Options List defines the parameters, which are required for the process function. They also define how they are specified via the dialog's user interface.

Trigger List

The Trigger List defines the trigger, which should be linked to the generated object. They also define how they are specified via the dialog's user Interface.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 39: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 35

Smart Tools

4.3 Installation

The Dynamic Wizard Editor can be installed in two different ways:

Procedure

1. Select "User defined" during setup of WinCC. The "Components" dialog will open.

2. Click in the left-hand window on the "Smart tools" component. Select "Dynamic Wizard Editor" in the right-hand window.

3. Click on the "Next" button. Follow the instructions in the dialogs. The Dynamic Wizard Editor is started by "SIMATIC" > "WinCC" > "Tools".

Alternative Procedure

You can also install the Dynamic Wizard Editor from the WinCC CD.

1. Switch to the WinCC CD in the directory "WinCC\Setup\Products\CC_Smarttools\". Double-click setup.exe.

2. Select "Dynamic Wizard Editor" in the "Components" dialog. 3. Click on the "Next" button. Follow the instructions in the dialogs.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 40: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

36 Printout of the Online Help

Smart Tools

4.4 Structure

Dynamic Wizard Editor has the following elements:

Menu Bar

The menu bar contains the functions of the Dynamic Wizard Editor. The menu bar is always visible.

Toolbar

The toolbar can be made visible when needed and can be moved to any place on the screen.

Editing Window

The Editing window is only visible, when a Dynamic Wizard function is open for editing or a new one is being created. Each function will be opened in its own Editing window. Several editing windows can be open at the same time.

Output Window

The Output window can be displayed when needed. It contains the results of the "Generate CWD", "Read Wizard Script" and "Compile Script" functions.

Status Bar

The status bar can be displayed when needed. It provides information about the keyboard settings and gives the position of the text cursor in the Editing window.

Dynamic Wizard

The Dynamic Wizard allows you to use C actions to dynamize an object. When the Wizard is executed previously prepared C actions and trigger events are specified and stored in the object's properties

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 41: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 37

Smart Tools

4.4.1 Toolbar

Introduction

The toolbars enable you to execute actions quicker. You do not have to make several selections through the menus until you reach the required function.

Icons

Icon Explanation

Creates a new Dynamic Wizard function.

Opens an existing Dynamic Wizard function (*.wnf).

Saves the Dynamic Wizard function.

Cuts the marked text and copies it onto the clipboard.

Copies the marked text onto the clipboard.

The content of the clipboard will be pasted at the location of the text cursor.

Prints the contents of the active editing window.

Displays more information about Dynamic Wizard Editor.

Creates the Dynamic Wizard data (CWD). This function is used to read in all available Wizard scripts for the currently set language and prepare them for editing in the Dynamic Wizard. The generated file is stored in the WinCC installation path (Installation path\wscripts\dynwiz.cwd).

Reads the Wizard scripts and makes them available to the Dynamic Wizard.

Sets the language in which the Wizard script will be configured. The languages supported in WinCC are made available, independent of the installed languages. Changing the Wizard language does not affect the overall system or the configuration interface.

Changes the object. The Dynamic Wizard, which is also available in the editor for test purposes, is dependent on the various properties of an object in the Graphics Designer. To test a new or an existing Wizard script, this function can be used to switch to an existing object in an existing picture. Using the newly selected object, the Dynamic Wizard is

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 42: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

38 Printout of the Online Help

Smart Tools

Icon Explanation adjusted to display only those Wizard scripts which are applicable to this object.

Displays all of the Dynamic Wizard scripts for the selected language. Additionally, in this dialog box, existing Wizard Scripts can be deleted from the list.

Opens the Help Editor

Compiles the script.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 43: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 39

Smart Tools

4.4.2 Editing Window

Introduction

Dynamic Wizard functions are created and edited in the Editing window.

Color coding

Color codes the displayed C code as follows:

Color Meaning Example blue Keyword #define, void green Comments // this is a comment red Strings "First Element" black other C code OnOption1

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 44: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

40 Printout of the Online Help

Smart Tools

4.4.3 Help Editor

Introduction

Using this dialog box, a help text can be stored for each page generated by the Wizard script. It is only possible to store a help text for an existing Dynamic Wizard.

Elements of the Help Editor

Element Explanation Wizard Group The list box is used to specify the group (= tabbed card) in which

the Dynamic Wizard is found. Wizard Name The list box is used to specify the Dynamic Wizard for which the

help text will be created. Page The list box is used to specify the dialog page for which the help

text will be created. Help Text The help text is entered in this field.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 45: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 41

Smart Tools

4.4.4 Output Window

Introduction

The Output window contains the results of the "Generate CWD", "Read Wizard Script" and "Compile Script" functions.

The Output window is of assistance when searching for errors in the scripts.

If there is an error in a script, the displayed message will appear as follows:

...\WinCC\wscripts\wscripts.enu\DemoWiz1.wnf(6):error(003a): 'include': invalid function definition

Description: ...\WinCC\wscripts\wscripts.enu\ The directory in which the "*.wnf" file

is saved. DemoWiz1.wnf(6) The file name and line number in

which the error occurred. error(003a): 'include': invalid function definition

Error number and description of the error.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 46: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

42 Printout of the Online Help

Smart Tools

4.5 Structure of a Dynamic Wizard Function

Introduction

A Dynamic Wizard function must have a predefined structure. It is structured in accordance with the necessary components.

1. Linking Header Files and DLL's 2. Language Dependent Definition 3. Wizard Flags 4. Properties List 5. System Interface 6. Global Variables 7. Options List 8. Trigger List 9. Display of the Parameterization

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 47: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 43

Smart Tools

4.5.1 Dynamic Wizard Dialog

Introduction

Each Dynamic Wizard function has its own specific functionality. Thanks to the fact that functions have a predefined structure, all functions have a similar sequence and dialog user interface. The Dynamic Wizard dialog consists of several dialog pages.

• Dialog "Welcome to the Dynamic Wizard"

• Dialog "Select Trigger"

• Dialog "Set Options"

• Dialog "Finished!"

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 48: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

44 Printout of the Online Help

Smart Tools

4.5.2 Linking Header Files and DLL's

Introduction

A header file contains declarations of constants, data types, variables and functions.

The header files are linked to the function with the #include instruction. The most important link is to the dynamic.h file, which declares among others the functions that are used to design the user interface of the Dynamic Wizard.

DLL files (Dynamic Link Library) are executable routines, which can be loaded by a program, when it needs their functionality.

The DLL files are linked to the function with a #pragma instruction so that they can be used.

The following paths are set in the Dynamic Wizard Editor:

WinCC's header files: ...\WinCC\aplib\

DLL's of WinCC: ...\WinCC\bin\

If the files are in another directory, the full path must be given in the #include and #pragma instructions.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 49: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 45

Smart Tools

4.5.3 Language Dependent Definitions

Introduction

The standard functions of the Dynamic Wizard functions are available in three languages; German, English and French. When the language is switched in WinCC Explorer, the corresponding language version of the Dynamic Wizard functions is also selected.

Within the paths

..\WinCC\wscripts\wscripts.deu

..\WinCC\wscripts\wscripts.enu

..WinCC\wscripts\wscripts.fra

a WNF file must exist for each Wizard function.

When created, all language dependent definitions should be arranged in this section. This makes it easier to create other language versions.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 50: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

46 Printout of the Online Help

Smart Tools

4.5.4 Wizard Flags

Introduction

These Flags are used to define configuration type for which the Dynamic Wizard function applies.

Flags

Flag WIZARD_FLAG_OCX For all OCX files WIZARD_FLAG_ALL_PROJECT_TYPES For all projects WIZARD_FLAG_SINGLEUSER_PROJECT For single-user projects only WIZARD_FLAG_MULTICLIENT_PROJECT For client projects only WIZARD_FLAG_MULTIUSER_PROJECT For clients without project data only

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 51: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 47

Smart Tools

4.5.5 Properties List

Introduction

In the properties list, you can specify the types of objects for which the Dynamic Wizard function can be used. This is accomplished by entering a list of object properties. If an object has at least one of the listed properties, the Dynamic Wizard function can be used on this object.

Each entry in the Properties List consists of two parameters:

• The name of the property e.g. Backcolor

• WinCC Data Type

If the Properties List is empty, the Dynamic Wizard function can be used on all object types. The properties list must be present in every case even if it is empty.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 52: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

48 Printout of the Online Help

Smart Tools

4.5.6 System Interface

Introduction

The System Interface is used to set the properties of the new Dynamic Wizard function.

Parameter Description

Explanation 1 The first parameter specifies the tabbed card on which the Dynamic Wizard

function should appear. 2 The second parameter specifies the name under which the Dynamic Wizard

function should appear. 3 The third parameter is always NULL. 4 The fourth parameter gives the name of the icon that should be used for the

Dynamic Wizard function. 5 The fifth parameter is a help text with a more detailed description of the

functionality of the Dynamic Wizard function. 6 The sixth parameter is a list of the names of the functions created for the

individual option pages. This list must be terminated with a NULL entry. A maximum of five option pages can be created. For more information, please see "Options List".

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 53: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 49

Smart Tools

Explanation 7 The seventh parameter is the name of the processing function, which will be

called when the "Finish" button is clicked. The process function is the intended function of the Dynamic Wizard. It contains the "service", which a Dynamic Wizard function provides for the user, e.g. the creation of an action on a graphic object.

8 The eighth parameter is the name of the function, which summarizes the settings made on the option pages and is shown to the user before they click on the "Finish" button. For more information, please see "Display the Parameterization".

9 The ninth parameter is a list of the triggers to be shown on the trigger selection dialog. For the most common applications, there are macros which will complete the trigger list. For more information, please see "Trigger List".

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 54: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

50 Printout of the Online Help

Smart Tools

4.5.7 Global Variables

Introduction

A global variable must be defined for each parameter that is set on the option pages. In this manner, the parameters that are set will be known and available for use in all of the functions that are created.

It is only possible to pass data between system functions by using global variables. This is always necessary when trigger and/or option parameters must be passed to the processing function.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 55: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 51

Smart Tools

4.5.8 Options List

Introduction

Options are parameters, which are necessary for the functionality of the Dynamic Wizard function. Options do not require a trigger.

Options are defined in the system interface's Options List. The Options List includes – for each option – the name of the associated options function e.g. "OnOption1".

The Options List is terminated by a NULL pointer. A maximum of five options may be defined in the list.

Options Function

Dynamic Wizard lists the options functions one after the other in accordance with their order in the Options List. The "Set Options" dialog will be displayed for each options function. This dialog is then used to program the user interface of the Dynamic Wizard.

Wizard system functions are used for programming the Dynamic Wizard. For more information, please see "Wizard-System-Funktionen".

In the "Set Options" dialog, there is an area in which static text, input fields and other input boxes can be arranged.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 56: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

52 Printout of the Online Help

Smart Tools

In the "Set Options" dialog, the area is completely filled by lines 1 to 15.

The associated options function appears as follows:

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 57: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 53

Smart Tools

4.5.9 Trigger List

Introduction

Triggers are only necessary in connection with actions applied to a graphic object.

Triggers are defined in the system interface's Trigger List. The Trigger List contains an entry for each trigger.

Each entry consists of two parameters: The first parameter is the trigger's name, which will be shown on the user interface e.g. press left mouse button. The second parameter gives the name of the associated trigger function.

The Trigger List is terminated by a NULL pointer. A maximum of fifty triggers may be defined in the list.

There are predefined macros for the most frequently used triggers.

Macro JCR_TRIGGERS Trigger event

DECLARE_JCR_TRIGGERS Mouse click, left mouse button, right mouse button

JCR_ZYCL_TRIGGERS Cyclic trigger DECLARE_JCR_ZYKL_TRIGGERS Picture cycle, Window cycle, Upon change, 250 ms, 500 ms, 1 second, 2 seconds, 5 seconds, 10

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 58: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

54 Printout of the Online Help

Smart Tools

seconds, 1 minute, 5 minutes, Custom cycle 1, Custom cycle 2, Custom cycle 3, Custom cycle 4, Custom cycle 5

JCR_ACTION_TRIGGERS

Action trigger DECLARE_JCR_ACTION_TRIGGERS

The "Select trigger" dialog is generated from the Trigger List. All of the trigger names are displayed for selection in a list box.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 59: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 55

Smart Tools

After a trigger has been selected, the Dynamic Wizard will call the associated trigger function.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 60: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

56 Printout of the Online Help

Smart Tools

4.5.10 Display of the Parameterization

Introduction

Trigger and options parameters can be viewed in the "Finished !" dialog. In this manner, the user has the possibility of checking the parameterization again and, if necessary, correcting it.

The Windows SetWindowText function can be used to output a text in the display field in the "Finished!" dialog. The display field is 12 lines high.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 61: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 57

Smart Tools

4.5.11 Wizard Functions for Parameter Entry

4.5.11.1 CreateStatic

Introduction

In the "Set Options" dialog, a static text will be displayed at the coordinates x,y.

Syntax

HWND CreateStatic (int x, int y, char* "Text")

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. char* Text Gives the text, which should be output.

Return Value

Return Value HWND Returns the handle of the object.

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 62: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

58 Printout of the Online Help

Smart Tools

char* DynWizEditStatic = "Enter text:"; ... .. void OnOption1(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; ..... if (bFirst == TRUE) { strcpy(g_szEdit,DynWizEdit); bFirst = FALSE; } //Static Text CreateStatic(0,5,DynWizEditStatic); ..... ...... }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 63: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 59

Smart Tools

4.5.11.2 CreateEdit

Introduction

In the "Set Options" dialog, an input field will be displayed at the coordinates x,y. A text can be entered in the input field.

Syntax

HWND CreateEdit ( int x, int y, char* pText )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. char* pText Pointer to an input buffer. The input buffer can be preset to a

value. This will be shown in the input field.

Return Value

Return Value HWND Returns the handle of the object. pText Input buffer contains the entered text.

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. An input field will be displayed in the "Set Options" dialog of the "Demo Wizard".

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 64: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

60 Printout of the Online Help

Smart Tools

char* DynWizEditStatic = "Enter text:"; char* DynWizEdit = "Sample text"; ... .. char g_szEdit[256]; void OnOption1(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; ..... if (bFirst == TRUE) { strcpy(g_szEdit,DynWizEdit); bFirst = FALSE; } //Static text for the input field CreateStatic(0,5,DynWizEditStatic); //Input field hWnd = CreateEdit(0,20,g_szEdit) GetWindowRect(GetParent(hWnd), &rect); MoveWindow(hWnd,0,20,(rect.right-rect.left),21,TRUE); ..... ...... }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 65: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 61

Smart Tools

4.5.11.3 CreateSpinEdit

Introduction

In the "Set Options" dialog, an input field with a knob will be displayed at the coordinates x,y.

The input field is used to enter an integer value in the input variable.

Syntax

HWND CreateSpinEdit (int x, int y, int* pValue, int Min, int Max, int Base )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. int* pValue Pointer to an integer input variable. The input variable can

be preset to a default value. int Min Lower limit for the input value int Max Upper limit for the input value int Base Numerical format for the input:

10 = decimal entries 16 = hexadecimal entries

Return Value

Return Value HWND Returns the handle of the object. pValue Input variable contains the entered text.

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. An input field with a knob will be displayed in the Demo Wizard's "Set Options" dialog. You can set a value between 0 and 1000 in this field.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 66: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

62 Printout of the Online Help

Smart Tools

char* DynWizSpinStatic= "Enter a value (0 - 1000):"; char* DynWizEdit = "Sample text"; ... ... char g_szEdit[256]; void OnOption1(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; ..... if (bFirst == TRUE) { strcpy(g_szEdit,DynWizEdit); bFirst = FALSE; } ... ... //Static text for the input field with knob CreateStatic(0,50,DynWizSpinStatic); ... //Input field with knob hWnd = CreateSpinEdit(0,65,&g_iSpinEdit,0,1000,10); MoveWindow(hWnd,0,65,(rect.right-rect.left)/4,21,TRUE); ... ... }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 67: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 63

Smart Tools

4.5.11.4 CreateListBox

Introduction

In the "Set Options" dialog, a list box will be displayed at the coordinates x,y. Several possible entries can be listed for selection in the list box. With a click of the mouse, you can select an entry.

Syntax

HWND CreateListbox (int X, int Y, char* Headline, int NumLines, int* pSelect )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. char* Headline Title of the list box int NumLines Number of lines in a list box. The following must be given:

NumLines = Number of lines + 1 (1 =“ NumLines = “16) int* pSelect Pointer to the results variable

Return Value

Return Value HWND Returns the handle of the object. pSelect The number of the selected entry. The number is the index in

the listing (beginning with 0).

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. A list box will be displayed in the "Set Options" dialog of the "Demo Wizard". The list box can show up to three lines. Since there are more than three entries, a scroll bar will be displayed.

Note: With the "CreateListbox" function, only the list box itself will be created. The content of the lines must be entered with the "SendMessage" function.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 68: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

64 Printout of the Online Help

Smart Tools

char* DynWizListStatic= "Select an entry:"; ... int g_iListBox = 0; //Type definition of the elements in the list box typedef struct listboxItem { int iIndex; char szItemText[256]; }LB_ITEM, *PLB_ITEM; #define LB_NUM_LINES 5 LB_ITEM g_itemListBox[LB_NUM_LINES] = { { 0, "First Element"}, { 1, "Second Element"}, { 2, "Third Element"}, { 3, "Fourth Element"}, { 4, "Fifth Element"} }; void OnOption1(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; .....

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 69: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 65

Smart Tools

if (bFirst == TRUE) { strcpy(g_szEdit,DynWizEdit); bFirst = FALSE; } ... ... //Static text for the list box CreateStatic(0,162,DynWizListStatic); ... //List box hWnd = CreateListbox(0,177,"Headline",LB_NUM_LINES,&g_iListBox); MoveWindow(hWnd,0,177,(rect.right-rect.left),50,TRUE); //With the "CreateListbox" function, only the box itself will be created. The content of the lines must be //entered with the "SendMessage" function. for (i=0; i“LB_NUM_LINES; i++) { SendMessage(hWnd,LB_INSERTSTRING,(WPARAM)-1,(LPARAM)g_itemListBox[i].szItemText); } }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 70: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

66 Printout of the Online Help

Smart Tools

4.5.11.5 CreateCheckBox

Introduction

In the "Set Options" dialog, a check box will be displayed at the coordinates x,y. The check box can be used to activate an option. Multiple check boxes can be used in a single dialog.

Syntax

HWND CreateCheckBox (int x, int y, char* Text, BOOL* pSelect )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. char* Text Text, which is displayed to the right of the check box. BOOL* pSelect Pointer to the results variable The results variable should be

preset to a default value (True/False).

Return Value

Return Value HWND Returns the handle of the object. pSelect Activation status

FALSE = not activated TRUE = activated

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. In the Demo Wizard's "Set Options" dialog, three check boxes will be displayed, which each represent one option. Each option can be activated individually.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 71: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 67

Smart Tools

BOOL g_bCheck1 = TRUE; BOOL g_bCheck2 = TRUE; BOOL g_bCheck3 = TRUE; void OnOption1(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; ..... if (bFirst == TRUE) { ... } ... ... //Check Boxes iMid = (rect.right-rect.left)/2 ; CreateCheckBox(iMid,100,"CheckBox 1",&g_bCheck1); CreateCheckBox(iMid,116,"CheckBox 2",&g_bCheck2); CreateCheckBox(iMid,132,"CheckBox 3",&g_bCheck3 }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 72: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

68 Printout of the Online Help

Smart Tools

4.5.11.6 CreateFrame

Introduction

A rectangular frame will be displayed in the "Set Options" dialog. The upper left corner of the frame is set by the coordinates x,y. The lower right corner of the frame is identical with the lower right corner of the options dialog.

Syntax

HWND CreateFrame (int x, int y, char* Title )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. char* Title The title in the upper edge of the frame

Return Value

Return Value HWND Returns the handle of the object.

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. A frame with the title "Frame" will be displayed in the Demo Wizard's "Set Options" dialog.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 73: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 69

Smart Tools

void OnOption2(void) { //Frames CreateFrame(0,150,"Frame"); } ... ...

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 74: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

70 Printout of the Online Help

Smart Tools

4.5.11.7 CreateRadioButton

Introduction

In the "Set Options" dialog, a radio button will be displayed at the coordinates x,y. The radio button can be used to activate an option.

It is only reasonable to use a radio button when multiple radio buttons are used in a single dialog. Only one radio button can be active at a time.

Syntax

HWND CreateRadioButton (int x, int y, char* Text, BOOL* pSelect )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. char* Text The name of the option that is activated with the radio button.

The text will appear to the right of the radio button. BOOL* pSelect Pointer to the results variable The results variable should be

preset to a default value (True/False).

Return Value

Return Value HWND Returns the handle of the object. pSelect Activation status

FALSE = not activated TRUE = activated

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. In the Demo Wizard's "Set Options" dialog, three radio buttons will be displayed, which each represent one option. Only one option can be activated.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 75: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 71

Smart Tools

BOOL g_bOption1 = TRUE; BOOL g_bOption2 = FALSE; BOOL g_bOption3 = FALSE; void OnOption1(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; ..... if (bFirst == TRUE) { ... } ... ... //Radio Buttons CreateRadioButton(0,100,"RadioButton 1",&g_bOption1); CreateRadioButton(0,116,"RadioButton 2",&g_bOption2); CreateRadioButton(0,132,"RadioButton 3",&g_bOption3); }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 76: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

72 Printout of the Online Help

Smart Tools

4.5.11.8 CreateFileBrowser

Introduction

In the "Set Options" dialog, a browse button will be displayed at the coordinates x,y. A file name can be entered in the input field.

Clicking on the browse button opens a file selection dialog.

Syntax

HWND CreateFileBrowser (int x, int y, DWORD Flags, char* Filter, char* file name )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. DWORD Flags Control flags for the selection window:

FB_WITHPATH = file name with path FB_SAVE_AS = Instead of the "Open" dialog, the "Save as" dialog will appear.

char* Filter Filter for the display of data types in the file selection dialog's list box. By specifying the extension, you can specify the data type that will be displayed in the list box. A filter consists of a pair of strings. The first string is the

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 77: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 73

Smart Tools

Parameter Explanation filter name. The second string is the filter function in the form *.typ, where ‘typ’ is a file extension. Only those files that have this extension will be displayed in the list box. The first and second string are separated by a "|". Multiple filters can be chained, separated by a "|". The last filter will be terminated by a "||". Examples: char* Filter1 = "Graphic pictures (*.PDL) | *.PDL||";

char* Filter2 = "Documents (*.doc) | *.doc|" "Text files *.txt | *.txt|" "WNF files | *.wnf|" "All files (*.*) | *.*||";

No spaces are permitted at the end of the filter function.

char* File_name Input buffer for the file name. A path name can be preset as the default value. This default value has the following effect: The path name will be displayed by default in the input field. If you click on the browse button, the path will be set in the file selection dialog. If the file name has the extension ‘*.typ’, all of the files of this type will displayed in the list box.

Return Value

Return Value HWND Returns the handle of the object. File name Input buffer contains the file name

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. In the Dialog Wizard's "Set Options" dialog, an input field will be displayed with a browse button. With a click on the browse button, the file selection dialog will open.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 78: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

74 Printout of the Online Help

Smart Tools

char* DynWizFileBrowserStatic = "Select a file:"; char* DynWizFileBrowser = "C:\\Example_File"; char* DynWizFilter = "Text files (*.txt) | *.txt|" "All files (*.*) | *.*||"; ... char g_szFileBrowser[256]; ... void OnOption2(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; RECT rect; ... if (bFirst == TRUE) { ... strcpy(g_szFileBrowser,DynWizFileBrowser); First = FALSE; } ... ... //Static text for the input field with a browse button CreateStatic(0,95,DynWizFileBrowserStatic); //File Selection Dialog hWnd = CreateFileBrowser(0,110,FB_WITHPATH,DynWizFilter,g_szFileBrowser); MoveWindow(hWnd,0,110,(rect.right-rect.left),21,TRUE); }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 79: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 75

Smart Tools

4.5.11.9 CreateVarBrowser / CreateVarBrowserEx

Introduction

In the "Set Options" dialog, a browse button will be displayed at the coordinates x,y. A variable name can be entered in the input field. With a click on the browse button, WinCC's variable selection dialog will open. With the "CreateVarBrowserEx" function, it is also possible to parameterize a filter for variables. This filter is then used to restrict which variables are displayed in the variables selection dialog. It is possible to filter on the basis of data type, variable group, variable name and connection.

Syntax

HWND CreateVarBrowser (int x, int y, char* VarName )

HWND CreateVarBrowserEx (int x, int y, LPDM_VARFILTER VarFilter, char* VarName )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. LPDM_VARFILTER VarFilter Optional entry of a pointer to a variable filter. If a

NULL pointer is entered, no filter will be activated. The variable filter must be defined with the DM_VARFILTER structure. For further information, please see the WinCC ODK documentation.

char* VarName Contains the name of the variable. The variable name can be preset to a default value. This input will always be displayed.

Return Value

Return Value HWND Returns the handle of the object. VarName Input buffer contains the variable name

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. In the Dialog Wizard's "Set Options" dialog, an input field will be displayed

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 80: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

76 Printout of the Online Help

Smart Tools

with a browse button. With a click on the browse button, WinCC's variable selection dialog will open.

char* DynWizVarBrowser = "Example variable"; char* DynWizPicBrowserStatic = "Select a picture:"; ... char g_szVarBrowser[256]; ... void OnOption2(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; RECT rect; ... if (bFirst == TRUE) { ... strcpy(g_szVarBrowser,DynWizVarBrowser); First = FALSE; } ... ... //Static text for the input field with a browse button CreateStatic(0,95,DynWizFileBrowserStatic); //Variable Selection Dialog hWnd = CreateFileBrowser(0,110,FB_WITHPATH,DynWizFilter,g_szFileBrowser);

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 81: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 77

Smart Tools

GetWindowRect(GetParent(hWnd), &rect); MoveWindow(hWnd,0,110,(rect.right-rect.left),21,TRUE); }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 82: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

78 Printout of the Online Help

Smart Tools

4.5.11.10 CreatePackageBrowser/CreatePackageBrowserEx

Introduction

In the "Set Options" dialog, a browse button will be displayed at the coordinates x,y. A name can be entered in the input field. The Package browser is activated by the browse button on the right edge of the input field. The type of data, Which should be displayed from the package, is specified by the flag or the ProgID.

With the "CreatePackageBrowserEx" function, you can pass a ProgID instead of a flag.

Syntax

HWND CreatePackageBrowser (int x, int y, DWORD flags, char* Name )

HWND CreatePackageBrowserEx (int x, int y, char* ProgID, char* Name )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. DWORD flags Currently only PB_PICTURE can be used. This

activates the picture selection. char* ProgID The Program ID of the component for which the

selection will be setup. If "WinCC.CCFileASOStub.1" is passed, the picture selection will be chosen.

char* Name Contains the name. The name can be preset to a default value. This input will always be displayed.

Return Value

Return Value HWND Returns the handle of the object. Name Input buffer contains the name

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. In the Dialog Wizard's "Set Options" dialog, an input field will be displayed with a browse button. With a click on the browse button, the picture selection dialog will open.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 83: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 79

Smart Tools

char* DynWizPicBrowserStatic = "Select a picture:"; char* DynWizPicBrowser = "Example picture"; ... char g_szPicBrowser[256]; ... void OnOption2(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; RECT rect; ... if (bFirst == TRUE) { ... 	strcpy(g_szPicBrowser,DynWizPicBrowser); First = FALSE; } ... ... //Static text for the input field with a browse button CreateStatic(0,50,DynWizPicBrowserStatic); //Picture Selection Dialog hWnd = CreatePackageBrowser(0,65,PB_PICTURE,g_szPicBrowser); MoveWindow(hWnd,0,65,(rect.right-rect.left),21,TRUE); }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 84: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

80 Printout of the Online Help

Smart Tools

4.5.11.11 CreateObjectBrowser

Introduction

In the "Set Options" dialog, a browse button will be displayed at the coordinates x,y. An object or a property name can be entered in the input field. With a click on the browse button, a selection dialog will open. You can search for and select an object or a property name in the selection dialog.

Syntax

HWND CreateObjectBrowser (int x, int y, char* Title, DWORD flags, char* ObjectName )

Parameter

Parameter Explanation int x Gives the value of the x-coordinate. int y Gives the value of the y-coordinate. char* title Title of the selection dialog. DWORD flags Two different flags can be passed:

OB_OBJECTS Display all objects OB_PROPERTIES Also show the properties.

char* ObjectName Input buffer for the object or property name. The input buffer can be preset to a default value.

Return Value

Return Value HWND Returns the handle of the object. ObjectName Input buffer contains the object or property name.

Example

The following excerpt from the "Demo.wnf" file demonstrates the use of this function. In the Dialog Wizard's "Set Options" dialog, an input field will be displayed with a browse button. With a click on the browse button, the window object selection dialog will open.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 85: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 81

Smart Tools

char* DynWizObjectBrowserStatic = "Select an object:"; char* DynWizObjectBrowser = "Object"; char* DynWizObject = "Window object selection"; ; ... char g_szObjectBrowser[256]; ... void OnOption2(void) { static BOOL bFirst = TRUE; HWND hWnd = NULL; RECT rect; ... if (bFirst == TRUE) { ... strcpy(g_szObjectBrowser,DynWizObjectBrowser); First = FALSE; } ... //Static text for the input field with a browse button CreateStatic(0,50,	CreateStatic(0,140,DynWizObjectBrowserStatic);); //Window Selection Dialog hWnd = CreateObjectBrowser(0,155,DynWizObject,OB_OBJECTS,g_szObjectBrowser); MoveWindow(hWnd,0,155,(rect.right-rect.left),21,TRUE); }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 86: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

82 Printout of the Online Help

Smart Tools

4.5.12 Wizard functions for generating dynamics

4.5.12.1 GenerateBLOB

Introduction

The GenerateBLOB (BLOB = Binary Large OBject) function creates an action, which can be linked to a property of a graphic object. An action consists of 3 parts.

Prolog: This is the head of the C function.

Example: #include "apdefap.h" void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y) { The prolog depends on the trigger, which is used to start the action (in the example above: press left mouse button)

Epilog: This is the end of the C function and consists of the character ‘}’.

Root segment: This part contains the actual functionality of the C function. Example: ProgramExecute("notepad.exe");

The function generates and compiles the action's C code. The results of the compilation is a p-code. This will be interpreted and processed by the WinCC Runtime system. In the event that the C code has errors, no p-code will be generated.

The function generates a BLOB in which the parts of the action (i.a. C code, p-code, trigger, ...) are save. Before the Wizard function quits, the BLOB must be deleted. For further information about deleting the BLOB function, please see "DeleteBLOB".

Syntax

AP_BLOB GenerateBLOB (char* Prolog, char* Epilog, char* Format, ... )

Parameter

Parameter Explanation char* Prolog Prolog of the action as ASCII string. char* Epilog Epilog of the action as ASCII string. char* Format The root segment of the action as an ASCII string or format

string in accordance with the standard function "printf".

Note: The C code is generated with the C function "sprintf". The parameter is treated as a format string, therefore format control characters (e.g. \ % ") will be evaluated. If these should be placed in the C code (e.g. as a format string for a "printf" call in an action), you must precede them with a "\".

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 87: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 83

Smart Tools

Example: \ \ \ % \% " \"

Return Value

The function returns a structured variable of the type AP_BLOB with the following structure components:

Structure Component Return Value DWORD dwPCodeSize Length (in bytes) of the generated p-code LPVOID lpPCode Pointer to the generated p-code int nErrors Number of compiler errors int nWarnings Number of compiler warnings

Example

The following excerpt out of the "Execute Programm.wnf" file demonstrates the use of this function. The Wizard function generates a C script that starts another application (in the example: notepad.exe).

...

... void OnGenerate(void) { PCMN_ERROR pError; AP_BLOB *blob; char code[500]; char sError[500]; .. Slash2DblSlash(g_Bild, strlen(g_Bild)); .. sprintf(code,"%sProgramExecute(\"%s\");",ifcode,g_Bild); .. //Prolog blob = GenerateBLOB("#include \"apdefap.h\"\r\n" "void OnClick(char* lpszPictureName," "char*lpszObjectName,char* lpszPropertyName," "UINT nFlags,int x, int y) {", //Epilog "}", //Root segment code); BEGIN_JCR_BLOBERRORS SetAction(NULL, blob, g_Trigger);

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 88: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

84 Printout of the Online Help

Smart Tools

END_JCR_BLOBERRORS DeleteBLOB(blob); }

Generated C script:

#include "apdefap.h" void OnLButtonDown(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y) { ProgramExecute("notepad.exe"); }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 89: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 85

Smart Tools

4.5.12.2 DeleteBLOB

Introduction

The GenerateBLOB function generates a BLOB. At the end of the Wizard function, the BLOB must be deleted. The DeleteBLOB function is used to delete the BLOB.

Syntax

void DeleteBLOB (AP_BLOB* blob)

Parameter

Parameter Explanation AP_BLOB* blob Pointer to the "GenerateBLOB" function's result

variable.

Example

DeleteBLOB(blob);

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 90: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

86 Printout of the Online Help

Smart Tools

4.5.12.3 SetAction

Introduction

An action will be hanged on the specified trigger of the selected graphic object.

If the trigger is an event, it will be specified directly in the calling parameter.

If the dynamisation of a property serves as the trigger, the trigger must first be registered in the BLOB with the AddVarTrigger or AddTimeTrigger function.

Note: If the action should not be linked to the selected object, but rather another object, the API function PDLCSSetAction must be used. For further information about the PDLCSSetAction function, please see the WinCC ODK documentation.

Syntax

BOOL SetAction (char* Property, AP_BLOB* Blob, DWORD Trigger )

Parameter

Parameter Explanation char* Property Name of the property. Always use the English name of the

property. In the case of an event trigger, always pass a NULL pointer.

AP_BLOB* Blob Pointer to the event variable of the "GenerateBLOB" function.

DWORD TriggerID ID of the trigger: NOTDEFINED = Trigger is registered in the BLOB MOUSECLICK = Mouse click MOUSELBUTTONDOWN = Press left mouse button MOUSELBUTTONUP = Release left mouse button MOUSERBUTTONDOWN = Press right mouse button MOUSERBUTTONUP = Release right mouse button KEYBOARDDOWN = Press keyboard key KEYBOARDUP = Release keyboard key OBJECTCHANGE = Object changed PROPERTYCHANGE = Property changed PICTUREOPEN = Picture selection PICTURECLOSE = Picture deselection

Return Value

Return Value BOOL Return value TRUE = function successfully executed.

FALSE = function not successfully executed.

Example

See the example in the GenerateBLOB function

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 91: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 87

Smart Tools

4.5.12.4 AddTimeTrigger

Introduction

The function adds a "Cyclical Trigger" to the action.

Syntax

BOOL AddTimeTrigger (AP_BLOB* Blob, char* Name, DWORD TriggerType, DWORD GraphCycleType, DWORD CycleID )

Parameter

Parameter Explanation AP_BLOB* Blob Pointer to the "GenerateBLOB" function's results

variable. char* Name Name of the event. This can be any ASCII string.

The name will be displayed in the action's window as the event name.

DWORD TriggerType Type of cyclical trigger: 2 = Time cycle (standard cycle) 4 = Graphic object cycle

DWORD GraphCycleType Type of graphic object cycle: 0= Window cycle 1 = Picture cycle

DWORD CycleID Trigger cycle: 0 = Upon change 1 = 250 ms 2 = 500 ms 3 = 1 s 4 = 2 s 5 = 5 s 6 = 10 s 7 = 1 min 8 = 5 min 9 = 10 min 10 = 1 h 11 = Custom cycle 1 12 = Custom cycle 2 13 = Custom cycle 3 14 = Custom cycle 4 15 = Custom cycle 5

Return Value

Return Value BOOL TRUE = function successfully executed.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 92: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

88 Printout of the Online Help

Smart Tools

Return Value FALSE = function not successfully executed.

Example

The time between two occurrences of the action is 1s.

BOOL FctRet; .. FctRet = AddTimeTrigger(blob, "1 sec", 2, 0, 3);

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 93: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 89

Smart Tools

4.5.12.5 AddVarTrigger/AddVarTriggerEx

Introduction

The function adds a "Variable Trigger" to the action.

Syntax

BOOL AddVarTrigger (AP_BLOB* Blob, char* EventName, char* VarName )

BOOL AddVarTriggerEx (AP_BLOB* Blob, char* EventName, char* VarName, DWORD CycleID )

Parameter

Parameter Explanation AP_BLOB* Blob Pointer to the "GenerateBLOB" function's results

variable. char* EventName Name of the event. This can be any ASCII string.

The name will be displayed in the action's window as the event name.

char* VarName The name of the WinCC variable, which triggered the event or is involved in the triggering.

DWORD CycleID Trigger cycle: 0 = Upon change 1 = 250 ms 2 = 500 ms 3 = 1 s 4 = 2 s 5 = 5 s 6 = 10 s 7 = 1 min 8 = 5 min 9 = 10 min 10 = 1 h 11 = Custom cycle 1 12 = Custom cycle 2 13 = Custom cycle 3 14 = Custom cycle 4 15 = Custom cycle 5 For the AddVarTrigger function, the value CycleID = 4 is fixed.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 94: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

90 Printout of the Online Help

Smart Tools

Return Value

Return Value BOOL TRUE = function successfully executed.

FALSE = function not successfully executed.

Example

You have entered the variable ‘StartTurbine1’ as the trigger in the "Variable Trigger". The action will start as soon as the value of this variable changes.

BOOL FctRet FctRet = AddVarTriggerEx(blob,"Turbine Start","StartTurbine1",0);

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 95: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 91

Smart Tools

4.5.12.6 SetValidateFct

Introduction

The name of a validate function will be passed to the Dynamic Wizard. With the validate function, it is possible to check the options and trigger parameters. In the event of a negative result, it is possible to request that they be reentered.

The validate function will be called, when the "Continue" button is clicked on in the "Select Options" dialog or the "Set Trigger" dialog. In the event that the results are positive, the current dialog will be closed and the next will be displayed. In the case of a negative result, the current dialog remains open. The proper parameter must be entered before it is possible to continue.

The validate function is effective from the time that it is set in the Dynamic Wizard. It is then also effective for the later Options dialogs. If no or a different validate function should be effective, a dummy function (with positive validation results) or another validate function must be set.

Syntax

BOOL SetValidateFct (LPCSTR FctName)

Parameter

Parameter Explanation LPCSTR FctName Name of the validate function as an ASCII string.

Return Value

Return Value BOOL Results of the validation check

TRUE = positive results. FALSE = negative results.

Example

The following excerpt from the "Instanzobjekt.wnf" file demonstrates the use of this function.

The Wizard function has been extended by a validation function.

... ... // Validation Option 1 BOOL ValidateOpt1(void)

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 96: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

92 Printout of the Online Help

Smart Tools

{ // Property Selected return (strcmp(g_NewInst, "")); } void OnOption1(void) { HWND hWnd; RECT rect; DM_VARFILTERdmFilter = {DM_VARFILTER_TYPE, 1, NULL, NULL, NULL, NULL}; SetValidateFct("ValidateOpt1"); sprintf(g_NewInst, ""); .. }

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 97: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 93

Smart Tools

4.5.12.7 EnumProperty/EnumPropertyEx

Introduction

The EnumProperty function lists the properties of an object. With the EnumPorpertyEx function, you can specify the properties to be listed for an object.

Syntax

BOOL EnumProperty (char* FName, LPVOID pItem, DWORD dwFlags );

BOOL EnumPropertyEx (LPCTSTR Projectname, LPCTSTR Picturename, LPCTSTR Objectname, char* FName, LPVOID pItem, DWORd dwFlags );

Parameter

Parameter Explanation LPCTSTR Projectname Pointer to the name of the project, including the

directory and file extension. LPCTSTR Picturename Pointer to the name of the picture, whose objects

should be listed. A distinction is made between upper and lowercase.

LPCTSTR Objectname Pointer to the name of the object char* FName Name of your callback function, which should be

called once for every object property. LPVOID pItem Pointer to application-specific data, which is

passed to the callback function. This pointer will not be evaluated by the function, rather is made available to the callback function.

DWORD dwFlags dwFlags specify the property types to be listed. Currently, the following entries are possible: PropertyHasDynamic (Value: 0x0001)	The list will only contain object properties which have a dynamic. PropertyHasEvents (Value: 0x0002)	The list will only contain object properties, which have an event. PropertyIsDynamicable (Value: 0x0003)	The list will only contain object properties, which are dynamicable.

Return Value

Return Value BOOL TRUE = Lists the properties of an object

FALSE = Error

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 98: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

94 Printout of the Online Help

Smart Tools

Example

The following excerpt out of the "Dynamic Property.wnf" file demonstrates the use of this function.

... ... // Callback Function BOOL EnumFct(char *property, VARTYPE vt, LPVOID pItem) { sprintf(g_prop[SendMessage((HWND)pItem,LB_INSERTSTRING,(WPARAM)-1,(LPARAM)property)],property); return TRUE; } void OnOption1(void) { HWND hWnd,LBHwnd; RECT rect; static BOOL bFirst = TRUE; if(bFirst) { ... } ... CreateStatic(0, 10,"Properties of the current object :"); LBHwnd=CreateListbox(0, 30, g_Headline, 8, &g_indexProperty); EnumProperty("EnumFct", LBHwnd, 3); GetWindowRect(GetParent(LBHwnd), &rect); ...

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 99: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 95

Smart Tools

4.5.13 Wizard WinCC Functions

4.5.13.1 GetProjectName

Introduction

Determines the path of the current WinCC project.

Syntax

LPCSTR GetProjectName ( void )

Return Value

Return Value LPCSTR Pointer to the ASCII string of the MCP file

Example

LPCSTR Name; Name = GetProjectName();

The function returns e.g. the following result: C:\Siemens\WinCC\WinCCProjects\Example.mcp

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 100: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

96 Printout of the Online Help

Smart Tools

4.5.13.2 GetPictureName

Explanation

The name of the current picture (*.pdl) will be determined.

Syntax

LPCSTR GetPictureName ( void )

Return Value

Return Value LPCSTR Pointer to the ASCII string of the PDL file

Example

LPCSTR Name; Name = GetPictureName();

The function returns e.g. the following result: TurbineControl.PDL

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 101: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 97

Smart Tools

4.5.13.3 GetDefaultWNFPath

Explanation

Determines the path of the current WNF directory.

Syntax

LPCSTR GetDefaultWNFPath ( void )

Return Value

Return Value LPCSTR Pointer to the ASCII string with the path name

Example

LPCSTR Name; Name = GetDefaultWNFPath();

The function returns e.g. the following result: C:\Siemens\WinCC\wscripts\wscripts.enu\

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 102: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

98 Printout of the Online Help

Smart Tools

4.5.13.4 GetObjectName

Introduction

Determines the name of the graphic object selected in the current picture.

Syntax

LPCSTR GetObjectName ( void )

Return Value

Return Value LPCSTR Pointer to the ASCII string with the object name

Example

LPCSTR Name; Name = GetObjectName();

The function returns e.g. the following result: Button1

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 103: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 99

Smart Tools

4.5.13.5 InsertXRefSection

Explanation

The function inserts a section in accordance with the Xref-notation in to the source code, so that the variables and picture names that are passed are entered as defines.

Syntax

BOOL InsertXRefSection (char * SourceCode, char* TagName[], int TagCount, char* PictName[], int PictCount)

Parameter

Parameter Explanation char *SourceCode Code buffer, in which the Xref section should be

inserted char *TagName[] NULL or a field of variable names, which should

be inserted in the Xref section. int TagCount The number of variable names in the field

TagName[] char *PictName[] NULL or a field of picture names, which should be

inserted in the Xref section. int PictCount The number of picture names in the field

PictName[]

Return Value

Return Value BOOL The return value tells whether the function was

successfully executed. char *TagName[] The field of the defines for the variables given in

the same location char *PictName[] The field of the defines for the pictures given in

the same location

Example

char* szPictureArray[1]; char szPictName[255]; char szSourceCode[1100];

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 104: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

100 Printout of the Online Help

Smart Tools

strcpy(szPictName, "Newpdl.pdl"); szPictureArray[0] = szPictName; strcpy(szSourceCode, ""); InsertXrefSection(szSourceCode,NULL,0,szPictureArray,1);

The function returns the following result:

szSourceCode:

// WINCC:TAGNAME_SECTION_START // syntax: #define TagNameInAction "DMTagName" // next TagID : 1 // WINCC:TAGNAME_SECTION_END // WINCC:PICNAME_SECTION_START

// syntax: #define PicNameInAction "PictureName" // next PicID : 1 #define PIC_0 " Newpdl.Pdl" // WINCC:PICNAME_SECTION_END szPictureArray[0]: "PIC_0"

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 105: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 101

Smart Tools

4.5.14 Wizard Progress Functions

Introduction

The progress functions serve to display the progress (in %) of a processing procedure in a "Progress Box".

When creating the progress display (CreateProgressDlg), the beginning and ending values plus an increment must be defined. The beginning value corresponds to a progress of 0%, the ending value a progress of 100%. The increment specifies the steps in which the progress can change.

As a rule, the beginning value = 0 and the increment = 1. The ending value is the number of steps in the procedure.

For each processing step the progress will be increased by one increment (Progress_StepIt) or set to a defined value (Progress_SetPos).

At the end of the processing procedure, the progress display must be cleared (DestroyProgressDlg).

A text can be displayed in the progress display (Progress_SetStatus), e.g. the text "Creating the graphic object". This can also be changed during the processing procedure to distinguish between the parts of the procedure.

As a rule, it is not possible to divide the processing procedure so that the display presents the progress as a linear function in time. However, this is also not necessary. The fact that the display indicates that progress is being made is adequate.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 106: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

102 Printout of the Online Help

Smart Tools

4.5.14.1 CreateProgressDlg

Introduction

In a progress display, the progress of a processing procedure will be presented in a range of 0..100%.

Syntax

PROGRESS_DLG CreateProgessDlg (int nLower, int nUpper, int nStepInc )

Parameter

Parameter Explanation int nLower Beginning value of the progress (corresponds to 0

%) int nUpper Ending value of the progress (corresponds to 100

%) int nStepInc Increment of progress

Return Value

Return Value PROGRESS_DLG Handle of the object

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 107: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 103

Smart Tools

4.5.14.2 Progress_SetStatus

Explanation

A text will be entered in the progress display as a title.

Syntax

void Progress_SetStatus (PROGRESS_DLG hDlg, char* ActionName )

Parameter

Parameter Explanation PROGRESS_DLG hDlg Handle of the object char* ActionName Text of the title

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 108: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

104 Printout of the Online Help

Smart Tools

4.5.14.3 Progress_Steplt

Explanation

The progress of a processing procedure will be increased by one increment.

Syntax

void Progress_Steplt (PROGRESS_DLG hDlg )

Parameter

Parameter Explanation PROGRESS_DLG hDlg Handle of the object

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 109: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 105

Smart Tools

4.5.14.4 Progress_SetPos

Explanation

In a progress display, the progress will be set to defined value. This value must lie between the beginning and ending values.

Syntax

void Progress_SetPos (PROGRESS_DLG hDlg, int nPos )

Parameter

Parameter Explanation PROGRESS_DLG hDlg Handle of the object int nPos Value of the progress

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 110: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

106 Printout of the Online Help

Smart Tools

4.5.14.5 DestroyProgressDlg

Introduction

The progress display will be closed.

Syntax

void DestroyProgressDlg (PROGRESS_DLG hDlg )

Parameter

Parameter Explanation PROGRESS_DLG hDlg Handle of the object

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 111: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 107

Smart Tools

4.5.15 Wizard Windows Functions

Introduction

The following presents a brief description of the Windows functions, which can or must be used in conjunction with the Wizard system functions (in particular for entering parameters in the window functions).

For further information, please see the Microsoft Developers Studio /Win32 SDK Programmer’s Reference.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 112: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

108 Printout of the Online Help

Smart Tools

4.5.15.1 GetParent

Introduction

Determines the handle of the parent window e.g. the handle of the Options window.

Syntax

HWND GetParent (HWND hWnd )

Parameter

Parameter Explanation HWND hWnd The handle of the window for which the parent

window should be determined.

Return Value

Return Value HWND Handle of the parent window

NULL = There is no parent window.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 113: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 109

Smart Tools

4.5.15.2 GetWindowRect

Introduction

Determines the size and coordinates of a window e.g. the size of the Options window.

Syntax

BOOL GetWindowRect (HWND hWnd, LPRECT lpRect )

Parameter

Parameter Explanation HWND hWnd Handle of the window LPRECT lpRect Pointer to a structured results variable

Return Value

Return Value BOOL TRUE = function successfully executed.

FALSE = function not successfully executed. LPRECT lpRect Structured results variable of the LPRECT

structure with the structure components: LONG left: x-coordinate of the upper, left corner LONG top: y-coordinate of the upper, left corner LONG right: x-coordinate the lower, right corner LONG bottom: y-coordinate the lower, right corner

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 114: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

110 Printout of the Online Help

Smart Tools

4.5.15.3 MoveWindow

Introduction

The position and dimensions of a window will be changed e.g. the position and the size of the input fields in the Options window.

Syntax

BOOL MoveWindow (HWND hWnd, int x, int y, int nWidth, int nHeight, BOOL bRepaint )

Parameter

Parameter Explanation HWND hWnd Handle of the window int x x-coordinate of the upper, left corner int y, y-coordinate of the upper, left corner int nWidth Width int nHeight Height BOOL bRepaint TRUE = The window will be repainted.

Return Value

Return Value BOOL TRUE = function successfully executed.

FALSE = function not successfully executed.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 115: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 111

Smart Tools

4.5.15.4 SendMessage

Introduction

A message will be sent to a window. The function will e.g. be used to fill a list box.

Syntax

LRESULT SendMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam )

Parameter

Parameter Explanation HWND hWnd Handle of the window UINT Msg, Type of message:

LB_INSERTSTRING = Insert text in a list box WPARAM wParam 1. Message parameter:

-1 = The text will be appended at the end. LPARAM lParam 2. Message parameter:

Pointer to the text

Return Value

Return Value LRESULT Handle of the object

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 116: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

112 Printout of the Online Help

Smart Tools

4.5.15.5 GetWindow

Introduction

Determines the handle of the window that is in a specific relationship with another window (original window).

Syntax

GetWindow (HWND hWnd, UINT uCmd )

Parameter

Parameter Explanation HWND hWnd Handle of the original window UINT uCmd Relationship

GW_HWNDFIRST = top window

Return Value

Return Value HWND Handle of the window found or NULL

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 117: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 113

Smart Tools

4.5.15.6 ShowWindow

Introduction

Sets the type of a window's display.

Syntax

ShowWindow (HWND hWnd, int nCmdShow )

Parameter

Parameter Explanation HWND hWnd Handle of the window int nCmdShow The window's display status

SW_HIDE = not visible

Return Value

Return Value BOOL TRUE = window was visible

FALSE = window was not visible

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 118: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

114 Printout of the Online Help

Smart Tools

4.5.15.7 MessageBox

Introduction

The function serves to display a message to the user, when an error has occurred or user intervention is necessary.

The message will be displayed with user-specific message text, title and button.

Syntax

int MessageBox (HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType )

Parameter

Parameter Explanation HWND hWnd Handle of the parent window

NULL = Message has no parent window. LPCTSTR lpText Message text LPCTSTR lpCaption Text of the title UINT uType Type of box

MB_OK = Message with an ‘OK’ button MB_OKCANCEL = Message with two buttons – ‘OK’ and ‘Cancel’

Return Value

Return Value int ID of the activated button:

IDOK = ‘OK’ button activated IDCANCEL = ‘Cancel’ button activated

Example

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 119: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 115

Smart Tools

int RetMsg; RetMsg = MessageBox (NULL, "Error when calling the API functions", "System error", MB_OK);

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 120: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

116 Printout of the Online Help

Smart Tools

4.6 Examples

Introduction

In the course of this description, we will create two examples of Dynamic Wizard functions.

4.6.1 Demo Wizard

Introduction

In the "Demo.wnf" file, we will create a Dynamic Wizard named "Demo" Wizard. This Dynamic Wizard shows the basic functions that are available to enable the user to conveniently enter data. The Demo Wizard, however, does not perform an action.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 121: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 117

Smart Tools

4.6.1.1 How to create the Dynamic Wizard function for the demo Wizard

Prerequisite

A WinCC project must be open.

Procedure

Procedure 1 In the Windows Explorer copy the "Demo.wnf" file from the directory

"Siemens\ WinCC\ documents\ german" to the directory "Siemens\ WinCC\ wscript\ wscript.deu".

2 Start the Dynamic Wizard Editor. 3 On the File menu of the Dynamic Wizard Editors select "Open". The file

selection dialog box opens. 4 Mark the "Demo.wnf" file. Click "Open". The "Demo.wnf" file is displayed in

the editor window. 5

Click the icon in the toolbar to compile the script. The result is displayed in the output window.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 122: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

118 Printout of the Online Help

Smart Tools

4.6.1.2 How to add the "Demo.wnf" script to the data basis

Introduction

In order to use the Dynamic Wizard function "Demo.wnf" in Graphics Designer, this must be linked into the Dynamic Wizard's data basis.

To accomplish this, the following steps are necessary,

1. Read the Wizard script 2. Create the cwd file

Procedures

Steps 1

Click on the icon in the toolbar. The file selection dialog box will open. 2 Select the "Demo.wnf" file. Click on the "Open" button. 3

Click on the icon in the toolbar to regenerate the data basis. 4 In the "View" menu in the Dynamic Wizard Editor, select "Dynamic Wizard".

5 Click on the tabbed card "Example". Double-click on the entry "Demo

Wizard".

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 123: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 119

Smart Tools

4.6.1.3 How to create the help text

Introduction

In this section, we will create a help for the "Select Trigger" dialog.

Procedures

Steps 1

Click on the icon in the toolbar. The help editor will open. 2 In the field "Wizard - Group", select "Example". 3 In the field "Wizard - Name", select "Demo Wizard". 4 In the field "Page" , select "TriggerPage" 5 In the "Help - Text:" field enter the following text: "Select trigger

In this dialog, you can specify the event for which an action should be performed."

6 Click on "OK" to close the help editor. 7 Run the Demo Wizard. In the "Select Trigger" dialog, click on the "Help"

button.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 124: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

120 Printout of the Online Help

Smart Tools

4.6.2 Making Motor dynamic

Introduction

In the "Motor.wnf" script file, a Dynamic Wizard called "Make Motor Dynamic" is created.

Note: This was created especially to make a user object call Motor dynamic and cannot be applied to any other kind of object.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 125: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 121

Smart Tools

4.6.2.1 How to create the Dynamic Wizard function for the Motor

Prerequisite

A WinCC project must be open.

Procedure

Procedure 1 In Windows Explorer open the "Motor.zip" Winzip file in the directory

"Siemens\ WinCC\ documents\ german". 2 Extract the "Motor.wnf" file into the directory

"..\WinCC\wscripts\wscripts.deu". 3 Extract the "Motor_dyn.pdl" file into the directory

"..\WinCC\WinCCProjects\Name desWinCCProjekts\GraCs". 4 Start the Dynamic Wizard Editor. 5 On the File menu of the Dynamic Wizard Editors select "Open". The file

selection dialog box opens. 6 Mark the "Motor.wnf" file. Click "Open". The "Motor.wnf" file is displayed in

the editor window. 7

Click the icon in the toolbar to compile the script. The result is displayed in the output window.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 126: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

122 Printout of the Online Help

Smart Tools

4.6.2.2 How to add the "Motor.wnf" script to the database

Introduction

To be able to use the Dynamic Wizard function "Motor.wnf" in the Graphics Designer, this must be integrated into the database of the Dynamic Wizard.

To do this, the following steps are necessary,

1. Importing the Wizard script 2. Creating the cwd file

Procedure

Procedure 1

Click the icon on the toolbar. The file selection dialog box opens. 2 Select the "Motor.wnf" file. Click "Open". 3

Click the icon on the toolbar to create the new database.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 127: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 123

Smart Tools

4.6.2.3 Making the Customized Object "Motor" Dynamic

Introduction

The Motor customized object is linked to a WinCC structure tag of structure type "MotorStruct" via the "Dynamic Motor" dynamic wizard. The various C-actions and tag connections are created on this object. This wizard cannot be used on other object types.

Prerequisite

• Create an internal tag "T08i_course_wiz_selected" of data type "Text Tag 8-bit character set".

• Create a structure with the name "MotorStruct" and three internal elements called "Active", "Hand" and "Error" with data type BIT.

• Create an internal tag named "STR_Course_wiz1" of data type "MotorStruct".

Procedure

Procedure 1 Open the Graphics Designer. Select the "File" menu then the "Open" option.

Select the "Motor_dyn.pdl" picture in file selection dialog. 2 Select the Motor customized object. The "Example" tab control offers the

"Dynamic Motor" wizard.

3 Start the Dynamic Wizard. Click on the "Continue" button in the "Welcome to

the Dynamic Wizard" dialog. The "Set options" dialog opens up. 4 Click on the Browse button in the "Set options" dialog. The tag selection

dialog opens. Select "STR_Course_wiz1" as the structure tag. Click "OK" to close the dialog.

5 Click on the Continue button in the "Set options" dialog. The "Finished!" dialog opens. Click on "Finish" button to close the dialog.

6 Save the picture. Start the Graphics Designer Runtime.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 128: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

124 Printout of the Online Help

Smart Tools

Procedure 7 The buttons can be used to simulate the tag values of the selected motor.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 129: WinCC SmartTools Tutorial

03.04 Dynamic Wizard Editor

Printout of the Online Help 125

Smart Tools

4.6.2.4 How to create the structure and the structure variables

Introduction

In this section, we will show how the "MotorStruc" structure and the structure variable "STR_Course_wiz1" are configured. The structure and the structure variable are used in the example "Motor dynamization" verwendet.

Procedures

Steps 1 In the "Structure types" popup menu, select "New structure type" aus. The

"Structure Properties" dialog will open 2 Rename the structure to "MotorStruc". Click on the "New Element" button

and create an internal variable "Active" with the data type "BIT". 3 Click on the "New Element" button and create an internal variable "Hand"

with the data type "BIT". 4 Click on the "New Element" button and create an internal variable "Error"

with the data type "BIT". Click on "OK" to close the dialog. 5 In the Navigation window, click on the "+" in front of the "Tag Management"

icon. In the "Internal Variables" popup menu, select "New Variable". Create a WinCC variable "STR_Course_wiz1" with the data type "MotorStruc".

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 130: WinCC SmartTools Tutorial

Dynamic Wizard Editor 03.04

126 Printout of the Online Help

Smart Tools www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 131: WinCC SmartTools Tutorial

03.04 WinCC Documentation Viewer

Printout of the Online Help 127

Smart Tools

5 WinCC Documentation Viewer

5.1 Brief Description

Print jobs from the WinCC report system can be rerouted to a file. For larger amounts of data, a file is generated for each report page.

With the WinCC Documentation Viewer, these files can be displayed and printed out.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 132: WinCC SmartTools Tutorial

WinCC Documentation Viewer 03.04

128 Printout of the Online Help

Smart Tools

5.2 Installing WinCC Documentation Viewer

The WinCC Documentation Viewer can be installed in two different ways:

Procedure

1. Select "User defined" during setup of WinCC. The "Components" dialog will open.

2. Click in the left-hand window on the "Smart tools" component. Select "WinCC Documentation Viewer" in the right-hand window.

3. Click on the "Next" button. Follow the instructions in the dialogs. The WinCC Documentation Viewer is started with "SIMATIC" > "WinCC" > "Tools".

Alternative Procedure

You can also install the WinCC Documentation Viewer from the WinCC CD.

1. Switch to the WinCC CD in the directory "WinCC\Setup\Products\CC_Smarttools\". Double-click setup.exe.

2. Select the entry "WinCC Documentation Viewer" in the "Components" dialog. 3. Click on the "Next" button. Follow the instructions in the dialogs.

Note: If a WinCC project is in runtime, only the "emf" files of this project can be viewed and printed out. If WinCC is not active, all "emf" files can be opened and printed out with the WinCC Documentation Viewer.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 133: WinCC SmartTools Tutorial

03.04 WinCC Documentation Viewer

Printout of the Online Help 129

Smart Tools

5.3 Description

Print jobs from the WinCC report system can be rerouted to a file. For larger amounts of data, a file is generated for each report page.

With the WinCC Documentation Viewer, these files can be displayed and printed out.

Note: If a WinCC project is already activated when starting the WinCC WinCC Documentation Viewer, only the emf files of the activated WinCC project can be displayed and printed out. If a WinCC project is open - but not activated - when starting the Viewer, all emf files can be displayed and printed out. When deactivating runtime, the viewer will always be closed.

The WinCC Documentation Viewer is divided into three areas:

At the top, you find the menu bar. Via the Direct Help, menu command explanations can be displayed.

The toolbar is located directly below the menu bar. Frequently used function such as going to the next or previous page are accessible via icons. Via the Direct Help, icon explanations can be displayed.

In the window, the current document will be displayed. The display can be magnified in two levels via the mouse.

At the bottom, you will find the status bar, which displays information about the current operation.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 134: WinCC SmartTools Tutorial

WinCC Documentation Viewer 03.04

130 Printout of the Online Help

Smart Tools

5.4 Creating the emf file(s)

Introduction

Print jobs from the WinCC report system can be rerouted to a file. For larger amounts of data, a file is generated for each report page. The print output takes place in one or more ".emf" files. The files are named <nnnnn>.emf and stored in the path, where <nnnnn> represents a sequential, five-digit number.

The name of the path is made up of the following components: of the project path (e.g. "C:\VFSWinCC\PRT\") and <Tray> + <YYYYMMDDHHMM> (YYYY = Year, MM = Month, DD = Day, HH = Hour, MM = Minute).

If you enter "PDdaten" in the "Tray" field, the following path structure will be created for the print job within the project folder.

Procedures

Steps 1 Within the WinCC editors, select the "Project Documentation Setup"

command from the "File" menu. 2 In the "Print Job Properties" dialog, click on the "Printer Setup" tab. 3 On the "Printer Setup" tabbed card, mark the "File (*.emf)" check box. If you

do not want send the output to the printer at the same time, deactivate the "Printer" check box.

4 In the "Tray" field, enter the path in which the file should be saved. Close this dialog via the "OK" button.

5 In the "File" menu, select "Print project documentation". The print output takes place in one or more ".emf" files. The files will be saved in the path with the names Page<nnnnnn>.emf, where <nnnnn> is a sequential, five-digit number.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 135: WinCC SmartTools Tutorial

03.04 WinCC CrossReferenceAssistant

Printout of the Online Help 131

Smart Tools

6 WinCC CrossReferenceAssistant

6.1 Brief Description

WinCC CrossReferenceAssistant is a tool which browses scripts for picture names and tags and supplements the relevent scripts so that the WinCC component Cross Reference finds the picture names and tags and then lists them in the cross reference list.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 136: WinCC SmartTools Tutorial

WinCC CrossReferenceAssistant 03.04

132 Printout of the Online Help

Smart Tools

6.2 Installation

The WinCC CrossReferenceAssistant has a German, English and French user interface.

Procedure

1. Select "Customized" when installing WinCC. The "Components" dialog box opens.

2. In the left window, click the component "Smarttools". Select the " WinCC CrossReferenceAssistant" entry in the right window.

3. Click "Next". Follow the instructions in the dialog boxes. To start the WinCC CrossReferenceAssistant, go to "SIMATIC" > "WinCC" > "Tools".

Alternative Procedure

It is also possible to install the WinCC CrossReferenceAssistant from the WinCC CD.

1. Switch to the WinCC CD in the directory "WinCC\Setup\Products\CC_Smarttools\". Double-click setup.exe.

2. Select the "CrossReferenceAssistant" entry in the "Components" dialog. 3. Click "Next". Follow the instructions in the dialog boxes.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 137: WinCC SmartTools Tutorial

03.04 WinCC CrossReferenceAssistant

Printout of the Online Help 133

Smart Tools

6.3 General

WinCC is able to create CrossReference lists. So that the tags in the function calls are recognized properly when creating these lists, WinCC was extended by a configuration rule which provides the following:

To be able to search and replace the tag and picture names ued in the C actions, the script must be written as follows:

At the beginning of the script, all tags and picture names used must be declared in two sections.

These sections are structured as follows:

// WINCC:TAGNAME_SECTION_START // syntax: #define TagNameInAction DMTagName // next TagID : 1 #define ApcTagName1 "TagName1" // WINCC:TAGNAME_SECTION_END

// WINCC:PICNAME_SECTION_START // syntax: #define PicNameInAction PictureName // next PicID : 1 #define ApcPicName1 "PicName1" #define ApcPicName2 "PicName2" #define ApcPicName3 "PicName3" // WINCC:PICNAME_SECTION_END

You must call the default functions to read and write the tags via the defined tags and pictures.

GetTagDWord (ApcTagName1); OpenPicture(ApcPicName1); SetPictureName( ApcPicName2, "PicWindow1", ApcPicName3);

If the configuration rule is not followed, no CrossReference lists can be created because the tag and picture references in the scripts cannot be resolved.

With the aid of the WinCC CrossReferenceAssistant all function calls known in the Script Managment are replaced by the format described above. Only project functions, pictures and actions are converted.

The Runtime environment for the WinCC CrossReferenceAssistant is WinCC. If WinCC is not running or the project to be converted is not loaded, WinCC is started by the WinCC CrossReferenceAssistant or the project is loaded.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 138: WinCC SmartTools Tutorial

WinCC CrossReferenceAssistant 03.04

134 Printout of the Online Help

Smart Tools

6.4 Known Functions (Script Management)

By default, the following functions are recognized by the Wizard and will be converted:

Functions with tags as parameters:

GetTagBit()

GetTagByte()

GetTagChar()

GetTagDouble()

GetTagDWord()

GetTagFloat()

GetTagRaw()

GetTagSByte()

GetTagSDWord()

GetTagSWord()

GetTagWord()

SetTagBit()

SetTagByte()

SetTagChar()

SetTagDouble()

SetTagDWord()

SetTagFloat()

SetTagRaw()

SetTagSByte()

SetTagSDWord()

SetTagSWord()

SetTagWord()

GetTagBitWait()

GetTagByteWait()

GetTagCharWait()

GetTagDoubleWait()

GetTagDWordWait()

GetTagFloatWait()

GetTagRawWait()

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 139: WinCC SmartTools Tutorial

03.04 WinCC CrossReferenceAssistant

Printout of the Online Help 135

Smart Tools

GetTagSByteWait()

GetTagSDWordWait()

GetTagSWordWait()

GetTagWordWait()

SetTagBitWait()

SetTagByteWait()

SetTagCharWait()

SetTagDoubleWait()

SetTagDWordWait()

SetTagFloatWait()

SetTagRawWait()

SetTagSByteWait()

SetTagSDWordWait()

SetTagSWordWait()

SetTagWordWait()

GetTagBitState()

GetTagByteState()

GetTagCharState()

GetTagDoubleState()

GetTagDWordState()

GetTagFloatState()

GetTagRawState()

GetTagSByteState()

GetTagSDWordState()

GetTagSWordState()

GetTagWordState()

SetTagBitState()

SetTagByteState()

SetTagCharState()

SetTagDoubleState()

SetTagDWordState()

SetTagFloatState()

SetTagRawState()

SetTagSByteState()

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 140: WinCC SmartTools Tutorial

WinCC CrossReferenceAssistant 03.04

136 Printout of the Online Help

Smart Tools

SetTagSDWordState()

SetTagSWordState()

SetTagWordState()

GetTagBitStateWait()

GetTagByteStateWait()

GetTagCharStateWait()

GetTagDoubleStateWait()

GetTagDWordStateWait()

GetTagFloatStateWait()

GetTagRawStateWait()

GetTagSByteStateWait()

GetTagSDWordStateWait()

GetTagSWordStateWait()

GetTagWordStateWait()

SetTagBitStateWait()

SetTagByteStateWait()

SetTagCharStateWait()

SetTagDoubleStateWait()

SetTagDWordStateWait()

SetTagFloatStateWait()

SetTagRawStateWait()

SetTagSByteStateWait()

SetTagSDWordStateWait()

SetTagSWordStateWait()

SetTagWordStateWait()

Functions with a picture name as a parameter:

SetPictureName()

GetPictureName()

GetVisible()

SetVisible()

GetLink()

SetLink()

Set_Focus()

OpenPicture()

GetLinkedVariable()

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 141: WinCC SmartTools Tutorial

03.04 WinCC CrossReferenceAssistant

Printout of the Online Help 137

Smart Tools

6.5 Project Selection

Clicking "..." opens the OpenFile dialog box which enables you to select any project. By clicking "Current Project", the WinCC CrossReferenceAssistant tries to import and display the project currently loaded in WinCC. If WinCC is not running or no project is loaded, it is started or the required project is loaded.

If a different project is loaded, it is closed and the required project loaded. This proces can possibly take some time.

As soon as text is entered in the input line at the "Select a WinCC Project:" prompt, you can click "Next >". Then the specified project is checked to see whether it is a valid WinCC project. If the project is not valid, the focus is set on the input line and a message window opens with an explanation of the corresponding error.

Clicking "Cancel" exits the WinCC CrossReferenceAssistant.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 142: WinCC SmartTools Tutorial

WinCC CrossReferenceAssistant 03.04

138 Printout of the Online Help

Smart Tools

6.6 File Selection

All pictures, project functions and C actions belonging to the project are displayed in the right list of the dialog box. In the default setting, all files belonging to the project are converted.

The user can decide to exclude certain files from the conversion to possibly add them later. Deleting files from the conversion list is done by (multiple) selection of the corresponding files in the "Files to be converted" list and the clicking the "<--Remove" button.

Deleted files are displayed in the left list and can be added to the conversion again. To do this, the list must be selected in the "Select the files" list. These are then added to the right list "Files to be converted" again after clicking "Add-->".

After selecting the files, click "Next >". The specified files are then read and analyzed.

Clicking < Back takes you back to the Project Selection. Clicking "Cancel" exits the WinCC CrossReferenceAssistant.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 143: WinCC SmartTools Tutorial

03.04 WinCC CrossReferenceAssistant

Printout of the Online Help 139

Smart Tools

6.7 Conversion

The last page of the Wizards one the one hand enables you to make Advanced Settings (see Advanced Settings), and on the other hand to view the progress and the file currently being processed as beginning conversion.

Clicking < Back takes you back to the File Selection. Clicking "Cancel" exits the WinCC CrossReferenceAssistant.

To start sctipt conversion, click Finish. After conversion begins, you cannot go back (< Back), or click Advance Settings.

What percentage of the conversion has been complete is displayed by a progress bar during the conversion. You can also see which file is being currently converted.

During conversion the process is as follows: The scripts are examined for function calls which expect picture or tag parameters. If such a function is found in the script, the character string passed on as parameter is replaced by a define (see Configuration Rules).

Which functions expect picture or tag parameters is checked via a script management file. There all of these functions must be entered in this file and thereby introduced to the system. The list of these functions can also be extended via the script conversion and standard functions which also expect picture and tag parameters (Advanced Settings)

When the conversion is finished, a summay is displayed which provides information about how many function, pictures and scripts in the pictures were converted.

If an error occurs, you can find more detailed information about the error cause by viewing the log file created during conversion. This file is in the project directory and is called CCCrossReferenceAssistant.log.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 144: WinCC SmartTools Tutorial

WinCC CrossReferenceAssistant 03.04

140 Printout of the Online Help

Smart Tools

6.8 Advanced Settings

If required you can activate functions you created yourself.

In the "Select a function with tag and picture parameters:" list all project functions are dislayed. If the "Display Standard Functions" checkbox is activated, the default functions in WinCC are displayed.

The user can select a function from the function list which a tag or picture expects as parameter at a certain position. All functions selected here are included in a project-specific script management file.

The CrossReferenceAssistant only recognizes such functions as funtions with picture and tag parameters which have been introduced to the system as such. So that the calls of customized functions which expect tag parameters, can be adapted in accordance with the Configuration Rules, these must be included in the script management in the course of the conversion.

The "Funktions of the Script Management" dialog box displays all functions already in the script managment. When this dialog box is displayed, the standard and project configuartion files are read out and the common contents of both files displayed.

To now name a function expecting a tag or picture parameter erwartet, you must first select it from the "Select a function with tag or picture parameters:" combination field.

Then using the parameter list you can define whether the special parameter represents a tag or a picture. By clicking "...", a popup menu opens which presents the user with the choice whether the selected parameter is a tag or a picture.

This process must be repeated for all parameters to which both criteria apply.

"Add function -->" confirms the input and adds the selected function to the list on the right side of the dialog box. If you make a mistake, you can undo it by selecting the functions from the "Functions of the script management" list and then using "<-- Remove selected functions" delete them from the list.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 145: WinCC SmartTools Tutorial

03.04 WinCC CrossReferenceAssistant

Printout of the Online Help 141

Smart Tools

By clicking "Close" the group information is written to the configuration files and the changed information in taken into consideration when converting and the dialog box close.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 146: WinCC SmartTools Tutorial

WinCC CrossReferenceAssistant 03.04

142 Printout of the Online Help

Smart Tools www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 147: WinCC SmartTools Tutorial

03.04 Registry Files OnlOff.reg, OnlOn.reg

Printout of the Online Help 143

Smart Tools

7 Registry Files OnlOff.reg, OnlOn.reg

7.1 Brief Description

The options package "Process Control Runtime" includes a start interface, with a button that allows you to call the online help during runtime. From this online help, Windows system operations can be executed, even if they have been locked.

Via the file OnlOff.reg, this access to the Windows system operations can be locked by hiding the button used to activate the online help. If you open this file, the necessary entries will be made to the Windows registry.

To undo this process, open the file "OnlOn.reg". The button for calling the online help will be displayed again.

Installation Procedures

1. Both files are located in the "Smarttools\CC_Onloff" folder on your product CD-ROM.

2. Copy the entire folder "CC_OnlOff" from the product CD-ROM to the path "WinCC\SmartTools" located on the hard drive on which WinCC has been installed.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 148: WinCC SmartTools Tutorial

Registry Files OnlOff.reg, OnlOn.reg 03.04

144 Printout of the Online Help

Smart Tools www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 149: WinCC SmartTools Tutorial

03.04 WinCC Communication Configurator

Printout of the Online Help 145

Smart Tools

8 WinCC Communication Configurator

8.1 Brief Description

The WinCC Communication Configurator (CCComunicationConfigurator.exe) is a tool with which WinCC communication parameters can be set to the available network environment in a simple manner.

8.2 WinCC Communication Configurator

The WinCC Communication Configurator (CCComunicationConfigurator.exe) is a tool with which WinCC communication parameters can be set to the available network environment in a simple manner.

It is expedient to use WinCC Communication Configurator whenever there is no Ethernet LAN with a transfer rate of 100 Mbps. We recommend you to use the configurator even when the connection is sporadically unstable as a result of high-load situations (such as no connection to the data servers, I/O fields without a displayed value).

The WinCC communication is configured with standard parameters so that it reacts very sensitively to communication errors, e.g. in order to report any faults which occur to the user quickly or also to ensure a short "failover" time to the redundant server in the case of a client computer.

On a network having low transfer rates or a high network/CPU loading, the stability of the logical network connections of WinCC are affected by this error-sensitive behavior, since the expected feedback times cannot be achieved in the lower-level mechanisms of lifebeat monitoring.

The Communication Configurator adapts the communication parameters to the existing scenario so that optimum harmonization is guaranteed between error sensitivity and connection stability.

Note: If the WinCC Communication Configurator is used in this manner, it must be done on the WinCC client and on the WinCC server. The Communication Configurator only modifies the settings for WinCC communication but not the parameters set for the communication connections of the operating system.

Field/option Description Ethernet LAN (100 Mbps) This is the default setting.

Can be used with Ethernet LANs having a transfer rate of 100 Mbps.

Ethernet LAN (10 Mbps) For Ethernet LANs having a transfer rate of 10 Mbps.

ISDN (MultiLink) For networks having a transfer rate of 128 Kbps. ISDN For networks having a transfer rate of 64 Kbps.

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 150: WinCC SmartTools Tutorial

WinCC Communication Configurator 03.04

146 Printout of the Online Help

Smart Tools

Field/option Description Modem (<64 Kbps) For networks or communication links having a

transfer rate < 64 Kbps. Check box "Use high load operation mode"

Causes fine-tuned settings of the configurator in order to counteract sporadic connection instabilities as a result of high load situations.

"Default" button Sets the setting to the default value "Ethernet LAN (100 Mbps)"

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 151: WinCC SmartTools Tutorial

03.04 Index

Printout of the Online Help Index-1

Smart Tools

Index

.

.emf 130

.emf File 130

A Amplitude 26 ASCII File 3 ASCII-Datei 14

C Communication Configurator 145 Control Characters 9 Conversion 139 Cross Reference 131, 133 csv Format 3

D Damping 26 Data structure 17 Decrement 23, 26 Dynamic Wizard Editor 32

Editing Window 39 Help Editor 40 Installation 35 Output Window 41 Structure 36 Toolbar 37

Dynamic Wizard Function 42 Structure 42

E EasyLanguage 3 Excel 3 Export 3, 5, 13, 14, 15, 17 Export Function 3, 5 Exporting 3, 13

F File Names 13 File Selection 138

File Structure 16 File Structures 16 Function Test 21 Functions 134

I Import 3, 6, 13, 14, 17 Import Function 3, 6 Importing 3, 13, 14 Increment 23, 26

L Language Information 8 Link File 7 Low Limit 26

M MS Excel 3

O Offset 26 Operating Mode 3 Operating mode change 3 Oscillation 23, 26 Oscillation Period 26

P Print Job Properties 130 Print Jobs 129 Process Peripherals 22 Process Pictures 3 Process Tag 22 Project Selection 137

R Random 23, 26 Report Page 129

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete

Page 152: WinCC SmartTools Tutorial

Index 03.04

Index-2 Printout of the Online Help

Smart Tools

S Script 133 Script Conversion 139 Script management 140 Semicolon 9 SetValue 26 Simulation 21 Simulator 21 Sine 23, 26 Slider 23, 26 Start Value 26 Stop Value 26 Structure types 17

T Tag Simulator 21 Target Computer 15, 17 Translation 3

U Upper Limit 26

V Variables 17 Vertical Line 9

W WinCC CrossReferenceAssistant 131, 133 WinCC Protocolsystem 129

www.cadfamily.com EMail:[email protected] document is for study only,if tort to your rights,please inform us,we will delete