Contents
Page
Training Training aims ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ............ ........... ........... ........... ........... ........... ........... ......
2
WinCC Option "User "User Archive" Archive" ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ............ ........... ........ ...
3
User archives archives ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ............ ........... ........... ........... ........... ........... .......... .....
4
User User archives archives edit editor or Struct Structure ure (fiel (fields ds)) ...... ......... ...... ...... ....... ....... ..... ...... ....... ...... ...... ...... ...... ....... ....... ....... ....... ...... ...... ...... ...... ...... ....... ....... ...... ...... ...... ...... ...... ...
5
User User Archive Archive editor editor Archive Archive data data ...... ......... ...... ...... ...... ...... ...... ....... ....... ...... ...... ...... ...... ...... ..... ...... ........ ....... ..... ...... ....... ...... ...... ...... ...... ....... ....... ....... ....... ...... ....... ...... ..
6
User User Archive Archive runti runtime me WinCC WinCC Use Userr Archive Archive Con Contro troll ...... .......... ....... ....... ........ ....... ....... ....... ...... ...... ...... ...... ....... ....... ...... ...... ...... ..... ...... ....... ...... ...... ...
7
User User Arch Archive ive run runti time me Data Data exch exchan ange ge with with S7 S7 contr contro olled lled by by the ope opera rator tor
8
.... ...... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... .... ....
User User Arch Archive ive runt runtime ime Data Data exch exchan ange ge with with S7 con contro troll lled ed by by the the S7 S7 prog progra ram m User User Archive Archive View Views s
…….. …….... .... .... .... .... .... .... .... .... .... .... .... ....
9
...... .......... ....... ...... ...... ...... ..... ...... ....... ...... ...... ....... ....... ...... ...... ...... ...... ...... ..... ...... ........ ....... ....... ....... ...... ...... ...... ...... ....... ....... ...... ...... ...... ...... ...... ...... ...... ...
10
SITRAIN Train Trainin ing g for for Automation Automation and Industrial Industrial Solutions Solutions
Page 1
ST-BWINCCS User Archive
The participant will : •
Get to know the advantages of User Archive.
•
Get to know the table view.
•
Get to know the access options.
•
Get to know the communications options.
•
Get to know the possible applications.
SITRAIN Training for Automation and Industrial Solutions
Page 2
ST-BWINCCS User Archive
General
The User Archiv e package is available as a Wi nCC optional package. It consists of - User documentation - Internal functions - Key disk for enabling the software. The User Archiv e software is already on the W inCC CD.
Appl ic ati on s
User archives can be used for a wide variety of applications (see figure above).
Basics
WinCC User Archive is a database system that users can conf igure themselves for their own purposes. WinCC User Archives provides two type of database tables:
Arc hi ve
Archives are database tables in which users can create their own data fields. Archives are used for the storage of data and provide database access to this data.
Views
Views take data from the archives and are used to put data together for example to obtain an ov erview of product groups. The data of a v iew can also be edited in runtime; the modif ied data is then entered in the original archive.
Access t o u ser ar ch iv es wi th : • Table window • Internal functions • API functions (described in the ODK package) • ODBC / SQL • Communication with the controller via tags • Communication with the controller via raw data
SITRAIN Training for Automation and Industrial Solutions
Page 3
ST-BWINCCS User Archive
Definitions
In the example above User Archive is used to display a rec ipe. The components of a recipe consist of recipe elements reflecting the individual components of the recipe. With a table, this corresponds to column titles. A single recipe with its different recipe values is put together in a data record. A data record corresponds to a row in a table, a recipe v alue corresponds to a cell in the table.
SITRAIN Training for Automation and Industrial Solutions
Page 4
ST-BWINCCS User Archive
Arc hi ves
In the figure above, two user archives have been created. In the properties of a user archive, the following settings can be made: - Name - Number of data records: unlimited or with max. number - Communication type: none, data manager tags or raw data tags - Restriction of read and write rights is optional - "Last Access" field and "Last User" field can be added as options
Fields
For the selected user archive, the fields of this archive are shown on the right. The most important properties of a f ield are: - Name - Type (character string, number (integer), number (float), number (double) or date/time) - With a character string, the length can be defined. - With numbers an optional minimum value and a maximum value can be added. - The following option can also be enabled: Value required = field cannot be empty Unique value = WinCC monitors the uniqueness of entries With index = database is given indexes
SITRAIN Training for Automation and Industrial Solutions
Page 5
ST-BWINCCS User Archive
Arc hi ve d ata
The previously defined fields can now be filled with content. The number of data records depends on the configuration of the archive (unlimited or with max. number). If "unlimited" was configured, and upper limit is set by WinCC. These system limits are described in WinCC help in Performance data -> User archives. Maximum of 300,000 entries: - 10 fields with 30,000 data records - 500 fields with 600 data records The archive data is stored in the runtim e database. This means that both during the configuration (see above) and during WinCC runtime data can be entered, deleted or changed by the relevant control.
SITRAIN Training for Automation and Industrial Solutions
Page 6
ST-BWINCCS User Archive
Runtime
In runtime, the archiv e data can be accessed using the User Archiv e control. This is only possible if the component "User Archive" was enabled in the startup list.
Delete, cop y,... Deleting always involves one or more rows (data records). Read/wri te tags Data exchange with the controll er is explained on the following pages. Import or export archive All displayed data records (filter) are exported to the UA directory within the WinCC project. The name of the CSV file can be changed in a di alog. When importing, a CSV file is also read in from the UA directory. Export
With this button, you export all or selected runtime data to a CSV file. If the option "Display dialog" is active, a dialog opens in which you can view the settings for exporting and can start the ex port. With the suitable authorization, you are also allowed to select the file and the directory for the export. If no dialog is displayed, the export of the data to the preset fil e starts immediately.
SITRAIN Training for Automation and Industrial Solutions
Page 7
ST-BWINCCS User Archive
Data exch ange
Data exchange with the controller can either be started by the operator or by the controller. The first option is considered initially.
Step 1
The operator selects a data record.
Step 2
With the "Write Tags" button, the current data record is written to the controller. Each value is written to the tag stored in the properties of the field.
Step 3
The selected data record has been written to the corresponding tags. The controller can now continue working with these values.
SITRAIN Training for Automation and Industrial Solutions
Page 8
ST-BWINCCS User Archive
Data exch ange
Data exchange can also be cont rolled by the controller program. To do t his, the control tags "ID" and "Job" are used.
ID
The identifier (corresponds to the record number) of the user archiv e
Jo b
Three jobs are possible: Read, write and delete: Simatic to archive =6 Archive to Simatic =7 Delete =8 After the job has been carried out, there is an error ID in this control tag: No errorN =0 Error = -1 As an alternative the addressing can be via the control tags "Field" and "Value".
Field
The archive field (column label e.g. Ingredients).
Value
The archive field value (e.g. 'Flour') For the example above, the following values would need to be written to the control tags: ID = 0
Field = product name
Value = KolaMix
and afterwards Job = 7 Additional combinations of the control tags "ID" and "Job": ID
Job = " 6"
-1
Append data record (DR)
-6
Read DR with the lowest ID
Write DR with the lowest ID
Delete DR with the lowest ID
-9
Read DR with the highest ID
Write DR with the highest ID
Delete DR with the highest ID
SITRAIN Training for Automation and Industrial Solutions
Job = " 7" -
Job = " 8" Delete DR with the lowest ID
Page 9
ST-BWINCCS User Archive
Views
In the User Archiv e editor, it is also possible to configure views. A view groups data from various user archiv es. For example, you can create links via the fields of vari ous user archives with SQL to display relationships in runtime in a single v iew. The linked user archives must have at least one com mon data field. In the example above there are two user archiv es. Both have a field "Product number" (the ID column is not suitable since this column is m anaged by the system and cannot be freely assigned). In the view "~Tanks_Softdrink.Productnumber = ~Recipes_Softdrink.Productnumber is configured as the relation. This has the effect that only the combinati ons are displayed in which the product number is the same in both archives.
SITRAIN Training for Automation and Industrial Solutions
Page 10
ST-BWINCCS User Archive