APF report templates based on data from the WinCC User Archive

Similar documents
Integration of Process Historian / Information Server in a Domain


Configuration of an MRP Ring and a Topology with Two Projects

Migration of a Process Historian database




Determination of suitable hardware for the Process Historian 2014 with the PH-HWAdvisor tool

Multiuser Engineering in the TIA Portal

SINAMICS G/S: Integrating Warning and Error Messages into STEP 7 V5.x or WinCC flexible

Configuration of an MRP ring with SIMOCODE and SIMATIC S SIMOCODE pro V PN, SIMATIC S Siemens Industry Online Support


Calculating the expected PH storage requirements of SIMATIC BATCH batches

Application example 12/2016. SIMATIC IOT2000 OPC UA Client SIMATIC IOT2020, SIMATIC IOT2040

Application example 02/2017. SIMATIC IOT2000 Connection to IBM Watson IoT Platform SIMATIC IOT2040

Single Message Report for the Information Server. SIMATIC PCS 7, SIMATIC Information Server Siemens Industry Online Support

Setting up time synchronization of Process Historian and Information Server


SIMATIC NET OPC Server Implementation


Data Storage on Windows Server or NAS Hard Drives


Message Cycle Report for the Information Server. SIMATIC PCS 7, SIMATIC Information Server Siemens Industry Online Support

Visualizing Energy Data of a SITOP PSU8600


Automatic Visualization of the Sample Blocks in WinCC Advanced

Improving the performance of the Process Historian




Check List for Programming Styleguide for S7-1200/S7-1500

Integration of SIMATIC PCS 7 Asset Management into existing projects

Tabular SIMATIC BATCH report for the Information Server. SIMATIC PCS 7 / SIMATIC Information Server 2014 / Customized Reporting


SINAMICS G/S: Tool for transforming Warning and Error Messages in CSV format


Library Description 08/2015. HMI Templates. TIA Portal WinCC V13.

RAID systems within Industry


STEP 7 Professional V14 SP1, Energy Suite V14 SP1, SENTRON PAC Measuring Devices, Modbus TCP



Generating the Parameters for the Modbus/TCP Communication


X-Tools Loading Profile Files (LPF)

Project planning of the NTP time synchronization of a Process Historian and Information Server. SIMATIC PCS 7, SIMATIC Information Server 2014


Windows firewall settings for X-Tools Server Pro. CMS X-Tools / V / CPU PN/DP. Application description 6/2016



Position Control with SIMATIC S and SINAMICS V90 via IRT PROFINET SINAMICS V90 PROFINET. Application description 03/2016

Moving a Process Historian/ Information Server from Workgroup A to Workgroup B

Setting up 08/2017. Setting up the SIMATIC IOT2000 SIMATIC IOT2020, SIMATIC IOT2040

Setting up 01/2017. Setting up the SIMATIC IOT2000 SIMATIC IOT2020, SIMATIC IOT2040

Checking of STEP 7 Programs for the Migration of S7-318 to S CPU318 Migration Check. Application description 01/2015


PNDriver V2.1 Quick Start Guide for IOT2040 SIMATIC IOT


SIMATIC Energy Suite Visualization example of the "*.csv"-energy Data Files

PCS 7 Configuration Changes in RUN with Active Fieldbus Diagnosis

Acyclic communication between S and V90PN via PROFINET. Application example 12/

PCS 7 Process Visualization on Mobile Devices with RDP

Display of SINAMICS Error Messages in Runtime Professional

Transmitting HMI data to an external monitor

Production feedback via WinCC Data Transfer with XML file

Plant Data Interface for the Food & Beverage Industry in SIMATIC PCS 7. Interface description based on Weihenstephan Standards


Display of SINAMICS Fault Messages in WinCC V7.4

House Control with Touch Panel

Networking a SINUMERIK 828D

Communication between HMI and Frequency Converter. Basic Panel, Comfort Panel, Runtime Advanced, SINAMICS G120. Application Example 04/2016

Exchange of large data volumes between S control system and WinCC


SIMATIC PCS 7 Minimal Configuration



S Data Transfer with SEND/RECEIVE Interface

Setting up a secure VPN connection between two SCALANCE S Modules Using a static IP Address

Key Panel Library / TIA Portal

SIMATIC Visualization Architect (SiVArc) Getting Started

Report operator actions with the WinCC WebNavigator

Check List for Programming Styleguide for S7-1200/S7-1500

SIMATIC PDM - Central access to MODBUS RTU devices

User Login with RFID Card Reader

Cover. WinAC Command. User documentation. V1.5 November Applikationen & Tools. Answers for industry.

Installation of a Process Historian on a Fujitsu Primergy Server


Integral calculation in PCS 7 with "Integral" FB or "TotalL" FB

Application on Control Technology

X-Tools configuration to connect with OPC servers and clients

Applications & Tools. Configuration of Direct Starters with the APL Channel Block FbSwtMMS in SIMATIC PCS 7 SIMATIC PCS 7 V8.0

STEP 7 function block to control a MICROMASTER 4 or SINAMICS G120/G120D via PROFIBUS DP

Setting up a secure VPN Connection between the TS Adapter IE Advanced and Windows 7

Applications & Tools. Configuring Electronic Signatures in SIMATIC PCS 7. SIMATIC PCS 7 V8.0 SP1, SIMATIC Logon V 1.5. Application May 2014

Setting up a secure VPN Connection between SCALANCE S and SSC Using a static IP Address. SCALANCE S, SOFTNET Security Client


TeleService of a S station via mobile network

Universal Parameter Server

Applications & Tools. Time-of-Day Synchronization between WinCC Runtime Professional and S7 Controllers. WinCC Runtime Professional

Application about Drive Technology

Transcription:

Application example 03/2017 APF report templates based on data from the WinCC User Archive PCS 7, Information Server https://support.industry.siemens.com/cs/ww/en/view/64906050

Warranty and liability Warranty and liability Note The Application Examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The Application Examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for ensuring that the described products are used correctly. These Application Examples do not relieve you of the responsibility to use safe practices in application, installation, operation and maintenance. When using these Application Examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these Application Examples at any time without prior notice. If there are any deviations between the recommendations provided in these Application Examples and other Siemens publications e.g. Catalogs the contents of the other documents have priority. We do not accept any liability for the information contained in this document. Any claims against us based on whatever legal reason resulting from the use of the examples, information, programs, engineering and performance data etc., described in this Application Example shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act ( Produkthaftungsgesetz ), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract ( wesentliche Vertragspflichten ). The damages for a breach of a substantial contractual obligation are, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment. Any form of duplication or distribution of these Application Examples or excerpts hereof is prohibited without the expressed consent of the Siemens AG. Security information Siemens provides products and solutions with industrial security functions that support the secure operation of plants, systems, machines and networks. In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement and continuously maintain a holistic, state-of-the-art industrial security concept. Siemens products and solutions only form one element of such a concept. Customers are responsible for preventing unauthorized access to their plants, systems, machines and networks. Systems, machines and components should be connected to the enterprise network or the Internet only where necessary, only to the extent needed and only with appropriate security measures (e.g. use of firewalls and network segmentation) in place. Additionally, Siemens guidance on appropriate security measures must be taken into account. For more information about industrial security, please visit http://www.siemens.com/industrialsecurity. Siemens products and solutions undergo continuous development to make them even more secure. Siemens strongly recommends applying product updates as soon as available and to always use the latest product versions. Using versions that are obsolete or are no longer supported can increase the risk of cyber threats. To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed under http://www.siemens.com/industrialsecurity. Entry ID: 64906050, V1.0, 03/2017 2

Table of contents Table of contents Warranty and liability... 2 1 Introduction... 4 2 Creating a user-defined report... 5 2.1 Operating principle... 5 2.2 Example data... 6... 7 3.1 Creating connection to WinCC database... 7 3.2 Defining the data contents of the report... 9 3.3 Layout definition... 14 3.4 Uploading the report template... 20 3.5 Creating a report... 24 4 Appendix... 26 4.1 Service and Support... 26 4.2 Links and Literature... 27 4.3 Documentation of changes... 27 Entry ID: 64906050, V1.0, 03/2017 3

1 Introduction 1 Introduction Advanced Process Functions Reports with APF The SIMATIC PCS 7 Advanced Process Functions (APF) automates simple batch processes for small and medium-sized automation systems with simple material processing. These are mainly dosing, mixing or stirring systems. The modules for material management, parameter management, task management, and archive management support automation of the production process from the raw materials intake to release for filling and packing. The PCS 7 add-on APF does not contain an independent function for generating reports from the WinCC User Archive used. The generation of reports with APF is carried out via the report templates of the information server, which uses the WinCC User Archive as its data base. Core contents of the Application Example The following documentation describes how the SIMATIC Information Server can be used to create complex and detailed reports and thus display the data generated by APF in a meaningful and appealing form. Validity SIMATIC Information Server 2014 SIMATIC PCS 7 V8.2 Entry ID: 64906050, V1.0, 03/2017 4

2 Creating a user-defined report 2 Creating a user-defined report 2.1 Operating principle These five steps must be followed in order to create a user-defined report: 1. Create a (redundant) connection between the information server and the WinCC database (Section 3.1). 2. Create a new report template in the MS Report Builder based on the default template ISBase.rdl and define the data content / SQL queries (Section 3.2). 3. Define the report layout in the MS Report Builder. (Section 3.3). 4. Upload the report template to the information server (Section 3.4). 5. Create a report using the Information Server client (Section 3.5). Database query prerequisites To create a consistent report, the following constraints must be observed: 1. The name of the WinCC Runtime database must be called up dynamically during the database query, since the name of the WinCC Runtime database can change, for example, by downloading a project completely or by archiving / retrieving a project in SIMATIC Manager. 2. Implement a handling for server redundancy if the default master is not available or cannot be started. Entry ID: 64906050, V1.0, 03/2017 5

2 Creating a user-defined report 2.2 Example data The following example shows how a pie chart can be created from the data of two WinCC user archives used by APF. The first WinCC User Archive contains the material management data (FB_MATERIAL_001). The second WinCC User Archive contains the data for production tracking (FB_ARCHIVING_001). Entry ID: 64906050, V1.0, 03/2017 6

3.1 Creating connection to WinCC database In this example, a redundant OS server pair (SV80A and SV80B) is connected to the information server. 1. Start the Information Server client. 2. Go to the Configuration" view and click on "Reporting". 3. Under "Connect projects", fill in the appropriate fields and then click on the "Select projects button: Server name or IP address: SV80A (Default Master/ Single OS Server or OS Single Station) Type: WinCC- / PCS 7 OS SQL instance: wincc Entry ID: 64906050, V1.0, 03/2017 7

4. Enter a project name, activate the options box and click on the "OK" button. Result An information server connection to the redundant WinCC OS server pair has been successfully created. Information Server Client (left) The project will be created under the given name SV80A. The name "SV80A" is used for the "project" parameter when the report is created. SQL Management Studio (right) In the SQL server instance of the information server, the two linked servers SV80A\wincc and SV80B\wincc are created automatically under "Server Objects -> Linked Servers". Within the report template, these are referenced as SQL server instances for the data query. Entry ID: 64906050, V1.0, 03/2017 8

3.2 Defining the data contents of the report This example refers to the two example WinCC User Archives from Section 2.2 "FB_MATERIAL_001" and "FB_ARCHIVING_001" of the APF demo project. 1. Copy the template "ISBase.rdl" from the corresponding folder and open it. (C:\Program Files (x86)\siemens\informationserver\rdl\isbase.rdl) 2. Open the report properties via right-clicking> Report Properties... " Entry ID: 64906050, V1.0, 03/2017 9

3. Click on References and delete the complement:,version=7.3.0.0, Culture=neutral, PublicKeyToken=10e6533682f60eab. Confirm by clicking on the "OK button. 4. To access the data in the WinCC User Archive, right-click Add Dataset... " Note The Text query offers the most flexibility. Entry ID: 64906050, V1.0, 03/2017 10

5. The following query includes the determination of the database name as well as the overlapping of the server redundancy and connects NAME and TYPE from "FB_MATERIAL_001" to PV (= process value production quantity ) from "FB_ARCHIVING_001" (archiving group type "BATCH-related"). Query for redundancy cover and WinCC Runtime database name finding DECLARE @prefix AS SYSNAME, @retval int SET @prefix = 'SV80A\WINCC' SET @retval = 0 BEGIN TRY EXEC @retval = sys.sp_testlinkedserver @prefix END TRY BEGIN CATCH SET @retval = sign(@@error) END CATCH IF @retval = 0 SELECT @prefix = '[SV80A\WINCC].' + name + '.dbo.' FROM [SV80A\WINCC].master.sys.databases WHERE name LIKE 'CC_%R' IF @retval <> 0 OR @prefix = 'SV80A\WINCC' SELECT @prefix = '[SV80B\WINCC].' + name + '.dbo.' FROM [SV80B\WINCC].master.sys.databases WHERE name LIKE 'CC_%R' Entry ID: 64906050, V1.0, 03/2017 11

Query without redundancy cover: DECLARE @prefix AS SYSNAME SELECT @prefix = '[SV80A\WINCC].' + name + '.dbo.' FROM [SV80A\WINCC].master.sys.databases WHERE name LIKE 'CC_%R' Query for the desired data in the report EXECUTE ( ) SELECT UA#FB_MATERIAL_001.NAME AS ProductName,UA#FB_ARCHIVING_001.PV AS Quantity FROM ' + @prefix + 'UA#FB_ARCHIVING_001 INNER JOIN ' + @prefix + 'UA#FB_MATERIAL_001 ON UA#FB_MATERIAL_001.REC_ID = UA#FB_ARCHIVING_001.MAT_ID WHERE UA#FB_MATERIAL_001.TYPE = 2' Result A database query and its content were created. Entry ID: 64906050, V1.0, 03/2017 12

Testing the database query Before the report is implemented, the query should be pre-tested in the SQL Management Studio (the aggregate (SUM... GROUP BY) explicitly added in the following query is implicitly executed by the report generator) Query for the SQL Management Studio as plain text: -- How to access WinCC user archives on redundant OS servers -- use cases covered by this approach: -- while server B is in master mode: -- - server A is switched off -- - WinCC project has not been opened on server A -- - server A is in stand-by mode (data synchronized from server B) -- use cases NOT covered by this approach: -- - WinCC project has been opened on server A, but not started yet: old outdated data will be read out from server A -- Adaption to other projects: server A name to be adapted 4 times, server B name to be adapted 2 times (do not add or remove any brackets) DECLARE @prefix AS SYSNAME, @retval int -- define server A database instance name as shown in Linked Servers list (without brackets, to be adapted 1 time) SET @prefix = 'SV80A\WINCC' SET @retval = 0 -- check whether server A is available BEGIN TRY EXEC @retval = sys.sp_testlinkedserver @prefix END TRY BEGIN CATCH SET @retval = sign(@@error) END CATCH -- if server A is available: IF @retval = 0 Entry ID: 64906050, V1.0, 03/2017 13

-- define prefix for server A database instance name (including brackets, to be adapted 2 times!) SELECT @prefix = '[SV80A\WINCC].' + name + '.dbo.' FROM [SV80A\WINCC].master.sys.databases WHERE name LIKE 'CC_%R' -- if server A is not available -- or CC_%R database has not been found in server A database instance (without brackets, to be adapted 1 time) in case of WinCC project closed: IF @retval <> 0 OR @prefix = 'SV80A\WINCC' -- define prefix for server B database instance name (including brackets, to be adapted 2 times!) SELECT @prefix = '[SV80B\WINCC].' + name + '.dbo.' FROM [SV80B\WINCC].master.sys.databases WHERE name LIKE 'CC_%R' -- for check in Messages window (e.g. "@prefix = [SV80A\WINCC].CC_OSS1_16_12_06_08_27_29R.dbo.") PRINT '@prefix = ' + @prefix -- define statement, add prefix to each table name EXECUTE ( SELECT UA#FB_MATERIAL_001.NAME AS ProductName,SUM(UA#FB_ARCHIVING_001.PV) AS Quantity FROM ' + @prefix + 'UA#FB_ARCHIVING_001 INNER JOIN ' + @prefix + 'UA#FB_MATERIAL_001 ON UA#FB_MATERIAL_001.REC_ID = UA#FB_ARCHIVING_001.MAT_ID ) WHERE UA#FB_MATERIAL_001.TYPE = 2 GROUP BY UA#FB_MATERIAL_001.NAME' 3.3 Layout definition Use the Chart Wizard to display the data from "DataSet1" as a pie chart. 1. Open the Chart Wizard by selecting "Chart> Chart Wizard...". Entry ID: 64906050, V1.0, 03/2017 14

2. Select the desired data set and click on the "Next" button. 3. Select "Pie Chart" as chart type and then click on the "Next>" button. Entry ID: 64906050, V1.0, 03/2017 15

4. Select the "ProductName" field as the category and the "Quantity" field for the sum totals, then click on the "Next>" button. 5. Select the desired display style and then click on the Finish>>" button. Entry ID: 64906050, V1.0, 03/2017 16

6. To display the values in the pie chart, open the context menu by clicking with the right mouse button on the diagram "Add data labels" in the pie chart. 7. Click on the "Run button. Entry ID: 64906050, V1.0, 03/2017 17

8. Select the project. To create a report, click on the "View Report" button. Result Note The name of the project corresponds to the name of the connection between the WinCC Runtime project and the information server in Section 3.1. A production report has been created with the desired type of data display. Entry ID: 64906050, V1.0, 03/2017 18

Changes to the database query allow you to display other information, such as, for instance, raw material consumption. Entry ID: 64906050, V1.0, 03/2017 19

3.4 Uploading the report template Name the report template as it is to appear in the information server client. 1. Open the report properties via right-click> Report Properties. 2. Go to "Default Values" and click on the "Function" button. Entry ID: 64906050, V1.0, 03/2017 20

3. Replace the expression "ISBase" with a label of your choice (for example, "APF Production Report V1.1") and click on the "OK" button. 4. Save the report as an RDL file. Entry ID: 64906050, V1.0, 03/2017 21

5. Open the Information Server, change to Administration and click on Reporting. 6. Make a new folder under Templates. 7. Click on the created folder and click on the "Upload" button and "Select files.... Entry ID: 64906050, V1.0, 03/2017 22

8. Select the report you want to create and click on the Open button. Result The Report template has been successfully uploaded to the Information Server. Entry ID: 64906050, V1.0, 03/2017 23

3.5 Creating a report 1. Click on "Create report in the Information Server. 2. Select your project. Entry ID: 64906050, V1.0, 03/2017 24

3. Click on the "Show preview button. To create a report, click on the Create Report" button. Result A production report has been generated successfully. Entry ID: 64906050, V1.0, 03/2017 25

4 Appendix 4 Appendix 4.1 Service and Support Industry Online Support Technical Support Do you have any questions or need assistance? Siemens Industry Online Support offers round the clock access to our entire service and support know-how and portfolio. The Industry Online Support is the central address for information about our products, solutions and services. Product information, manuals, downloads, FAQs and application examples all information is accessible with just a few mouse clicks at: https://support.industry.siemens.com/. The Technical Support of Siemens Industry provides you fast and competent support regarding all technical queries with numerous tailor-made offers ranging from basic support to individual support contracts. Please send queries to Technical Support via Web form: www.siemens.en/industry/supportrequest. Service offer Our range of services includes, inter alia, the following: Product trainings Plant data services Spare parts services Repair services On-site and maintenance services Retrofitting and modernization services Service programs and contracts You can find detailed information on our range of services in the service catalog: https://support.industry.siemens.com/cs/sc Industry Online Support app You will receive optimum support wherever you are with the "Siemens Industry Online Support" app. The app is available for Apple ios, Android and Windows Phone: https://support.industry.siemens.com/cs/ww/en/sc/2067 Entry ID: 64906050, V1.0, 03/2017 26

4 Appendix 4.2 Links and Literature Table 4-1 No. \1\ Siemens Industry Online Support https://support.industry.siemens.com Topic \2\ https://support.industry.siemens.com/cs/ww/en/view/64906050 \3\ 4.3 Documentation of changes Table 4-2 Version Date Change V1.0 03/2017 First version Entry ID: 64906050, V1.0, 03/2017 27