Audit Trail-Filter - Siemens

Transcription

Audit Trail-FilterWinCC ww/de/view/109757951SiemensIndustryOnlineSupport

Legal informationLegal informationUse of application examplesApplication examples illustrate the solution of automation tasks through an interaction of severalcomponents in the form of text, graphics and/or software modules. The application examples area free service by Siemens AG and/or a subsidiary of Siemens AG (“Siemens”). They are nonbinding and make no claim to completeness or functionality regarding configuration andequipment. The application examples merely offer help with typical tasks; they do not constitutecustomer-specific solutions. You yourself are responsible for the proper and safe operation of theproducts in accordance with applicable regulations and must also check the function of therespective application example and customize it for your system.Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have theapplication examples used by technically trained personnel. Any change to the applicationexamples is your responsibility. Sharing the application examples with third parties or copying theapplication examples or excerpts thereof is permitted only in combination with your own products.The application examples are not required to undergo the customary tests and quality inspectionsof a chargeable product; they may have functional and performance defects as well as errors. It isyour responsibility to use them in such a manner that any malfunctions that may occur do notresult in property damage or injury to persons. Siemens AG 2018 All rights reservedDisclaimer of liabilitySiemens shall not assume any liability, for any legal reason whatsoever, including, withoutlimitation, liability for the usability, availability, completeness and freedom from defects of theapplication examples as well as for related information, configuration and performance data andany damage caused thereby. This shall not apply in cases of mandatory liability, for exampleunder the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss oflife, bodily injury or damage to health, non-compliance with a guarantee, fraudulentnon-disclosure of a defect, or culpable breach of material contractual obligations. Claims fordamages arising from a breach of material contractual obligations shall however be limited to theforeseeable damage typical of the type of agreement, unless liability arises from intent or grossnegligence or is based on loss of life, bodily injury or damage to health. The foregoing provisionsdo not imply any change in the burden of proof to your detriment. You shall indemnify Siemensagainst existing or future claims of third parties in this connection except where Siemens ismandatorily liable.By using the application examples you acknowledge that Siemens cannot be held liable for anydamage beyond the liability provisions described.Other informationSiemens reserves the right to make changes to the application examples at any time withoutnotice. In case of discrepancies between the suggestions in the application examples and otherSiemens publications such as catalogs, the content of the other documentation shall haveprecedence.The Siemens terms of use (https://support.industry.siemens.com) shall also apply.Security informationSiemens provides products and solutions with industrial security functions that support the secureoperation of plants, systems, machines and networks.In order to protect plants, systems, machines and networks against cyber threats, it is necessaryto implement – and continuously maintain – a holistic, state-of-the-art industrial security concept.Siemens’ products and solutions constitute one element of such a concept.Customers are responsible for preventing unauthorized access to their plants, systems, machinesand networks. Such systems, machines and components should only be connected to anenterprise network or the Internet if and to the extent such a connection is necessary and onlywhen appropriate security measures (e.g. firewalls and/or network segmentation) are in place.For additional information on industrial security measures that may be implemented, please emens’ products and solutions undergo continuous development to make them more secure.Siemens strongly recommends that product updates are applied as soon as they are availableand that the latest product versions are used. Use of product versions that are no longersupported, and failure to apply the latest updates may increase customer’s exposure to cyberthreats.To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feedat: https://www.siemens.com/industrialsecurity.Audit Trail FilterEntry ID: 109757951,V1.0,08.20182

Table of contentsTable of contentsLegal information . 21Introduction . 41.11.21.32Commissioning of the audit trail filter . 72.12.22.33Retrieving and loading the sample project . 7Settings on the panel. 8Settings in the runtime. 12Explanation of the user interface of the audit filter . 143.13.23.2.13.2.23.2.33.2.43.2.5 Siemens AG 2018 All rights reservedOverview. 4Mode of operation . 5Components used . 6The application screen . 14The application pictures . 15The "Startscreen" . 15"Audit Data from CSV" . 17"Audit Data from TXT" . 17"Audit Data from Filters" . 18"PDF Viewer" . 204Operation of the audit filter . 235Modification of the reports . 305.15.26Modification in the PLC program . 30Modification in the WinCC application . 31Appendix . 346.16.26.3Audit Trail FilterEntry ID: 109757951,V1.0,Service and support . 34Links and Literature . 35Change documentation . 3508.20183

1 Introduction1Introduction1.1OverviewIn many industries there are strict quality assurance guidelines, which are alsoreferred to as GMP (Good Manufacturing Practice). The industries involved includethe pharmaceutical, cosmetics, food and animal feed industries.NoteFurther information on GMP can be found ice.aspx Siemens AG 2018 All rights reservedOne of the GMP guidelines concerns the traceability of interventions in theproduction process. This means that all inputs are recorded by all users and mustbe back-traceable.The WinCC comfort/advanced option "WinCC en/view/109744244) has beendeveloped for this purpose. With this optional package, all user inputs and changesto process variables can be recorded on an HMI device and saved locally in a logfile. The data can then be filtered, evaluated and printed via the "Audit Trail Viewer"application. This application has a "data validation" function. This function is notpossible in the panel runtime. Filtering the archive on the panel does not changethe validity of the trails! However, the audit trail viewer can only be used on fullyfledged PC systems. This makes it very difficult to evaluate the audit trails ofpanels, as they must first be transferred to this kind of PC system.For this reason, the "Audit Trail Filter" was developed. The "Audit Trail Filter" offersthe opportunity to view the audit trail generated by the panel directly on the deviceand to search for relevant data. Furthermore, this software makes it possible togenerate reports in PDF format from the filtered data on the panel.Thus, the "Audit Trail Filter" helps to quickly get to the audit data you want in theoperating procedure and saves time. This application example explains how theaudit trail filter works using a sample project.Figure 1-1SIMATIC HMI Comfort PanelAudit Trail-FilterAudit TrailUser XUser YUser ZAudit Trail FilterEntry ID: 109757951,V1.0,Time1UserYTime2Audit Trail-PDFFiltered Audit TrailUser YFrom time 1to time 2User Y:From time 1 to time 208.20184

1 Introduction1.2Mode of operationThe audit trail filter opens the audit trail file (CSV or TXT), which is generated onthe panel. The audit trail can be viewed directly on the panel.During the filtering process, the individual entries of the audit trail are comparedwith a filter mask and filter parameters. The matching entries are saved on thepanel in a TXT file. Each filter has its own TXT template. When the filter is reapplied, the respective TXT file is overwritten.When a print job is triggered, the panel reads the filtered TXT file again and writesthe individual values to a DB on the PLC. The detour via the PLC is necessarybecause the panel does not recognize an array of WString as an internal variable.Creating the variables used for the report individually would require a largenumber of internal variables. The values of the DB are linked to fields on readymade reports on the panel. The report is passed to the PDF creator of the panel viaa print command and the result is stored on a configurable path. The PDF can beopened and displayed by the runtime via the PDF viewer.Figure 1-2Panel Siemens AG 2018 All rights reservedCreating the auditentriesAudi trailTXT-/CSVfileStart of a filterprocessFiltering the dataFilteredaudit trailTXT filePLCWriting the data inDBPanelDB withfiltered dataTransmission of theDB data to theprefabricated reportCompletedreportNaming andprinting the PDF fileAudit PDFTerminating thefiltering operationAudit Trail FilterEntry ID: 109757951,V1.0,08.20185

1 Introduction1.3Components usedThis application example consists of the following hardware components:Table 1-1ComponentNumberArticle numberNoteTP1200 comfort panel16AV2 124-0MC01-0AX0Or other comfortpanelsS7 1500 CPU 1516-3PN/DP16ES7 516-3AN01-0AB0Or other S7-1500CPUsThis application example consists of the following software components:Table 1-2ComponentNumberArticle numberSIMATIC STEP 7 Prof.V1516ES7822-1AA05-0YA5SIMATIC WinCCProfessional V1516AV2103-0DA05-0AA5Note Floating licenseWith USB stickWith DVD With 512 powertagsWith DVD Siemens AG 2018 All rights reserved SIMATIC WinCC RTProfessional V1516AV2105-0DA05-0AA0 Audit Trail FilterEntry ID: 109757951,V1.0,08.2018With 512 powertagsWith DVD6

2 Commissioning of the audit trail filter2Commissioning of the audit trail filter2.1Retrieving and loading the sample projectThis section briefly describes the commissioning of the audit filter. Instructions andscreenshots will aid you. Basic working knowledge of the TIA portal is required.1. Download the example project from the article /view/109759512. Open the TIA portal.3. Open the project view.4. Click on the entry "Project" in the upper menu bar and select the entry"Retrieve." in the menu that opens.5. In the following window, look for the sample project and open it.6. Adjust the hardware components to your setup.7. Optional: You can change the format of the audit trail from a CSV to a TXTfile. To do this, double-click on the entry "Archive" ("Historical data") in theproject tree of the HMI panel. (1) Click the "Audit Trail" tab in the top bar of theworkspace. (2) There you can see the configured audit trail. In the "Storagelocation" column, change the file from CSV to TXT (3) (4) Siemens AG 2018 All rights reservedNoteRDB files cannot be used with this application because the panel cannot readthem.Figure 2-18. Compile the example project completely and load it into your controller and thepanel.ResultYou have successfully adapted the project to your system and loaded it into thehardware.Audit Trail FilterEntry ID: 109757951,V1.0,08.20187

2 Commissioning of the audit trail filter2.2Settings on the panelIn order to use all functions of the sample project, the settings must be made onthe panel beforehand.NoteThe option "Printer Driver PDF V1.4" is required to create and print PDFs. Makesure the option is installed on the panel you are using. If not, you should install itvia "SIMATIC ProSave". This software is included in the TIA portal.Printer settings1. Open the "Control Panel" of your panel. To do this, on the desktop click on"Start Settings Control Panel". Siemens AG 2018 All rights reservedFigure 2-22. Open the printer settings by double-clicking on the option "Printer".Figure 2-3Audit Trail FilterEntry ID: 109757951,V1.0,08.20188

2 Commissioning of the audit trail filter3. This opens the "Printer Properties" of the panel. Open the "Printer Language"drop-down list (1) and select the entry "PDF V1.4". (2) Confirm the selectionwith the "OK" button. (3).Figure 2-4Result Siemens AG 2018 All rights reservedYou have successfully configured the printer settings.Regional settings of the panel1. Open the "Control Panel" of your panel. To do this, on the desktop click on"Start Settings Control Panel".Figure 2-5Audit Trail FilterEntry ID: 109757951,V1.0,08.20189

2 Commissioning of the audit trail filter2. Open the "Regional Settings" by double-clicking on the option "RegionalSettings". This opens the "Regional and Language Settings" of the panel.Figure 2-63. Open the drop-down list of the "Regional Settings" with a left-click (1). Selecteither "Germany" or "USA" as the region. (2) Confirm your selection with the"OK" button. (3) Siemens AG 2018 All rights reservedFigure 2-7ResultYou have successfully configured the "Regional Settings"."PDF settings"1. Open the "PDF Settings" by double-clicking on the desktop icon.Figure 2-8NoteMake sure you have an external storage device connected to the panel. Possible externalstorage media are USB sticks or SD cards.Audit Trail FilterEntry ID: 109757951,V1.0,08.201810

2 Commissioning of the audit trail filter2. In the "PDF Settings" as "Primary Location" select the medium you want. Thepath in the field below will be automatically adjusted. Siemens AG 2018 All rights reservedFigure 2-93. Check the "PDF File Names" tab to make sure that the name of the PDF hasthe following format. (outlined in red in Fig. 2-10) If this is not the case, click onthe "Default" button and confirm with the "OK" button. Do not press the "Apply"button, otherwise the values of the "Selected Format" field will be appended tothe label.Figure 2-10ResultYou have successfully configured the printer settings for creating PDFs.Audit Trail FilterEntry ID: 109757951,V1.0,08.201811

2 Commissioning of the audit trail filter2.3Settings in the runtimeIn the sample project, it is important to define the storage locations of the variousfiles before use, otherwise they will not be created correctly.To get to these settings, follow the steps below.1. Start the runtime.2. Click the menu icon in the upper right corner.Figure 2-113. In the slide-in menu that opens, click on the "Settings" entry. Siemens AG 2018 All rights reservedFigure 2-124. Select the entry "Audit Settings".Figure 2-13Audit Trail FilterEntry ID: 109757951,V1.0,08.201812

2 Commissioning of the audit trail filter5. In the following window, specify the storage locations of the individual files. Enter the storage location for the audit trail. (1) Enter the storage location for the audit filter. (2) Enter the storage location for the PDF files. (3) Enter the storage location for the audit report. (4)For your support, examples of the paths above the input fields are given. Youcan apply these directly if you use an SD card. (see Figure 2-14)NoteWhen filling in the "Audit Trail storage location" field, note that the file namecorresponds to that assigned during configuration. (see Figure 2-1) The name ofthe audit trail is the one specified in the audit trail archive settings plus anappended "0". (see also Figure 2-1) This "0" is appended to the panel whentransferring the project and cannot be avoided. Siemens AG 2018 All rights reservedFor instance, in this project, the name of the audit file "AuditTrail Data1" wasselected and the format was a CSV file. Thus, the full path for the audit trailstorage location input field is as follows: "\Storage CardSD\AuditTrail Data10.csv".6. Check the path "Audit Trail storage location" with the "Start" button. All pathsfor the system are adopted. Press the "Start" button as soon as you haveentered all the paths. (5) The correctness of the path of the "Audit Trail storagelocation" is then given to the right of the button. (6) (see Figure 2-14) If thefolder does not exist, it will be created with the first filter.7. In the bottom left corner of the "Audit Settings" screen is the button forterminating the runtime. (7)Figure 2-1476 ResultYou have configured all settings. The audit filter is now ready to work.Audit Trail FilterEntry ID: 109757951,V1.0,08.201813

3 Explanation of the user interface of the audit filter3Explanation of the user interface of theaudit filterThe audit filter is embedded in an HMI template. Only the buttons and menusnecessary for the example are explained.3.1The application screenThe Runtime starts with the "Startscreen" of the application. The two menu bars atthe top and bottom are static and the same for all applications.Figure 3-11 Siemens AG 2018 All rights reserved231. Upper menu barIn the upper menu bar you can register a user by clicking on the "." symbol inthe "Operator" area. A pop-up menu opens for this. To the right of the userlogin, a checkbox indicates whether the connection with the PLC has beenestablished successfully.2. Application windowBetween the upper and the lower menu bar is the area in which the selectedapplication picture is displayed.3. Lower menu barIn the lower menu bar you can switch between the different screens of theapplication "Audit Trail Filter". The selected image is highlighted in gray. Theindividual application pictures are explained in the following section.Audit Trail FilterEntry ID: 109757951,V1.0,08.201814

3 Explanation of the user interface of the audit filter3.2The application picturesThis section explains the individual application screens of the sample project.Figure 3-2432151. "Start Image" (Section 3.2.1)2. "Audit Data from CSV" (Section 3.2.2)3. "Audit Data from Txt" (Section 3.2.3)4. "Audit Data from Filters" (Section 3.2.4)5. Show PDF (Section 3.2.5)3.2.1The "Startscreen" Siemens AG 2018 All rights reservedThe following functions are available in the start screen: Creating entries with user ID in the Audit Trail Checking login information. Changing language settings Viewing system messagesIt is divided into three areas:Figure 3-31231. AreaIn this area you can choose between two tabs. In the first tab "User Actions"you create a user-linked entry in the Audit Trail with the button "Create DataAudit 1". With the "Create Data Audit 2" button, you create a user-linked entryin the Audit Trail with comments. Pressing this button opens a pop-up windowwith a field for entering the comment.Audit Trail FilterEntry ID: 109757951,V1.0,08.201815

3 Explanation of the user interface of the audit filterFigure 3-4The "Login datas" tab displays information about users and passwords createdin this project. Siemens AG 2018 All rights reservedFigure 3-52. AreaIn this area, the display language is switched between German and English.3. AreaThis area displays the messages issued by the system.Audit Trail FilterEntry ID: 109757951,V1.0,08.201816

3 Explanation of the user interface of the audit filter3.2.2"Audit Data from CSV"If you have decided to save the Audit Trail as a CSV file, you can view the entriesin this file in this application screen.By clicking on the button "Display CSV-Data" the list is called up and updated forthe first time.The "Number of Entries" and "Display Range Start/End" areas show how manyentries exist in the CSV file and which are currently shown on the display.If you have chosen a TXT file in the configuration, this list will be empty. This alsoapplies to the list in the "Audit Data from TXT" screen (if you chose the CSV file). Siemens AG 2018 All rights reservedFigure 3-63.2.3"Audit Data from TXT"In this image you get the same information as from the picture "Audit from CSV",only in this image the information from a TXT file is displayed.Figure 3-7Audit Trail FilterEntry ID: 109757951,V1.0,08.201817

3 Explanation of the user interface of the audit filter3.2.4"Audit Data from Filters"This application image contains the actual filter for the Audit Trail. It serves to: Set the filter parameters Display the filtered data Create PDFsThe "Audit Data from Filter" image consists of the following areas:Figure 3-81 Siemens AG 2018 All rights reserved234Audit Trail FilterEntry ID: 109757951,V1.0,08.201818

3 Explanation of the user interface of the audit filter1. Field "Configure Filter"Clicking on the icon with the three dots in the "Filter Configuration" field opensa pop-up window with four different filter masks. Siemens AG 2018 All rights reservedFigure 3-9You can filter by the following criteria: "RecordID": After a specific entry or the system entries with the ID "0". "Timestamp": According to all entries between two given times "UserID": According to a specific user "TimeAndUser": According to a specific user in a periodAfter selecting the filter mask, the corresponding fields appear in which thesearch parameters must be entered, depending on the filter. The button "Activate& Close" applies the filter to the existing audit trail and the matching data isbuffered.NoteIt is possible to use the time formats of "Germany" and "USA" as the systemrecognizes the set region. You can set these as described in section 2.2.All filter settings in the I/O fields must match the formats of the examples givenabove. (Case, special characters, spaces)Audit Trail FilterEntry ID: 109757951,V1.0,08.201819

3 Explanation of the user interface of the audit filter2. Filter tableAfter clicking the "Show filtered data" ("EN") button, the results of the filter aredisplayed in the filter table.3. Button "Report Settings"Pressing the "Report Settings" button opens a popup window. In this windowyou can enter the name of the PDF file for the currently filtered data in whichyou can enter the filter results. The storage location is the one you haveconfigured in section "Setting in Runtime" Point 5.The "Current state" area shows you the current status of the creation of thePDF. Siemens AG 2018 All rights reservedFigure 3-104. Button "Display Filter Data"Displays the most recently filtered Audit Trail data in the filter table.3.2.5"PDF Viewer"This window displays the PDFs you have generated. The image consists of threeareas.Audit Trail FilterEntry ID: 109757951,V1.0,08.201820

3 Explanation of the user interface of the audit filterFigure 3-111231. The "PDF viewer" Siemens AG 2018 All rights reservedIn the PDF viewer you can view different PDFs. Before the PDFs aredisplayed, you must open them with the "File Explorer".Audit Trail FilterEntry ID: 109757951,V1.0,08.201821

3 Explanation of the user interface of the audit filter2. "File Explorer"Click on the "File Explorer" button to open the tool of the same name.The "File Explorer" is a tool from the "Toolbox for HMI projects". This makes itpossible to search through folder structures of panels and to view PDF filesduring active Runtime.NoteTo enable the display of all data in the folder which was opened by the "FileBrowser", it may be necessary to update the folder.To update the data in the current folder, you must leave the folder and open itagain.Generating the PDF can take a few moments, which means you may not findyourself in the storage path right away.Figure 3-1232 Siemens AG 2018 All rights reserved14You can navigate through the folder structure using the "Open" (1) and "Back"(2) buttons. In addition, the PDF can be opened in the external viewer with the"Open" key. The "Open PDF to RT" button (3) has been recreated andinserted into the layout. It opens the selected PDF in the viewer.The selection window displays the data in the open folder. In this area, thedisplayed objects can also be selected by clicking on them. (4)Further information on the "Toolbox for HMI projects" can be found at thefollowing /view/1062264043. The "zoom area"In the "zoom area" there are two buttons with which the view of the PDF in the"PDF viewer" can be enlarged or reduced.Audit Trail FilterEntry ID: 109757951,V1.0,08.201822

4 Operation of the audit filter4Operation of the audit filterThis section provides a brief example of how to operate the audit filter.General conditions of the example: The data is stored on an SD card. A CSV file is used to store the data. The filter is configured to search for users and timestamps.1. First carry out all the configuration steps of section "2. Commissioning of theaudit trail filter".2. Change to the "Startscreen".3. Log a user on. To do this, enter the user name and the correspondingpassword. (1) Confirm the entries with the "OK" button. (2) In this example theuser "Admin" is used. Siemens AG 2018 All rights reservedFigure 4-1Audit Trail FilterEntry ID: 109757951,V1.0,08.201823

4 Operation of the audit filter4. Create some audit entries with the buttons of the "User actions" section Tobetter identify your entries, it is recommended to create entries with comments.Click on the button "Create Audit Data 2". (1) Enter a comment in the pop-upmenu. (2) Execute the creation with the "OK" button. (3) Siemens AG 2018 All rights reservedFigure 4-25. Switch to the "Audit Data from CSV" application screen. (1) Click on the "ShowCSV Data" button to allow the display of audit entries. (2) In the audit trail (framedin red) you will see different entries from different users. Stopping and restartingthe runtime from the user "System" and different entries from the user "Admin".Figure 4-3Audit Trail FilterEntry ID: 109757951,V1.0,08.201824

4 Operation of the audit filter6. Now switch to the application screen "Audit Data with Filter" . (1) Click thebutton with the three dots in the "Filter Configuration" section. (2) Siemens AG 2018 All rights reservedFigure 4-47. Set the filter to the "TimeAndUser" mask. (1) Enter the parameters you want tofilter by. (2) Click the "Activate & Close" button. (3)Figure 4-5Audit Trail FilterEntry ID: 109757951,V1.0,08.201825

4 Operation of the audit filter8. A pop-up screen will tell you if your filtering was successful. In this case, let thefiltered data be displayed with the "Display Filter Data" button. (1) If the filteringwas unsuccessful, it will also be displayed. In this case, check the correctnessof your information in the filter mask. You will see the filtered entries in the filtertable. If they are identical, click the button "Report Settings" to print the data.(2) Siemens AG 2018 All rights reservedFigure 4-6NoteThe date and time of the audit data correspond to those of your panel, not that ofyour PLC. Make sure that you synchronize the times of the two devices witheach other.9. This opens the pop-up menu for creating the PDF. Enter a name for theprotocol. (1) Click the "Print Report" button. (2)Figure 4-7Audit Trail FilterEntry ID: 109757951,V1.0,08.201826

4 Operation of the audit filter10. Wait for conformation that the report was created. This is displayed in the"Current state" area. (1) Then exit the pop-up menu with the "Close" button. (2)Figure 4-8 Siemens AG 2018 All rights reserved111. Switch to the "PDF View" application screen. (1) Click on the "File Explorer".(2)Figure 4-9Audit Trail FilterEntry ID: 109757951,V1.0,08.201827

4 Operation of the audit filter12. Search for the PDF in your specified path and selected designation with thekeys "Open", "Back" and the selection window. Select the PDF. It will then besaved in green. Press the button "Open PDF in RT".Figure 4-10 Siemens AG 2018 All rights reserved1Audit Trail FilterEntry ID: 109757951,V1.0,08.201828

4 Operation of the audit filterResultYou have successfully filtered your audit trail for relevant data and created a PDFon the SD card of the panel. You can view the generated PDF in the PDF viewerand download it from the panel for further use.NoteSince it is not possible to generate the logs dynamically, each report has thesame layout

Audit Trail Filter Entry ID: 109757951, V1.0, 08.2018 5 G 8 d 1.2 Mode of operation The audit trail filter opens the audit trail file (CSV or TXT), which is generated on the panel. The audit trail can be viewed directly on the panel. During the filtering process, the individual entries of the audit trail are compared