This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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||";
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
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
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
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
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
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).
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
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.
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.
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.
The EnumProperty function lists the properties of an object. With the EnumPorpertyEx function, you can specify the properties to be listed for an object.
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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