61987141 wincc blocks en copy

179
Application about WinCC Sample Blocks for WinCC and STEP 7 Configuration Example

Upload: thanh-vo-van

Post on 24-Oct-2014

115 views

Category:

Documents


15 download

TRANSCRIPT

Page 1: 61987141 WinCC Blocks en Copy

Application about WinCC

Sample Blocks for WinCC and STEP 7

Configuration Example

Page 2: 61987141 WinCC Blocks en Copy

Warranty, liability and support

Sample Blocks for WinCC and STEP 7 ID Number: 31624179

V1.0 04.11.2008 2/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

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 of safely and professionally using, installing, operating and servicing equipment. When using these Application Examples, you recognize that Siemens 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 – then the contents of the other documents have priority.

Warranty, liability and support 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”). However, claims arising from a breach of a condition which goes to the root of the contract shall be limited to the foreseeable damage which is intrinsic to the contract, unless caused by intent or gross negligence or based on mandatory liability for injury of life, body or health. The above provisions do not imply a change in the burden of proof to your detriment.

Copyright© 2008 Siemens A&D. It is not permissible to transfer or copy these Application Examples or excerpts of them without first having prior authorization from Siemens A&D in writing. For questions about this document please use the following e-mail address:

mailto:[email protected]

Page 3: 61987141 WinCC Blocks en Copy

Foreword

Sample Blocks for WinCC and STEP 7 ID Number: 31624179

V1.0 04.11.2008 3/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Foreword

Objective of the application This document shows how STEP 7 and WinCC are used to solve an automation problem in process engineering.

The sensors (binary and analog values) and actuators (valves, motors) of a plant form the basis of each automation project. The standard scope of delivery of STEP 7 and WinCC does not include technological blocks to configure the basic level of automation. The basic level of automation comprises the following functions:

• Processing the information of the sensors and actuators

• Controlling the actuators

Higher-level automation tasks, for example controls or step sequences, can only be configured after the basic level of automation has been configured.

Main contents This application describes the creation and configuration of the basic level of automation. The configuration of the technological blocks is described in detail, for instance to process binary and analog values and to control valves and motors. The technological blocks are designed in such a way that different operating modes of the plant (Local, Manual, Automatic and Simulation mode) are possible.

This document describes how the technological blocks are called and interconnected in STEP 7 and WinCC. For this purpose, an example plant was configured that consists of several binary and analog values, valves and motors. The sample project shows the interconnection of the technological blocks (basic level of automation). Higher-level automation functions (two-step control and PID closed-loop control) are also configured.

By means of the example plant, this application describes how automatic functions without real connection to the process can be tested with minimum overhead. In this way, automatic functions can be tested already during the configuration (e.g., in the office). For this purpose, the technological blocks feature the “Simulation ON” operating mode. The feedbacks of sensors and actuators are simulated by the actual technological blocks. For example, the “Valve OPEN” feedback is simulated when the “Valve OPEN” control command is output. Furthermore, independent blocks for simulating different controlled systems are made available to simulate, for instance, the temperature or the level of a tank.

Page 4: 61987141 WinCC Blocks en Copy

Foreword

Sample Blocks for WinCC and STEP 7 ID Number: 31624179

V1.0 04.11.2008 4/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

For WinCC V7.0 and higher, the “Faceplate Type” object type is available. This application describes how the “Faceplate Type” object type can be used to dynamize the block icons in the process pictures. The application describes which picture opening time can be expected depending on the type of dynamization and the number of faceplate types used in the picture. The application describes how block icons can be alternatively configured to achieve shorter picture opening times.

Reference to Automation and Drives Service & Support This entry is from the internet application portal of Automation and Drives Service & Support. The link below takes you directly to the download page of this document.

http://support.automation.siemens.com/WW/view/en/31624179

Page 5: 61987141 WinCC Blocks en Copy

Foreword

Sample Blocks for WinCC and STEP 7 ID Number: 31624179

V1.0 04.11.2008 5/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Table of Contents

Table of Contents ......................................................................................................... 5

Application Description ............................................................................................... 8

1 Automation Problem ...................................................................................... 8 1.1 Requirements ................................................................................................... 8 1.2 Requirements for the control program .............................................................. 9 1.3 Requirements for the visualization.................................................................. 10

2 Automation Solution .................................................................................... 13 2.1 WinCC integrated in the SIMATIC Manager with CFC ................................... 13 2.2 Alternative solutions........................................................................................ 18 2.2.1 WinCC integrated in the SIMATIC Manager without CFC .............................. 18 2.2.2 WinCC and SIMATIC Manager – separate configuration ............................... 18 2.2.3 Using the “Basic Process Control” option ....................................................... 18 2.2.4 Using PCS 7 ................................................................................................... 19 2.3 Hardware requirements .................................................................................. 20 2.4 Used software components ............................................................................ 20

3 Integrating WinCC into the SIMATIC Manager ........................................... 26 3.1 Installing WinCC ............................................................................................. 26 3.2 Setting up the message classes and message types in WinCC..................... 26 3.3 Setting up the user text blocks in WinCC ....................................................... 26

4 Configuring the Picture Management Functions....................................... 27 4.1 WinCC pictures for the screen management.................................................. 27 4.2 Scripts for the picture management................................................................ 31

5 General Configuration of Faceplates.......................................................... 33 5.1 Loading a faceplate template and making it visible ........................................ 33 5.1.1 BSM_WORK.pdl ............................................................................................. 33 5.1.2 BSM_TopfieldOpen() ...................................................................................... 34 5.2 Supplying the dynamic picture elements of the faceplate template with process

data ............................................................................................................ 34 5.3 General layout of the WinCC faceplates......................................................... 35 5.4 Configuring the faceplates .............................................................................. 36 5.5 Configuring the block icons............................................................................. 38 5.5.1 Dynamization with WinCC status displays...................................................... 38 5.5.2 Centrally changeable block icons by “Faceplate Types” ................................ 39 5.5.3 Configuring the TooltipText and the measuring point display......................... 47

6 Configuring technological Subfunctions ................................................... 49 6.1 Overview of the data exchange between controller and WinCC .................... 49 6.1.1 Displaying process statuses in the WinCC process picture............................ 50 6.1.2 Logging messages in WinCC Alarm Logging ................................................. 52

Page 6: 61987141 WinCC Blocks en Copy

Foreword

Sample Blocks for WinCC and STEP 7 ID Number: 31624179

V1.0 04.11.2008 6/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6.1.3 Triggering switching commands in the WinCC process picture...................... 54 6.1.4 Processing switching commands in the controller .......................................... 57 6.2 HAND/AUTO changeover............................................................................... 58 6.2.1 Status signals ................................................................................................. 58 6.2.2 Control signals ................................................................................................ 59 6.2.3 Display in the process picture......................................................................... 60 6.2.4 Display in the faceplate................................................................................... 63 6.2.5 Operating in the faceplate............................................................................... 64 6.3 Local/Remote changeover.............................................................................. 64 6.3.1 Status signals ................................................................................................. 65 6.3.2 Control signals ................................................................................................ 65 6.3.3 Display in the process picture......................................................................... 67 6.3.4 Display in the faceplate................................................................................... 70 6.3.5 Operating in the faceplate............................................................................... 71 6.4 General status changeover (e.g., On/Off, Open/Closed................................. 71 6.4.1 Status signals ................................................................................................. 72 6.4.2 Control signals ................................................................................................ 73 6.4.3 Display in the process picture......................................................................... 76 6.4.4 Display in the faceplate................................................................................... 78 6.4.5 Operating in the faceplate............................................................................... 79 6.5 Enabling/disabling simulation ......................................................................... 79 6.5.1 Status signals ................................................................................................. 80 6.5.2 Control signals ................................................................................................ 81 6.5.3 Display in the process picture......................................................................... 82 6.5.4 Display in the faceplate................................................................................... 85 6.5.5 Operating in the faceplate............................................................................... 85 6.6 Displaying and resetting INTERLOCK............................................................ 86 6.6.1 Signals ............................................................................................................ 87 6.6.2 Display in the process picture......................................................................... 88 6.6.3 Display in the faceplate................................................................................... 91 6.6.4 Operating in the faceplate............................................................................... 92 6.7 Displaying and resetting messages, group messages.................................... 92 6.7.1 Status signals ................................................................................................. 93 6.7.2 Control signals ................................................................................................ 96 6.7.3 Display in the process picture......................................................................... 96 6.7.4 Display in the faceplate................................................................................... 99 6.7.5 Operating in the faceplate............................................................................. 100 6.8 Setting/resetting parameters (bit toggle)....................................................... 100 6.8.1 Restrictions of the “check box” standard Windows control ........................... 100 6.8.2 Creating a project-specific “check box”......................................................... 102 6.8.3 Using the project-specific “check box” .......................................................... 107

7 Functions for PC Diagnostics ................................................................... 111

Page 7: 61987141 WinCC Blocks en Copy

Foreword

Sample Blocks for WinCC and STEP 7 ID Number: 31624179

V1.0 04.11.2008 7/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

7.1 Display of the general computer utilization ................................................... 111 7.2 Display of special hardware information ....................................................... 112

8 Description of technological Blocks......................................................... 115 8.1 BST_DIGITAL (FB650 binary value display) ................................................ 116 8.2 BST_ANALOG (FB640 analog value display) .............................................. 118 8.3 BST_ILOCK (FB651 parameterizable AND/OR operation) .......................... 122 8.4 BST_MOTOR (standard motor block) .......................................................... 125 8.5 BST_VALVE (standard valve block) ............................................................. 129 8.6 BST_SIMODIR (FB611 SIMOCODE pro direct starter)................................ 132 8.7 BST_SIMOREV (SIMOCODE pro reversing starter) .................................... 137 8.8 BST_FF (FB653 operator-controllable flipflop) ............................................. 141 8.9 BST_COUNT (FB654 counter, integrator) .................................................... 143 8.10 BST_LAG (PT1 time-delay element) ............................................................ 146 8.11 BST_SPLITR (splitting a controller control command for two actuators)...... 147 8.12 BST_CONST (using constants in the CFC).................................................. 148 8.13 BST_MSG (general message)...................................................................... 149 8.14 BST_OBGEN (generating error OBs)........................................................... 149

9 Description of the Example Plant.............................................................. 150 9.1 Basic level of automation.............................................................................. 150 9.1.1 General instantiation..................................................................................... 150 9.1.2 Interlocks ...................................................................................................... 153 9.2 Additional simulation of process variables.................................................... 155 9.2.1 Central enable/disable of “Automatic” mode................................................. 156 9.2.2 Central enable/disable of “Simulation” mode................................................ 158 9.2.3 Simulation of controlled systems without inherent regulation (for example,

level)......................................................................................................... 161 9.2.4 Simulation of self-regulating processes (for example, temperature)............. 165 9.3 Higher-level automatic functions................................................................... 168 9.3.1 Two-step temperature control tank Unit 13 “TIC160” ................................... 168 9.3.2 PID temperature control tank Unit 14 ........................................................... 170

Appendix and References........................................................................................ 172

10 References .................................................................................................. 172

11 Appendix ..................................................................................................... 173

12 History ......................................................................................................... 173

Page 8: 61987141 WinCC Blocks en Copy

Automation Problem

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 8/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Application Description

1 Automation Problem

1.1 Requirements

To automate a process plant with STEP 7 and WinCC, it is advisable to describe the individual automation functions in detail before starting the configuration. Before the start of the configuration, the following information of a plant should be available:

• Process flow diagrams The plant with the individual measuring points is schematically shown in one or more process flow diagrams. The diagrams represent the individual units of equipment and the associated piping. The process flow diagrams also show the individual measuring points with the measuring point names. Normally, these process flow diagrams form the basis for creating the WinCC process pictures.

• Measuring point list The measuring point list lists all measuring points with their names and associated detailed information.

Example: The measuring point name is, for example, “TIC120”. The name provides the following information. o “T” The measured physical quantity is a temperature.

o “I” The temperature is acquired as an analog value.

o “C” The temperature is used for closed-loop control.

o “120” The measuring point has a unique number, “120”.

The detailed information includes, for example, the following information:

o Measuring point comment (brief description, e.g., temperature tank 120)

o Manufacturer of the field device

o Measuring transmitter type (for example, 20 mA)

o Range of values (upper and lower measuring range)

o Unit of measurement

Page 9: 61987141 WinCC Blocks en Copy

Automation Problem

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 9/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• List of interlocks The list of interlocks includes information of the measuring points that have to be locked under specific conditions. When a measuring point is locked, the device associated with the measuring point goes to safety position.

Example The inlet valve of a tank must be closed when the level monitoring of the tank provides the “Tank Full” signal or when the measuring point for the level monitoring is faulty.

• Signal flow diagrams, functional descriptions Signal flow diagrams or functional descriptions frequently describe production sequences. This information is often the basis for creating automatic functions or step sequences.

1.2 Requirements for the control program

Some requirements for the program of the controller are listed below:

Simple program structure The structure of the control program is to be simple. An independent chart including the program code for a measuring point is to be created for each measuring point. The chart name is to contain the actual measuring point name. This enables the programmer or future maintenance staff to quickly find the program for a measuring point.

Reusable program code Repetitive program code should be programmed as a closed block. The closed block is called where the program code is required. This ensures that constantly recurring tasks can be solved in the same way. This saves time and avoids errors.

Use of blocks that can be operated and monitored The control program should be designed so that important program functions can be operated and monitored in WinCC Runtime.

Example

It should be possible to display the locking conditions of a valve or motor in Runtime. This informs the operator on the reason why the valve cannot be opened or why the motor cannot be switched on. During the commissioning phase, it is very useful if the locking conditions can be reset or set.

Page 10: 61987141 WinCC Blocks en Copy

Automation Problem

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 10/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

1.3 Requirements for the visualization

Industrial process flows are usually graphically represented in one or several process pictures. For the most part, these process pictures correspond to the process flow diagrams.

The figure below shows a WinCC process picture in process automation. Figure 1-1

Some requirements for the visualization are to be explained by means of this process picture.

Centrally changeable block icons The dynamic components of a process picture are to be realized as block icons. The block icons are created separately, tested and subsequently integrated into the process pictures. The block icons are to be centrally changeable.

Centrally changeable means: If a block icon is to be changed later, it is not required that all process pictures be modified in which the block icon has already been used. The change is to be made once at a central location.

Space saving block icons Since as many measuring points as possible are to be displayed in the process pictures, it is necessary that the configuration of the block icons be space saving. For this reason, the block icons are displayed as follows:

• Do not use borders for measuring points

Page 11: 61987141 WinCC Blocks en Copy

Automation Problem

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 11/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• The measuring point name is not permanently displayed in the picture. If required, the measuring point name can be shown and subsequently hidden in Runtime. The measuring point name is additionally displayed as TooltipText.

• The classic WinCC group display is not to be used in the customized object. The classic group display displays the icons for the different message types side by side. This might waste valuable space. For example, the display of a group warning is not important if a group alarm or a measuring point fault occur simultaneously. If possible, the individual pieces of information of a group display are to be superimposed according to the priority. This enables the user to considerably reduce the block icon size. For instance, the display of a warning can be superimposed by the display of an alarm or a measuring point fault.

Multi-stage operating concept Intervening in the process is not to be possible directly in the process picture, but only by opening an additional faceplate. In the faceplate, specific control elements (buttons, input fields) can be released for operation according to the operator control rights of the currently logged on user. In addition, the operator control rights can be checked directly when executing the action (e.g., in the script).

Triggering operator input messages All important WinCC Runtime operations are to be logged.

Example:

The use of the “ON”/“OFF” or “HAND”/“AUTO” buttons is to be logged. Opening or closing a faceplate is not to be logged.

Uniform display Functions of the same type (e.g., simulation ON/OFF, HAND/AUTO, …) in different blocks are to be displayed in the same way.

Generating WinCC configuration data It is to be possible to generate the essential configuration data of the WinCC project from the control program. In the case of an “integrated” WinCC project, the WinCC tags, alarms/messages, texts and archive tags are automatically created in the WinCC project by the compilation. This avoids configuration errors and saves configuration time.

Easy and time-saving configuration Parts of the configuration that are not automatically generated are to be as simple as possible to avoid errors and to save time.

Page 12: 61987141 WinCC Blocks en Copy

Automation Problem

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 12/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Saving external WinCC tags To minimize license costs, the number of external WinCC tags is to be as small as possible.

Example:

The bits of a status word are not to be transferred to WinCC individually as a BOOL tag, but as a BYTE, WORD or DWORD tag.

Short picture opening times The process pictures are to be configured so that the picture opening times are to be as short as possible. The picture opening time is the time that passes when a button for changing the picture is used and until the picture has been loaded and all dynamizations have been updated. In practical operation, picture opening times of less than 2 s are required.

Support of several screens in Runtime (multi-VGA) If the WinCC station has several screens (multi-VGA), these screens are to be supported by Runtime.

Support of WinCC multi-clients The WinCC configuration is to be performed in such a way that WinCC clients (multi-clients) are supported.

Support of WinCC Web clients The WinCC configuration is to be performed in such a way that WinCC Web clients are supported.

Display of invalid process statuses The display of invalid process statuses is to be clearly visible. Invalid process statuses can, for example, occur when:

• The connection to the controller is interrupted.

• The address of an external WinCC tag is incorrectly configured.

• The dynamization in the picture is incorrect.

• A picture is selected and the dynamizations have not yet been updated.

Page 13: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 13/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

2 Automation Solution

2.1 WinCC integrated in the SIMATIC Manager with CFC

In this application, WinCC is used as an integrated project. The WinCC project is integrated in the SIMATIC Manager (STEP 7). The measuring points of an automation project are configured in the CFC by STEP 7. Each measuring point is configured in a separate CFC. In the CFC, both the message texts and the texts for measuring point names, measuring point comments and units of measure are configured. A compilation subsequently transfers the information to WinCC.

The existing measuring points are combined according to different measuring point types before the start of the configuration. For example, there are binary values, analog values, valves, pumps. An independent block (block type) is created for each measuring point type. For most block types of this application, a block icon and a faceplate for operator control and monitoring are additionally created.

The following technological blocks were created within the scope of this application: Table 2-1

Block Description

BST_DIGITAL Binary value display Display of a binary signal with the following options: Time delay, negation of the input signal and simulation. Operation: Simulation On/Off

BST_ANALOG Analog value display Conditioning and display of an analog signal, limit monitoring and simulation. Data types

– Raw values of S7 analog modules – S7 REAL values

Limits A maximum of 4 limits are possible and each limit

– can be parameterized as limit violation or limit value underflow

– can be activated or deactivated – can be additionally parameterized as a message – can be displayed with an additional text (e.g.,

“TANK EMPTY”)

Page 14: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 14/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Block Description

BST_MOTOR Operator control and monitoring of the motor • Displayed statuses:

– On/Off/Switches On/Switches Off status – Local/Remote status – “Hand/Automatic” operating mode – Simulation On/Off feedback

• Displayed errors: – Motor protection – External error – Feedback monitoring – Interlock – Dry run (intended)

• Operation: – Reset error – Local/Remote status – HAND/Automatic operating mode – On/Off status – Simulation On/Off feedback

• BST_VALVE Operator control and monitoring of the valve

• Displayed statuses: – Closed/Open/Opening/Closing status – Local/Remote status – “Hand/Automatic” operating mode – Simulation feedback – Closed/Open

• Displayed errors: – External error – Feedback monitoring – Interlock

• Operation: – Reset error – Local/Remote status – HAND/Automatic operating mode – On/Off status – Simulation On/Off feedback

BST_SIMOREV SIMOCODE reversing starter BST_SIMODIR SIMOCODE direct starter

Page 15: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 15/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Block Description

BST_ILOCK AND/OR gate that can be visualized Functions:

– AND/OR function selectable – Maximum of 8 input signals – Negation of the inputs possible – Negation of the output possible – Simulation (setting or resetting) of an input

possible in Runtime – Simulation (setting or resetting) of the output

possible in Runtime – The interlocking texts configured in the CFC are

displayed This block is, for example, called by other faceplates to display locking conditions in Runtime

BST_FF RS flipflop that can be visualized • Displayed statuses:

– FF output status – “Hand/Automatic” operating mode

• Operation: – On/Off status – HAND/Automatic operating mode – On/Off status –

BST_COUNT Counter/integrator This block can be used as both a simple counter and as an integrator. It features several counter inputs and control inputs. It can, for instance, be used to simulate a level of a tank depending on several valve states (inlet/outlet)

BST_LAG PT1 element (1st order time delay) This block can be used for the simulation of self-regulating processes (e.g., temperature in a tank). In addition to the constants of the PT1 element, it features further inputs to conveniently simulate a controlled variable depending on valves.

BST_SPLITR SPLITRANGE This block splits the output signal of a PID controller (0%..100%) into two output signals. This ensures that, for instance, the output signal of a PID controller can be used to control a control with two actuators. (E.g., temperature control with heating circuit and cooling circuit)

BST_CONST This block is used to specify fixed parameters in the CFC that are to be used multiple times.

BST_OBGEN This block causes the generation of the error OBs (e.g., OB84)

Page 16: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 16/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

The technological blocks described above are provided with the associated sources.

NOTICE Before using the blocks in your own projects, you have to check their function and adapt it to your requirements if necessary. The blocks of this application are merely templates for creating your own blocks.

The sample project of this application shows the use of the technological blocks by means of an example plant.

The example plant consists of several binary and analog values, valves and motors. A separate CFC in which the associated block type is called and interconnected was created in STEP 7 for each measuring point. Higher-level automation functions (two-step control and PID closed-loop control) have also been configured.

The figure below exemplifies the screen on a configuration system for STEP 7 and WinCC.

Page 17: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 17/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 2-1-2

This figure shows the following components of the configuration:

• SIMATIC Manager The configured charts are visible in the working area of the SIMATIC Manager. Each measuring point of an automation task (e.g., motor E203) is configured as an independent chart.

• CFC Editor An opened CFC is displayed on the right screen edge. It shows the interconnection of a motor block (SIMOCODE) in test mode. The signals can be monitored and controlled online.

• WinCC Runtime WinCC Runtime is visible in the background. The process picture displays several block icons and piping. The bottom left edge shows an opened faceplate of the “SIMOREV” block type (SIMOCODE reversing starter).

Page 18: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 18/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

2.2 Alternative solutions

2.2.1 WinCC integrated in the SIMATIC Manager without CFC

It is not required that the STEP 7 CFC (continuous function chart) option be used. The STEP 7 configuration can be performed in a conventional way in STL, LAD or FBD. When the WinCC project is integrated in the STEP 7 project, the following configuration data can be transferred from the STEP 7 project to the WinCC project:

• Tags (tag management)

• Alarms, messages (Alarm Logging)

• Trend configuration (Tag Logging)

The use of SCL is not mandatory.

However, there are restrictions with regard to the use of the CFC:

• Some block attributes are only available when using the CFC (S7_comment, S7_unit). For example, the texts for the measuring point names, measuring point comments, units of measurement cannot be transferred to WinCC without increased overhead. The FAQ with ID number 27147567 describes how the “S7_enum” S7 block attribute can be used alternatively to transfer texts of enumerations from STEP 7 to WinCC.

• The “Charts” folder is not available without the STEP 7 CFC option. The measuring points are programmed directly in the STEP 7 blocks in LAD, FBD or STL. CFC offers the advantage that each measuring point can be configured in a separate chart. This is not possible without CFC.

2.2.2 WinCC and SIMATIC Manager – separate configuration

The procedure for configuring the technological blocks described in this application can also be applied to projects in which WinCC is not integrated in the SIMATIC Manager. The essential differences are:

• Configuration data (tags, messages, texts) for WinCC are not automatically transferred from STEP 7 to WinCC by a compilation.

• The chronological order message procedure.(e.g., ALARM_8P) cannot be used. The bit message procedure has to be used.

2.2.3 Using the “Basic Process Control” option

The WinCC “Basic Process Control” option provides functions for managing pictures and for calling faceplates. For WinCC V6.0 and higher, the “Basic Process Control” option is available free of charge, it can be selected when installing WinCC.

Page 19: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 19/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

For instance, the Runtime layout (number and resolution of screens) can be configured. The process pictures can be stored in the picture tree. The configuration is performed as in PCS 7.

The WinCC “Basic Process Control” option (Process Control options) does not include technological blocks (for example, motor, valve). They have to be created by the user. To do this, the procedure described in this document can be used.

Note The WinCC “Basic Process Control” option can also be used if WinCC is not integrated in the SIMATIC Manager. However, the Runtime overview area then includes WinCC group displays that are not supplied with valid values. A possible remedy is not to use “Basic Process Control” or to proceed as described in the FAQ with ID number 17778440.

2.2.4 Using PCS 7

When using PCS 7, additional functions are available to the user:

PCS 7 standard library The PCS 7 standard library already includes technological blocks. For instance, there are blocks for the display of a binary or analog value or for operator control and monitoring of a valve or motor.

Plant hierarchy Without PCS 7, only the “Component view” is available to the user in the SIMATIC Manager. All charts for configuring the measuring points are stored in the “Charts” folder of the Component view.

When using PCS 7, additional views are added in the SIMATIC Manager. For example, hierarchy folders can be created in the “Plant View”. This enables the user to structure the plant, e.g. “Plant > Unit > Function”. The configured plant hierarchy is displayed in Runtime by the picture tree (Picture Tree Manager).

Graphic Object Update Wizard Block icons can be automatically integrated into the process pictures or updated. Which block icons are to be used in the process pictures is already defined when configuring the measuring points in the CFC.

Additional functions in the Graphics Designer • Extended status display

The extended status display can be used as an alternative to the WinCC group display for the display of alarms and messages in the process picture.

• Extended analog display

Page 20: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 20/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Faceplate Designer The Faceplate Designer is only available for PCS 7. It is a tool for configuring faceplates.

2.3 Hardware requirements

Table 2-2

Component No. Development system

1 PC for configuring the controller and WinCC. The hardware requirements for STEP 7 and WinCC apply.

S7-400 CPU 1 The technological blocks of this application use the chronological order message procedure (ALARM_8P). For this reason, an S7-400 CPU is necessary. Alternatively, the controller can also be simulated with PLCSIM.

2.4 Used software components

Table 2-3

Component Note STEP 7 V5.4 SP3 Professional

The scope of delivery includes S7-PLCSIM and S7-SCL • S7-PLCSIM can be used for the simulation • S7-SCL is used for creating the control

blocks. CFC V7.0 SP1 CFC is used for easy interconnection of the

blocks. In addition, CFC provides the option of transferring texts (measuring point comment, units of measurement, interlocking texts, ...) to WinCC.

WinCC V7.0 WinCC WebNavigator V7.0 SIMATIC PDM V6.0 SP3 Used to parameterize a special field device,

SIMOCODE pro. SIMOCODE ES 2007 SP1 Used to parameterize a special field device,

SIMOCODE pro. SIMATIC PC DiagBase and SIMATIC PC DiagBridge

These two software components can be used to display hardware diagnostic information of “B generation” SIMATIC PCs.

Page 21: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 21/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Sample project The figure below shows the configuration of the sample project. Figure 2-3-4

The following list contains all files and projects that are used in this example. Table 2-4

Component Note bsmi.zip This file is a WinZip archive. It contains the STEP 7

project, including the integrated WinCC project. winccblocks_e.pdf This document. Bsmi.STEP7_Sourcen.zip This file is a WinZip archive. It contains the sources

of the technological blocks configured in the STEP 7 project.

Proceed as follows to edit the sample project:

• Extract the “bsmi.zip” WinZip archive.

• Open the SIMATIC Manager and open the previously extracted “bsmi” STEP 7 project.

Page 22: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 22/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

The figure below shows the opened “bsmi” STEP 7 project in the SIMATIC Manager. Figure 2-5

The project includes the following stations:

• “PLC1” SIMATIC 400 station This station contains the program of the controller.

Note The “Sources” folder includes the sources of the technological blocks.

The “Charts” folder contains the CFCs. The CFCs represent the configuration of an example plant. It is shown how the technological blocks are interconnected to configure a plant.

• “OS11” SIMATIC PC station

This station contains the “bsm” WinCC server project. The WinCC configuration is explained by means of this project. The “OS11” station is additionally set up as a web server.

• “OSC21” SIMATIC PC station This station contains a “bsmc” WinCC client project. This project is used to test the configuration on a WinCC multi-client.

• WinCC.Web client It is possible to access WinCC Runtime with WinCC Web clients. The web clients access the web server of the “OSC21” SIMATIC PC station. The web clients are not configured in the SIMATIC Manager.

Page 23: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 23/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• “SIMOCODE pro” PROFIBUS DP field device When creating this application, the “SIMOCODE pro” field device was available as a demo case.

• “XGETMSGCLASS” SIMATIC PC station This station contains a WinCC project that has been configured using OS Project Editor. The correlations between message classes and message texts of STEP 7 and WinCC are summarized in the FAQs with ID numbers 31622970 and 30550239. This station is not used for direct configuration. But the WinCC project of this station can be used for referencing (correlations between message classes and message texts of STEP 7 and WinCC ).

Note On the “OCS21” WinCC client

The WinCC client was configured as follows:

• Creating client project A SIMATIC PC station named “OSC21” was created in the SIMATIC Manager. A WinCC project of the “WinCC Application Client” type was created in this station. The name of the WinCC client project is “bsmc”.

• Copying scripts The scripts (project functions) configured in the “bsm” server project and the header file were copied to the “bsmc” client project. The “BSM_BasicScreenManager” and “BST_BasicTypical” folders and the “bst.h” file were copied from the server project to the library directory of the client project. Figure 3-3

Page 24: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 24/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

When changing scripts or creating new scripts, you have to copy them to the client project and subsequently load the client station.

• Configuring start picture The actual client does not include pictures. The “BSM_Main.pd” picture from the server package of the “bsm_SIMATIC” WinCC server is used as a start picture. Figure 2-6

The following Runtime test was performed on the WinCC client:

• Runtime could be successfully started. • The process pictures and faceplates could be successfully called. • The displays correspond to the displays on the server. • Operation via the faceplates was possible. Operator messages were

generated. • Measuring point names and tooltip texts were displayed on the client.

Page 25: 61987141 WinCC Blocks en Copy

Automation Solution

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 25/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Notes On web server and web client:

Web server and web client were configured in the WinCC Information System as described in the documentation.

The “OS11” station was set up as a web server.

A computer with Windows operating system and Internet Explorer was used as a web client. This computer was not included in the SIMATIC Manager project.

The following behavior was detected on the web client:

• Runtime could be successfully started. • The pictures could be successfully selected.

The buttons for picture selection are located in the footer (key area). If buttons for changing the picture are configured directly in the process picture, an empty picture is frequently called in Runtime. If necessary, the “BSM_WorkfieldOpen()” script for changing the picture has to be modified.

• The faceplates can be successfully opened. • The displays correspond to the ones of the web server. • Operation is possible via the faceplates. • The tooltip texts and measuring point names are not successfully displayed

on the block icon. If necessary, the associated “BST_XXX_SetToolTip()” script for setting the texts when opening the picture has to be adjusted.

• The picture opening times on the web client were significantly shorter than on the web server or WinCC server.

Page 26: 61987141 WinCC Blocks en Copy

Integrating WinCC into the SIMATIC Manager

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 26/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

3 Integrating WinCC into the SIMATIC Manager

This application requires that WinCC be integrated into the SIMATIC Manager.

3.1 Installing WinCC

Note General information on the integration of WinCC into SIMATIC is available in:

• FAQ with ID number 11841504 • FAQ with ID number 22272911 • The WinCC Information System in “Working with WinCC> The Integration of

WinCC in SIMATIC Manager”.

To be able to use WinCC as an integrated project in the SIMATIC Manager, you have to install the following WinCC components: AS-OS-Engineering and Object Manager. When installing WinCC, it is essential that you use “complete installation” (WinCC V7.0 and higher) since this ensures that these two components can be manually selected.

To install AS-OS-Engineering for WinCC V7.0 and higher, proceed as follows:

• During the WinCC setup, select Expert mode and continue the installation.

• The dialog box for selecting the WinCC components is displayed. Now select the “Communication > Object Manager” and “Communication > AS-OS Engineering” options. Continue the installation.

3.2 Setting up the message classes and message types in WinCC

This application does not use OS Project Editor. For this reason, proceed as described in the FAQ with ID number 31622970 to set up the message classes.

Note To determine the correlation between the message classes in STEP 7 and WinCC, the independent “GETMSGCLAS” PC station was created in the SIMATIC Manager.

3.3 Setting up the user text blocks in WinCC

This application does not use OS Project Editor. For this reason, proceed as described in the FAQ 30550239 to set up message texts.

Page 27: 61987141 WinCC Blocks en Copy

Configuring the Picture Management Functions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 27/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

4 Configuring the Picture Management Functions

This section describes how to set up WinCC Runtime so hat it is divided into overview area, working area and key area. The functions for picture navigation (picture change) are provided. It also describes how systems with several monitors are used. The functions for calling faceplates are described in the next section.

Note This section is only of importance if you are not using OS Project Editor. If you are using OS Project Editor, picture management functions (change process picture, open faceplate) are available by default.

4.1 WinCC pictures for the screen management

WinCC Runtime of a WinCC station is realized by the “Graphics Runtime” application (“pdlrt.exe”). To realize the picture management, the following WinCC pictures are configured in the Graphics Designer.

• BSM_Main.pdl

• BSM_DESK.pdl

• BSM_HEAD.pdl

• BSM_WORK.pdl

• BSM_BOTTOM.pdl

Note The “BSM_Alarm.pdl” picture is not used for the actual picture management. It can be loaded to the working area to display messages.

Page 28: 61987141 WinCC Blocks en Copy

Configuring the Picture Management Functions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 28/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

BSM_Main.pdl In the WinCC ControlCenter, you can define the WinCC picture that is loaded when starting Graphics Runtime by selecting “Computer properties > Graphics Runtime”. Select the “BSM_Main.pdl” as a start picture. Figure 4-1

When using several monitors, Graphics Runtime is not executed separately for each monitor, but one Graphics Runtime supplies all monitors. This means that the picture size of the start picture must cover the entire picture area, including all monitors.

Example:

When two monitors are used side by side and each monitor has a resolution of 1280x1024 pixels, the start picture should have a resolution of 2560x1024 pixels. For this case, the following figure shows the configuration of the “BSM_Main.pdl” start picture in the Graphics Designer. Figure 4-2

Note The WinCC Web client is an exception. The WinCC Runtime of a WinCC Web client runs completely within Internet Explorer and Internet Explorer can be run multiple times (also with WinCC).

Page 29: 61987141 WinCC Blocks en Copy

Configuring the Picture Management Functions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 29/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

BSM_Desk.pdl The “BSM_Main.pdl” start picture is subdivided in such a way that a separate “BSM_DESK.pdl” picture window is displayed for each monitor. The “BSM_DESK.pdl” picture is split into several picture windows to display the

• “BSM_HEAD.pdl” overview area

• “BSM_WORK.pdl” working area and

• “BSM_BOTTOM.pdl” key area. Figure 4-3

BSM_WORK.pdl The “BSM_WORK.pdl” picture contains a picture window into which the actual process picture is loaded. The figure below shows the “BSM_WORK.pdl” picture. When starting Runtime, the “P100_Overview.pdl” process picture is displayed. In the “BSM_WORK.pdl” picture, you define the WinCC process picture that is to be displayed when starting Runtime .

Page 30: 61987141 WinCC Blocks en Copy

Configuring the Picture Management Functions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 30/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 4-4

Thus, when changing the picture, only the picture in the “BSM_WORK.pdl” working area is changed, the pictures in the overview area and in the key area are not changed. This procedure offers the following advantages:

• Reduction of the configuration overhead since overview area and key area are not configured in each process picture, but only once (centrally).

• Better performance when changing a picture since fewer picture elements have to be reloaded.

Note The “BSM_WORK.pdl” picture contains several superimposed picture windows. The superimposed picture windows are used to display WinCC faceplates. The functions for faceplate management are described in the next section.

BSM_HEAD.pdl The “BSM_HEAD.pdl” picture is used to display important information in Runtime in the overview area. The information in the overview area is always displayed irrespective of the currently selected process picture, it is not hidden by opened faceplates.

In this application, the overview area displays the following information:

• WinCC Alarm Control for the display of the last three messages

• Output field for the display of the currently logged on user

• Output field for the display of the current computer name

• WinCC Digital Clock for the display of the current date and time

Page 31: 61987141 WinCC Blocks en Copy

Configuring the Picture Management Functions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 31/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• WinCC Logo Figure 4-5

BSM_BOTTOM.pdl The “BSM_BOTTOM.pdl” picture provides buttons for frequently required functions as a keyset. The keyset includes buttons for the following functions:

• Call the start picture

• Call the WinCC message list

• Call the block overview (Typicals)

• PC diagnostics

• Change language

• Logon/logoff

• Exit WinCC

• Hardcopy

• Show/hide measuring point name

• Message acknowledgement

• Horn acknowledgement

Figure 4-6

4.2 Scripts for the picture management

The following C script is available for managing the pictures.

BSM_WorkfieldOpen() The “BSM_WorkfieldOpen()” C script loads the specified “lpszPictureNameNew” picture to the working area of the current monitor. The “lpszPictureName” parameter must contain the absolute picture name of the current picture. Refer to the script in chapter 11, Table 11-1.

It is possible to configure further picture management functions such as

• previous picture

• next picture

• memorize picture

Page 32: 61987141 WinCC Blocks en Copy

Configuring the Picture Management Functions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 32/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• regenerate memorized picture

Page 33: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 33/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

5 General Configuration of Faceplates

This section describes the configuration of faceplates and block icons.

With the aid of faceplates, recurring display and operator functions are configured in a picture. In Runtime, the dynamic picture elements of a faceplate are connected to the process tags of a measuring point.

In Runtime, you can normally open a faceplate by clicking a block icon. Normally, a faceplate is a picture window that can be moved and closed and that does not cover the entire working area.

Separate faceplates are configured for different functions.

Opening a faceplate basically consists of the following steps:

• Loading a faceplate template and making it visible

• Supplying the dynamic picture elements of the faceplate template with process data

Note This section is only of importance if you are not using OS Project Editor. If you are using OS Project Editor, picture management functions (open process picture, open faceplate) are available by default. You can then open a faceplate as described in the FAQ with ID number 24193022.

5.1 Loading a faceplate template and making it visible

5.1.1 BSM_WORK.pdl

The “BSM_WORK.pdl” picture contains several picture windows. Figure 5-1

The picture windows have the object names “TOP01” through “TOP10”.

Page 34: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 34/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

5.1.2 BSM_TopfieldOpen()

The “BSM_TopfieldOpen()” C script is used to

• determine the object name of the next free (not displayed) picture window,

• set the “Picture Name” property of the determined picture window with the name of the block template (WinCC picture) and

• to set the “Display” property of the picture window to “TRUE”

Parameters lpszPictureName (char*) Absolute name of the picture from where the

picture window is to be opened. lpszPictureNameTop (char*)

Name of the picture that is to be displayed in a picture window

lpszPictureNameReturn (char*)

For this parameter, the function returns the absolute, complete name of the opened picture

lpszPictureWindowReturn (char*)

For this parameter, the function returns the absolute name of the opened picture window

lpszTopWindowReturn (char*)

For this parameter, the function returns the name of the opened picture window. E.g., “TOP05”

Return (int) If successful, the function returns the value (int) 0, if not, a value is returned that is not equal to “0“ (error code). Refer to the script in chapter 11, Table 11-2.

5.2 Supplying the dynamic picture elements of the faceplate template with process data

This application uses the tag prefix to connect the dynamic picture elements of a faceplate to the process values.

As a result, the C script for opening the “BSM_TopfieldOpen()” faceplate returns the complete name of the opened picture. With the aid of the “GetLink()” standard function, the name of the WinCC tag is determined that is connected to a property of a graphic object. With this information,

• name of the picture (Top Windows) and

• name of the tag (measuring point name),

the “SetPropChar()” function is called to set the “TagPrefix” property of the corresponding picture window.

Page 35: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 35/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

In addition, the “Caption” property of the picture window is described with the measuring point name and the general name of the faceplate (e.g., MOTOR, VALVE, ANALOG, ...).

The figure below shows a C script that opens a faceplate of the “VALVE” type. Refer to the script in chapter 11, Table 11-3.

5.3 General layout of the WinCC faceplates

The WinCC faceplates have a uniform appearance. Figure 5-2

• Header line The header line displays the measuring point name and the block type.

• Measuring point comment Line with display of the measuring point comment

• Button for closing Each corner of the faceplate features buttons for closing the faceplate.

• Keyset The bottom part of the block icon displays a keyset. The keyset includes buttons for displaying other views of the faceplate. The icons on the buttons in the keyset have the same meaning for all block types:

Table 5-1

No. Description Picture

1. Standard view

2. Message view

3. Trend view

Page 36: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 36/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

No. Description Picture

4. Service view

5. Limits view (currently only for ANALOG)

6. Diagnostics view (currently only for SIMOREV, SIMODIR)

7. Statistics view (currently only for SIMOREV, SIMODIR)

• Working area The working area is located between the comment line (measuring point comment) and the keyset. The working area displays the individual views of a faceplate.

• Standard view When opening a faceplate, the Standard view of a block is displayed. The Standard view displays the essential features of a block. Normally, the block icon is displayed in the top left corner.

5.4 Configuring the faceplates

The pictures of a faceplate Using the example of the “VALVE” faceplate, the figure below shows which WinCC pictures are involved in creating a faceplate. Figure 5-3

The “<TYPICAL>_Main.pdl” picture is the basic picture of a faceplate. It contains the comment line, the keyset, the buttons for closing and the picture window that is used for the display of the actual faceplate views.

Page 37: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 37/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

An individual picture is configured for each view of a faceplate, e.g.

• “<TYPICAL>_STANDARD.pdl” (Standard view)

• “<TYPICAL>_MSG.pdl” (Message view)

• “<TYPICAL>_SERVICE.pdl” (Service view)

• “<TYPICAL>_TREND.pdl” (Trend view)

• “<TYPICAL>_DIAG.pdl” (Diagnostics view)

• “<TYPICAL>_STAT.pdl” (Statistics view)

The graphic elements of a block are configured in the individual views of a block. For dynamization, the types of dynamization “tag direct connection” or the “Dynamic value ranges” dialog box are used if possible. If possible, scripts are not used at all. The figure below shows the dynamization of the display of an error bit with the Dynamic value ranges dialog box. Figure 5-4

This figure illustrates the configuration with the aid of the tag prefix. Complete tag names are not specified for the dynamizations in the faceplate, but only the names of the individual structure elements of a block type. When opening the faceplate, the tag prefix of the faceplate is set via the “BST_<TYPICAL>_TopFieldOpen()” script. Due to this, valid process tags are accessed in Runtime.

Page 38: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 38/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Configuring operator messages This application uses the procedure of FAQ 24325381 to log operations in Runtime in Alarm Logging.

5.5 Configuring the block icons

A block icon is used for the display of the most important characteristics of an object (e.g., analog value, motor, valve, …) in the process picture. Clicking a block icon opens the associated faceplate.

5.5.1 Dynamization with WinCC status displays

In the block icons, mainly WinCC status displays are used for dynamization. The WinCC status display offers the following advantages:

• High performance

• Several object properties (for example, font, font color, background color, flashing, …) can be realized with only one dynamization.

• Status displays can be easily documented and understood.

• Status displays offer a “certain” degree of central changeability Status displays use graphics files (bmp, emf) for the display of the individual statuses. The graphics files are referenced in the status displays. If a display is to be changed in all of the already used block icons, it is sufficient to centrally change a specific part of the graphics file.

Separate status displays are configured for different characteristics (statuses) of a block. Although different blocks differ in their essential function, they also frequently feature functions of the same type that are displayed in the same way:

• Local/Remote operation display “Local” operating mode

• Hand/Automatic operating mode “Hand” operating mode “Automatic” operating mode

• Simulation On/Off display Simulation “On”

• Fault/Warning display General fault General warning

To configure the status displays of a block icon, a separate “BST_<TYPICAL>_ICON_Define.pdl” picture was created in the Graphics Designer for each block type in this sample application.

This picture shows all statuses of the status displays of a block type (configured). In addition, the names of the image files and the status values

Page 39: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 39/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

are indicated. The figure below shows the configuration of the status displays for the “VALVE” block.

Figure 5-5

5.5.2 Centrally changeable block icons by “Faceplate Types”

This application uses a WinCC object of the “Faceplate Type” type for the display of a block icon. Objects of the “Faceplate Type” type are available for WinCC V7.0 and higher. Alternatively, a block icon can also be configured as a “customized object”. The essential advantage of a “Faceplate Type” over a customized object is the central changeability.

An image file of the “FPT” type (extension) exists for each block icon of a block. The file name has this structure: “BST_<TYPICAL>_ICON.FPT”.

The figure below shows the faceplate types that exist in the WinCC project.

Page 40: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 40/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 5-6

Page 41: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 41/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Note A block type (Typical) may have several block icons. For instance, two block icons were created for the “BST_VALVE” block type, one icon for horizontal alignment and another icon for vertical alignment in the process picture. Figure 5-7

Figure 5-8

The two block icons differ only in the arrangement of the individual objects (status displays), the actual function is identical.

You can use the “Properties” dialog box to list all objects of a faceplate type.

Page 42: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 42/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 5-9

The bold objects are dynamized. The following table lists the objects of a block icon.

The figure below shows the configured faceplate tags.

Page 43: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 43/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 5-10

The “QdwState” faceplate tag is connected to the process interface. Since several different statuses (On/Off, Hand/Automatic, Local/Remote, Simulation On/Off, …) are encoded in the “QdwState” tag, it is not suitable for “tag direct connection”.

Note Only the types of dynamization “tag direct connection” and VBScript are possible in a faceplate type.

To keep the number of process tags as small as possible (optimizing the license costs), all binary information of a process object is transferred to WinCC in a 32-bit tag.

When the value of the “QdwState” tag changes, a VBScript is executed. This script copies the associated bits of a status to faceplate tags. The faceplate tags are then used for the dynamization of the graphic objects (e.g., status displays).

The objects with the “DEBUG_” prefix in the object name were used exclusively for error diagnostics while developing the block icon. When these objects are visualized, the value of the internal faceplate tag can be displayed in Runtime. Thus, the principle of operation of VBScript can be

Page 44: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 44/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

checked. The diagnostic outputs by means of “HMIRuntime.Trace” are not available for the faceplate types. Table 5-2

Object Dynamization with faceplate tag

Description

BST_VALVE_ICON This object designates the faceplate type as a whole

DEBUG-wHA (IO field) Only for debugging HA (status display)

wHA (unsigned 32-bit tag) Hand/Automatic status

display DEBUG-wILOCK (IO field)

Only for debugging

ILOCK (status display)

wILOCK (unsigned 32-bit tag)

Locking condition (INTERLOCK) display

DEBUG-wLR (IO field) Only for debugging LR (status display)

wLR (unsigned 32-bit tag) “Local/Remote”

status display DEBUG-wMsg (IO field) Only for debugging MSG (status display)

wMsg (unsigned 32-bit tag) Error/Warning display

DEBUG-wRMT (IO field) Only for debugging RMT (status display)

wHA (unsigned 32-bit tag) “Check-Back Signal

Test” for SIMOCODE DEBUG-wSim (IO field) Only for debugging SIM (status display)

wHA (unsigned 32-bit tag) Simulation On/Off

display DEBUG-wStatus (IO field)

Only for debugging

STATUS (status display)

wHA (unsigned 32-bit tag)

Display of the actual status, e.g. motor “On/Off” valve “Open/Closed”

szTagName (static text) None Field to display the measuring point name; e.g., “TI160”

szTagNameFull (static text)

None Field to display the measuring point comment e.g., “Temperature tank T13”

TRIGGER_QdwState (IO field)

QdwState No display in the picture; the “Output Value” property of this object is connected to the process tag. When the

Page 45: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 45/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Object Dynamization with faceplate tag

Description

value changes, a VBScript is executed to process the information.

Figure 5-11

Page 46: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 46/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

NOTICE When using status displays within a faceplate type, you have to observe the following requirement: Always assign the value “0” to the static value of the “Current Status” property (index), otherwise Runtime may crash. Figure 5-12

Perform this step for all status displays that are connected to a faceplate tag. In this example, these are the following picture objects: Figure 5-13

Page 47: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 47/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

5.5.3 Configuring the TooltipText and the measuring point display

With regard to the tooltip text and the measuring point display, the following requirements exist for the block icons:

• TooltipText The measuring point name is to be displayed as tooltip text in Runtime. This is not to cause additional overhead in the configuration. The tooltip texts are not to be manually configured, this is time-consuming and error-prone.

• Measuring point display For lack of space, there is to be no static display of the measuring point name on the block icon. If required, the measuring point name is to be shown for all block icons. For example, it is then possible to generate a hardcopy of the process picture in which all configured measuring points are labeled. This function enables persons with little background knowledge of the actual procedure to quickly find specific measuring points in the process pictures! When the measuring point names are no longer required, they can be set invisible. Figure 5-14

• Configuration

After opening a process picture, a C script that initializes the “Tooltip Text” properties and the “szTagname” measuring point name is executed for all block icons.

Page 48: 61987141 WinCC Blocks en Copy

General Configuration of Faceplates

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 48/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 5-15

The script uses the “GetLink()” function to determine the current measuring point name of a block icon, edits the text and writes the “TooltipText” and “szTagName” properties with the “SetPropChar()” function. Refer to the script in chapter 11, table 11-4.

Page 49: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 49/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6 Configuring technological Subfunctions

6.1 Overview of the data exchange between controller and WinCC

This section provides information on the data exchange between controller and WinCC. It focuses on the exchange of binary signals. The signals can be distinguished regarding the signal flow. There are status signals, control signals and telegrams. Figure 6-1

Status signals The technological blocks (FBs) of this application use the “QdwState” output (DWORD) to combine different binary states in one tag (e.g., “Valve OPEN”, “Valve CLOSED”, “Valve Runtime Monitoring” feedback) and to transfer the information to WinCC. With the aid of the “QdwState” tag, 32 binary signals (DWORD) can be transferred. The “QdwState” tag is used for dynamizing the process pictures.

Telegrams for messages The blocks use the ALARM_8P block (SFB35, “A8P”), to signal faults, alarms or errors in WinCC Alarm Logging. These messages requiring acknowledgement can be displayed and acknowledged in Runtime in WinCC Alarm Control.

Page 50: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 50/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Internally, the blocks use the NOTIFY_8P block (“N8P”) to report operational messages (e.g., “Valve OPEN” feedback) in WinCC Alarm Logging. These messages that do not require acknowledgement can be displayed in Runtime in WinCC Alarm Control.

Control signals The blocks use the “OP_dwCmd” input/output signal (DWORD) to transfer binary control commands from WinCC Runtime (switching commands of the operator) to the control program (for example, “Open Valve”, “Close Valve”, “Simulation On/Off” commands). Up to 32 commands can be combined in the “OP_dwCmd” tag.

6.1.1 Displaying process statuses in the WinCC process picture

The technological blocks (FBs) of this application use the “QdwState” output (DWORD) to display different binary states (e.g., “Valve OPEN”) in the WinCC process picture. Figure 6-2

The bit assignment of the “QdwState” tag for different block types has been selected so that signals of the same type have the same bit position.

Figure 6-3

Examples:

• The signals for feedback of “Hand/Automatic” mode are stored in bits 16 and 17.

Page 51: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 51/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• The signals for feedback of a group warning, a group alarm or a group error are always stored in successive bits, for instance bit 13, 14 and 15.

• The signal for feedback of the “Simulation ON” status is stored in bit 18.

The figure below shows the interconnection of the binary signals with the individual bits of the “QdwState” tag. Figure 6-4

Note In the FB, additional tags (“QabStatePLC”, “QabyState”) are used for byte by byte or bit by bit access to the “QdwState” double word variable and the “AT” SCL statement is used for the declaration.

Page 52: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 52/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-5

The different status signals are additionally brought out as an output signal of the “BOOL” data type. They are available for further processing in the S7 program as a binary signal (BOOL).

6.1.2 Logging messages in WinCC Alarm Logging

The blocks use the chronological order message procedure to save messages in WinCC Alarm Logging. The messages can be displayed and acknowledged in Runtime in WinCC Alarm Control. Figure 6-6

“ALARM_8P” block for messages requiring acknowledgement The blocks call the “ALARM_8P” block (SFB 35) to generate messages requiring acknowledgement. For this purpose, the signal inputs of the “ALARM_8P” block are interconnected with the different status signals in the S7 program.

Page 53: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 53/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-7

“NOTIFY_8P” block for messages that do not require acknowledgement The blocks call the “NOTIFY_8P” block (SFB 31) to generate messages that do not require acknowledgement. For this purpose, the signal inputs of the NOTIFY_8P block are interconnected with the different status signals in the STEP 7 program.

Page 54: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 54/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-8

Note Compared to the bit message procedure, the use of the STEP 7 “ALARM_8P” and “NOTIFY_8P” message blocks considerably reduces the overhead for the WinCC message configuration. The messages are created in WinCC Alarm Logging during OS compilation. If S7 message blocks are not to be used or cannot be used, you can comment out the calls of the S7 message blocks instead and use the conventional bit message procedure. The “.QdwState“ tag can be used as a message tag for the bit message procedure.

6.1.3 Triggering switching commands in the WinCC process picture

The WinCC “OP_dwCmd” control tag of a block is used to transfer commands from WinCC to the controller.

Page 55: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 55/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-9

The different control commands of a block type are centrally managed in WinCC Global Script in the “bst.h” header file. Figure 6-10

Figure 6-11

Page 56: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 56/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

When the operator uses a button of a block in WinCC Runtime, a WinCC “BST_xxx_CMD()” C script is executed.

The “xxx” string is a wildcard for the name of the block type, e.g. “BST_VALVE_CMD()”.

The corresponding code is transferred to the script as a parameter. Figure 6-12

The following actions are performed in the script:

• The name of the current block instance is determined and the name of the “xxx.OP_dwCMD” control tag (DWORD) is put together for the current block instance.

• Control commands that have already been set for this block instance are reset.

• The current control command is shown in the control tag.

• The operation is logged in WinCC Alarm Logging. To do this, the “BST_XXX_OperationlogButton()” project function is called.

Page 57: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 57/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-13

6.1.4 Processing switching commands in the controller

The block in the controller evaluates the control command, performs the desired action if necessary and subsequently resets all pending control commands. For this purpose, the value of the control tag is set to “0”.

Page 58: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 58/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-14

6.2 HAND/AUTO changeover

Many blocks feature a HAND/AUTO changeover. The HAND/AUTO changeover enables the user to operate a block in either “Hand” or “Automatic” mode. In “Hand” mode, the control commands of the operator (WinCC station) are active. In “Automatic” mode, the control signals of an automatic function (for example, control, step sequence, …) are effective.

6.2.1 Status signals

Figure 6-15

• “QMAN_AUT”

The mode is displayed at the “QMAN_AUT” block output. “QMAN_AUT” = 0 Hand “QMAN_AUT” = 1 Automatic Note: By default, the “QMAN_AUT” signal does not have the “S7_m_c=true” attribute and is thus not transferred to WinCC during OS compilation.

• “QdwState” The current mode is transferred to WinCC in the “QdwState” status word in the two separate bits 16 and 17.

Page 59: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 59/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

“QdwState Bit 16” = 1 Hand “QdwState Bit 17” = 1 Automatic When both bits or none of the two bits are set, an error has occurred. The “QdwState” tag has the “S7_m_c=true” attribute, it is thus created in WinCC during OS compilation and can be used for visualization.

6.2.2 Control signals

For a changeover of “Hand/Automatic” mode, the following signals are used: Figure 6-16

• “LIOP_SEL”

When the “LIOP_SEL” input is set, the mode is defined by the “AUT_L” control input. When the “LIOP_SEL” input is not set, the mode is defined by the operator (“OP_dwCmd” bit 16, 17). “AUT_L” The “AUT_L” input is effective only when the “LIOP_SEL” input is set. When the “AUT_L” and “LIOP_SEL” inputs are set, the mode is set to “Automatic”. When the “AUT_L” input is not set and “LIOP_SEL” is set, the mode is set to “Hand”.

• “OP_dwCmd” (bit 16, 17) The operator commands in the “OP_dwCmd” control word are active only when the “LIOP_SEL” input is not set. When bit 16 of the control word is set, the mode is set to “Hand”. When bit 17 of the control word is set, the mode is set to “Automatic”.

The figure below shows the logic (SCL code) for changeover of the “Hand/Automatic” mode of a block.

Page 60: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 60/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-17

6.2.3 Display in the process picture

In the process picture, “Hand/Automatic” mode is displayed within a faceplate type.

Note Objects of the “Faceplate Type” type are available for WinCC V7.0 and higher. Objects of the “Customized Object” type can be used for WinCC versions earlier than WinCC V7.0.

The “QdwState” status word is used for visualizing “Hand/Automatic” mode. Status display in conjunction with tag direct connection is used for the dynamization. For each block type, a separate WinCC picture was created in which the icons of the status displays are created, for example “BST_VALVE_ICON_Define.pdl”. The icons of the status display for the display of “Hand/Automatic” mode have also been created in this picture.

Page 61: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 61/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-18

This was done:

• The graphical icons for the different statuses (Hand, Automatic and “Illegal”) were created,

• the names of the image files (for basic picture and flash picture) were displayed in static text fields and

• the status value was assigned to the individual statuses.

Notes on the pictures:

• The basic picture and the flash picture differ for the “HA=0” or “HA=3” status. The background is identical, the font changes.

• The basic picture and the flash picture are identical for the “HA=1” and “HA=2” status. The display does not flash.

Note on the generation of the image files for the status display: The “Save as Metafile” function of the Graphics Designer is used to generate the individual image files for a status display. Proceed as described below to generate the image files for a status display:

• In the Graphics Designer, double-click the static text with the file name, e.g. “BST_VALVE_HA_ILLEGAL.emf”. The text field receives the focus and the text is selected for input. Copy the selected text to the Windows clipboard (using the “CTRL+C” key combination).

• In the Graphics Designer, select the picture objects that are to be included in the image file. (Single or multiple selection possible)

• Select the “File > Export” menu command. The “Save as Metafile” (*.emf) dialog box opens.

• In the “File name” input field, enter the name of the image file. Paste the contents of the clipboard into the input field (using the “CTRL+V” key combination).

• Close the dialog box with the “Save” button.

Page 62: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 62/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

The figure below shows the associated configuration dialog box. Figure 6-19

Note The status display (object name: “HA”) for the display of “Hand/Automatic” mode is superimposed by the status display (object name: “LR”). To open the configuration dialog box of the “HA” status display, the “LR” status display can be placed at another level and this level can be made invisible.

Page 63: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 63/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

The “Current Status” property (index) of the status display is directly dynamized with the “wHA” faceplate tag. The faceplate tag is supplied with values by a VBScript. Figure 6-20

The script is executed when the “QdwState” status tag changes. The bits to display “Hand/Automatic” mode are selected in the script, moved to the right by 15 bits and the result is written to the “wHA” faceplate tag.

6.2.4 Display in the faceplate

Within a faceplate, the “QdwState” tag and the “Dynamic value ranges” dialog box are used to dynamize the background color of the buttons.

Page 64: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 64/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-21

6.2.5 Operating in the faceplate

When the operator selects the “HAND” or “AUTO” button in WinCC Runtime, the “BST_xxx_CMD()” C script is executed. The “xxx” string is a wildcard for the name of the block type, e.g. “BST_VALVE_CMD()”. Due to this, the “OP_dwCmd” control tag is set and evaluated by the controller. The controller performs the “HAND/AUTO” changeover and subsequently resets the control tag.

6.3 Local/Remote changeover

The Local/Remote changeover enables the user to operate a block in either “Local” or “Remote” mode. In “Local” mode, the control commands of the operator are active directly on the device. In “Remote” mode, the control signals of an automatic function (for example, control, step sequence, …) or the control signals of the operation of WinCC Runtime are effective.

Page 65: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 65/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6.3.1 Status signals

Figure 6-22

• “QREMOTE”

The mode is displayed at the “QREMOTE” block output. “QMAN_AUT” = 0 Local “QMAN_AUT” = 1 Remote

Note By default, the “QREMOTE” signal does not have the “S7_m_c=true” attribute, it is thus not transferred to WinCC during OS compilation.

• “QdwState”

The current “Local/Remote” mode is indicated in the status word by bit 4. “QdwState Bit 4” = 0 Local “QdwState Bit 4” = 1 Remote The status word is created in WinCC during OS compilation and can be used for the visualization. The bit assignment of the status word may differ. For instance, “Local/Remote” mode for the “SIMOREV” and “SIMODIR” blocks is displayed by bit 6.

6.3.2 Control signals

For a changeover of “Local/Remote” mode, the following signals are used:

Page 66: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 66/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-23

• “LIOP_SEL”

When the “LIOP_SEL” input is set, the mode is defined by the “REMOTE_L” control input. When the “LIOP_SEL” input is not set, the mode is defined by the operator (“OP_dwCmd” bit 4 and bit 5).

• “REMOTE_L” The “REMOTE_L” input is effective only when the “LIOP_SEL” input is set. When the “REMOTE_L” and “LIOP_SEL” inputs are set, the mode is set to “Remote”. When the “REMOTE_L” input is not set and “LIOP_SEL” is set, the mode is set to “Local”.

• “OP_dwCmd” (bit 4, 5) The operator commands of the “OP_dwCmd” control word are active only when the “LIOP_SEL” input is not set. When bit 4 of the control word is set, the mode is set to “Local”. When bit 5 of the control word is set, the mode is set to “Remote”. The bit assignment of the control commands may differ for specific blocks. The SIMOCODE blocks (“SIMOREV”, “SIMODIR”) use bits 5 and 6 for the “Local/Remote” changeover.

The figure below shows the logic (SCL code) for changeover of the “Local/Remote” mode of a block.

Page 67: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 67/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-24

6.3.3 Display in the process picture

In the process picture, “Local/Remote” mode is displayed within a faceplate type.

Note Objects of the “Faceplate Type” type are available for WinCC V7.0 and higher. Objects of the “Customized Object” type can be used for WinCC versions earlier than WinCC V7.0.

The “QdwState” status word is used for visualizing “Local/Remote” mode. Status display in conjunction with tag direct connection is used for the dynamization. For each block type, a separate WinCC picture was created in which the icons for the status displays are created, for example “BST_VALVE_ICON_Define.pdl”. The icons of the status display for the display of “Local/Remote” mode have also been created in this picture. Figure 6-25

This was done:

• The graphical icons for the different statuses (“Local”, “Remote”) were created,

Page 68: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 68/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• the names of the image files (basic picture and flash picture) were displayed in static text fields and

• the status value was assigned to the individual statuses.

Notes • Section 6.2.3 provides an option for generating the image files of the status display.

• In “LR=0” status, the pictures for the basic and flash picture are transparent. The display is not visible in Runtime.

• In “LR=1” status, the pictures for the basic and flash picture are identical. A black “L” is displayed on a white background.

The figure below shows the associated configuration dialog box.

Page 69: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 69/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 7-26

Note The status display (object name: “LR”) for the display of “Local/Remote” mode superimposes the status display (object name: “HA”) for the display of “Hand/Automatic” mode. The “HA” status display is only visible in “Remote” status since the “LR” display is then transparent (invisible).

The “Current Status” property (index) of the status display is directly dynamized with the “wLR” faceplate tag. The faceplate tag is supplied with values by a VBScript.

Page 70: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 70/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

The script is executed when the “QdwState” status tag changes. The bits to display “Local/Remote” mode are selected in the script, moved to the right by 3 bits and the result is written to the “wLR” faceplate tag. Figure 6-26

6.3.4 Display in the faceplate

Within a faceplate, the “QdwState” tag and the “Dynamic value ranges” dialog box are used to dynamize the background color of the buttons.

Page 71: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 71/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-27

6.3.5 Operating in the faceplate

When the operator selects the “Local” or “Remote” button in WinCC Runtime, the “BST_xxx_CMD()” C script is executed. The “xxx” string is a wildcard for the name of the block type, e.g. “BST_VALVE_CMD()”. Due to this, the “OP_dwCmd” control tag is set and evaluated by the controller. The controller performs the “Local/Remote” changeover and subsequently resets the control tag.

6.4 General status changeover (e.g., On/Off, Open/Closed)

This section describes how the changeover of the general status (for example, “Motor On/Off”, Valve “Open/Closed”) is realized for block types. The changeover in the blocks is realized in the same way, irrespective of whether the motor is switched “On/Off” or a valve is set to “Open/Closed”. The principle is described by means of the “BST_VALVE” block.

The changeover is influenced by other functions, e.g. “HAND/AUTO” changeover, “Local/Remote” changeover and “Simulation”.

Page 72: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 72/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6.4.1 Status signals

Figure 6-28

• “QwState (WORD)” The current status is displayed as a numerical value at the “QwState” output. “QwState” = 0 Close (Stop) “QwState” = 1 Opening (Starting) “QwState” = 2 Open (Run) “QwState” = 3 Closing (Stopping) This signal is used internally for calculating the state transitions.

Note By default, the “QwState” signal does not have the “S7_m_c=true” attribute, it is thus not transferred to WinCC during OS compilation.

• “QCLOSE (BOOL)”

When the “QCLOSE” output is set, the block status is “Close” (QwState=0)

• “QOPENING (BOOL)” When the “QOPENING” output is set, the block status is “Opening” (QwState=1)

• “QOPEN (BOOL)” When the “QOPEN” output is set, the block status is “Open” (QwState=2)

• “QCLOSING (BOOL)” When the “QCLOSING” output is set, the block status is “Closing” (QwState=3)

Page 73: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 73/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Note • The “QwState”, “QCLOSE”, “QOPENING”, “QOPEN”, “QCLOSING” outputs do not have the “S7_m_c=true” attribute. For this reason, they are not created in WinCC during OS compilation and cannot be used for the visualization.

• Exactly one of the “QCLOSE”, “QOPENING”, “QOPEN” or “QCLOSING” signals is always set at a given time.

• QdwState (DWORD)

The current “Close/Opening/Open/Closing” status is displayed in the status double word by bits 0 through 3. “QdwState Bit 0” = 1 Close “QdwState Bit 1” = 1 Opening “QdwState Bit 2” = 1 Open “QdwState Bit 3” = 1 Closing

Note The status double word is created in WinCC during OS compilation (S7_m_c=true attribute) and can be used for the visualization.

6.4.2 Control signals

The following signals are used as direct control signals for the changeover of the “Close/Opening/Open/Closing” status: Figure 6-29

• “AUTO_OPEN” (BOOL) The “AUTO_OPEN” input is used for automatic control of the block. The input can be interconnected with other blocks.

Page 74: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 74/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• “OP_dwCmd” bit 0, 1, 2 (DWORD)

• Bits 0 and 1 in the “OP_dwCmd” control word are used for the operation in WinCC Runtime. (The “BST_SIMOREV” block additionally uses bit 2.)

In addition, the following signals are used for the changeover of the status:

• “QwState” (WORD)

• “QMAN_AUT” (BOOL)

• “QREMOTE” (BOOL)

• “QSIM” (BOOL)

• “QLOCK” (BOOL)

• “LOCK” (BOOL)

• “FBOPEN” (BOOL)

• “QERR” (BOOL)

The figure below shows possible statuses of a valve (BST_VALVE block).

Page 75: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 75/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-30

The SCL code of the transition conditions is shown below.

Note The “AUTO_OPEN” automatic command is active only when a positive edge is detected.

NOTICE The transitions are processed in the order that is shown here. The last transition condition that is processed is the condition for the change to the “Close” (Stop) status. This order ensures that the “Close” (Stop) status always follows in the event of an error.

Page 76: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 76/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6.4.3 Display in the process picture

In the process picture, the “Opening/Open/Closing/Close” status is displayed within a faceplate type.

Note Objects of the “Faceplate Type” type are available for WinCC V7.0 and higher. Objects of the “Customized Object” type can be used for WinCC versions earlier than WinCC V7.0.

The “QdwState” status word is used for visualizing the mode. Status display is used in conjunction with “tag variable connection”. For each block type, a separate WinCC picture was created in which the icons for the status displays are created, for example “BST_VALVE_ICON_Define.pdl”. The icons of the status display for the display of the “Opening/Open/Closing/Close” status have also been created in this picture. Figure 6-31

This was done:

• The graphical icons for the different statuses (Hand, Automatic and “Illegal”) were created,

• the names of the image files for the basic and flash pictures were displayed in static text fields and

• the status value was assigned to the individual statuses.

Page 77: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 77/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Note Section 7.2.3 provides an option for generating the image files of the status display.

The pictures for the basic and flash pictures are identical for a status, however, they were still saved twice.

In “LR=1” status, the pictures for the basic and flash picture are identical. A black “L” is displayed on a white background.

In this picture, the graphics files have been created for both a “vertical” and a “horizontal” valve.

The figure below shows the associated configuration dialog box for a “horizontal” valve. Figure 6-32

Page 78: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 78/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

The “Current Status” property (index) of the status display is directly dynamized with the “wStatus” faceplate tag. The faceplate tag is supplied with values by a VBScript. Figure 6-33

The script is executed when the “QdwState” status tag changes. The bits to display “Hand/Automatic” mode are selected in the script, moved to the right by 15 bits and the result is written to the “wStatus” faceplate tag.

6.4.4 Display in the faceplate

Within a faceplate, the “QdwState” tag and the “Dynamic value ranges” dialog box are used to dynamize the background color of the “OPEN” and “CLOSE” buttons.

Page 79: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 79/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-34

6.4.5 Operating in the faceplate

When the operator selects the “CLOSE” or “OPEN” button in WinCC Runtime, the “BST_xxx_CMD()” C script is executed. The “xxx” string is a wildcard for the name of the block type, e.g. “BST_VALVE_CMD()”. Due to this, the “OP_dwCmd” control tag is set and evaluated by the controller. The controller performs the “OPEN/CLOSE” changeover when all conditions for a changeover are met and subsequently resets the control tag.

6.5 Enabling/disabling simulation

“Simulation ON” mode enables the user to simulate feedbacks (e.g., valve “OPEN” feedback and “CLOSE” feedback). This function is important, for example, if automatic functions are to be tested already during the configuration phase, but if a process interface does not yet exist. Without simulating the feedbacks, many automatic functions (e.g., step sequences)

Page 80: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 80/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

cannot be successfully executed since the feedbacks are frequently requested in step enabling conditions in step sequences or cause errors.

6.5.1 Status signals

Figure 6-35

• “QSIM”

“Simulation” mode is displayed at the “QSIM” block output. “QSIM” = 0 Simulation OFF “QSIM” = 1 Simulation ON

Note By default, the “QSIM” signal does not have the “S7_m_c=true” attribute, it is thus not transferred to WinCC during OS compilation.

• “QdwState”

The current “Simulation” mode is indicated in the status word by bit 18. “QdwState Bit 18” = 0 Simulation OFF “QdwState Bit 18” = 1 Simulation ON The status word is created in WinCC during OS compilation and can be used for the visualization.

Page 81: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 81/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6.5.2 Control signals

The following signals are used to enable or disable the simulation: Figure 6-36

• “LIOP_SEL”

When the “LIOP_SEL” input is set, the simulation is disabled or enabled by the “SIM_L” control input. When the “LIOP_SEL” input is not set, the simulation is disabled or enabled by the operator (“OP_dwCmd” bit 20 and 21). “SIM_L” The “SIM_L” input is effective only when the “LIOP_SEL” input is set. When the “SIM_L” and “LIOP_SEL” inputs are set, the simulation is enabled. When the “SIM_L” input is not set and “LIOP_SEL” is set, the simulation is disabled.

• “OP_dwCmd” (bit 20, 21) The operator commands of the “OP_dwCmd” control word are active only when the “LIOP_SEL” input is not set. When bit 20 of the control word is set, the simulation is disabled. When bit 21 of the control word is set, the simulation is enabled.

The figure below shows the logic (SCL code) for enabling/disabling the simulation.

Page 82: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 82/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-37

6.5.3 Display in the process picture

In the process picture, the simulation is displayed within a faceplate type.

The “QdwState” status word is used for visualizing the simulation. Status display in conjunction with tag direct connection is used for the dynamization. The “BST_xxx_ICON_Define.pdl” WinCC picture shows the icons for the status displays for each block type. The icons for the display of the simulation are defined as follows. Figure 6-38

This was done:

• The graphical icons for the different statuses (“Simulation ON”, “Simulation OFF”) were created,

• the names of the image files (basic picture and flash picture) were displayed in static text fields and

• the status value was assigned to the individual statuses.

Note The “Save as Metafile” function of the Graphics Designer is used to generate the individual image files for a status display. To generate the image files for the status display, proceed as described in the “HAND/AUTO changeover” section.

The figure below shows the associated configuration dialog box.

Page 83: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 83/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-39

Page 84: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 84/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Note The status display (object name: “SIM”) for the display of the simulation superimposes the status display (object name: “MSG”) for the display of the messages (warnings, alarms, faults, errors). The “MSG” status display is only visible in “Simulation OFF” status since the “SIM” display is then transparent (invisible).

The “Current Status” property (index) of the status display is directly dynamized with the “wSim” faceplate tag. The faceplate tag is supplied with values by a VBScript.

The script is executed when the “QdwState” status tag changes. The bit to display the simulation is selected in the script, moved to the right to bit position 0 and the result is written to the “wSim” faceplate tag.

Figure 6-40

Page 85: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 85/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6.5.4 Display in the faceplate

Within a faceplate, the “QdwState” tag and the “Dynamic value ranges” dialog box are used to dynamize the status display for the display of the simulation. Figure 6-41

6.5.5 Operating in the faceplate

The “Standard” view of a faceplate only displays whether the simulation is enabled or disabled. In the “Service” view, the simulation can be enabled or disabled.

Page 86: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 86/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-42

When the operator selects the simulation “ON” or “OFF” button in WinCC Runtime, the “BST_xxx_CMD()” C script is executed. The “xxx” string is a wildcard for the name of the block type, e.g. “BST_VALVE_CMD()”. Due to this, the “OP_dwCmd” control tag (bit 20, 21) is set and evaluated by the controller. The controller enables or disables the simulation and subsequently resets the control tag.

6.6 Displaying and resetting INTERLOCK

Blocks that influence the process as actuators (for example, valves, pumps, controlling means) normally have signals for interlocking (INTERLOCK).

If the locking condition is active at a block, the actual function of the block (e.g., open valve, switch on motor) cannot be executed.

If the actual block function is already active (for example, valve open, motor on) and if the locking condition is then activated, the actual block function is deactivated (for instance, valve closed, motor switched off).

Critical plant statuses can be avoided with this function.

Example: The valve and the pump for filling a tank are to be interlocked when the overflow protection is not ready or provides the “Tank Full” signal.

Page 87: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 87/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6.6.1 Signals

Figure 6-43

• “LOCK” (BOOL, input)

The “LOCK” input signal contains the locking condition.

LOCK=0 interlock not present

When the interlock is not present, the actual block function (e.g., open valve, switch on motor) can be executed.

LOCK=1 interlock present

When the interlock is present, the actual block function (e.g., open valve, switch on motor) cannot be executed.

• “QLOCK” (BOOL, output)

QLOCK=1 error interlock active

The “QLOCK” output signal is set to “1” when the locking condition is received during regular operation, i.e. during the actual block function, for example valve open or motor ON.

QLOCK=0 error interlock not active

The “QLOCK” output signal is reset to “0” when the error is acknowledged (reset). Reset can be performed by the operator in

Page 88: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 88/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

WinCC Runtime (“RESET” button, “OP_dwCmd” control word) or by an automatic function (“L_RESET” control input).

Note By default, the “QLOCK” signal does not have the “S7_m_c=true” attribute, it is thus not transferred to WinCC during OS compilation.

• “QdwState”

The “Locking condition active” (LOCK=1) and “Error interlock” (QLOCK=1) statuses are displayed in the status word by bits 19 and 20.

“QdwState” bit 19 = 1 LOCK=1 (Locking condition active)

“QdwState” bit 20 = 1 QLOCK=1 (Error interlock active)

The status word is created in WinCC during OS compilation and can be used for the visualization.

• “L_RESET” The “QLOCK” output is reset at a positive edge at the “L_RESET” input.

• “OP_dwCmd” (bit 7) By using the “RESET” button in the faceplate of the block type, bit 7 is set in the “OP_dwCmd” control word. The controller evaluates this bit and resets the “QLOCK” output.

6.6.2 Display in the process picture

In the process picture, the interlock is displayed within a faceplate type.

The “QdwState” status word is used for visualizing the interlock. Status display in conjunction with tag direct connection is used for the dynamization. The “BST_xxx_ICON_Define.pdl” WinCC picture shows the icons for the status displays for each block type. The icons for the display of the interlock are defined as follows.

Page 89: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 89/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-44

This was done:

• The graphical icons for the different statuses of the interlock were created,

• the names of the image files (basic picture and flash picture) were displayed in static text fields and

• the status value was assigned to the individual statuses.

Note Section 7.2.3 provides an option for generating the image files of the status display.

The pictures for the basic picture and the flash picture of a status are identical, however, they were still saved twice.

In “ILOCK=0” status, the display is not visible, no interlock is present.

In “ILOCK=1” status, a black “L” is displayed on a yellow background. An interlock at the block input is pending.

In “ILOCK=2” status, a white “L” is displayed on a red background. The interlock at the block input is no longer present, but the interlock at the block output has not yet been acknowledged.

In “ILOCK=3” status, a white “L” is displayed on a red background. Both an interlock at the block input and a non-acknowledged interlock at the block output are present.

The figure below shows the associated configuration dialog box.

Page 90: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 90/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-45

Note The status display (object name: “SIM”) for the display of the simulation superimposes the status display (object name: “MSG”) for the display of the messages (warnings, alarms, faults, errors). The “MSG” status display is only visible in “Simulation OFF” status since the “SIM” display is then transparent (invisible).

The “Current Status” property (index) of the status display is directly dynamized with the “wILOCK” faceplate tag. The faceplate tag is supplied with values by a VBScript.

The script is executed when the “QdwState” status tag changes. The bits to display the interlock are selected in the script, moved to the right to bit position 0 and the result is written to the “wILOCK” faceplate tag.

Page 91: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 91/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-46

6.6.3 Display in the faceplate

Within a faceplate, the locking condition is displayed with the aid of the block icon of the “BST_ILOCK” block. The block icon is realized as a faceplate type and the “QdwState” property is interconnected with the “QdwState” tag of the associated “BST_ILOCK” block.

Note Please note the name of the tag for the tag direct connection. The “_IL” string is located before the “.” separator. Thus, the associated interlock block must be in the same chart and have the same block name, followed by the “_IL” string.

Page 92: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 92/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-47

6.6.4 Operating in the faceplate

• “RESET” button When the operator uses the “RESET” button in WinCC Runtime, the “BST_xxx_CMD()” C script is executed. The “xxx” string is a wildcard for the name of the block type, e.g. “BST_VALVE_CMD()”. This sets the “OP_dwCmd” control tag (bit 7). The controller evaluates this bit, resets the “QLOCK” output and subsequently resets the control tag.

• “INTERLOCK” button When the operator selects the “INTERLOCK” button, the block for the display of the associated “BST_ILOCK” interlock opens.

6.7 Displaying and resetting messages, group messages

The messages of a block can generally be subdivided into warnings, alarms and faults.

Page 93: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 93/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Warnings, alarms and faults are displayed by a common status display in the block icon of a block type in the process picture.

If a block contains messages requiring acknowledgement, the group message remains pending until the cause of the message has gone and the message has been reset in the faceplate with the separate “RESET” button.

6.7.1 Status signals

Figure 6-48

• “QWARN” (BOOL, output) “QWARN=0” no warning pending “QWARN=1” at least one warning pending

• “QALARM” (BOOL, output) “QALARM=0” no alarm pending “QALARM=1” at least one alarm pending

• “QERR” (BOOL, output) “QERR=0” no fault pending “QERR=1” at least one fault pending

The logic for setting and resetting the three “QWARN”, “QALARM” and “QERR” signals depends on the respective block type. Depending on the block type, different signals of a block are combined in one of the “QWARN”, “QALARM” and “QERR” signals (“OR” operation).

Page 94: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 94/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

It is not mandatory that a block include all three “QWARN”, “QALARM” and “QERR” signals.

By default, the “QWARN”, “QALARM” and “QERR” signals do not have the “S7_m_c=true” attribute, they are thus not transferred to WinCC during OS compilation.

• “QdwState” (DWORD, output)

The “QWARN”, “QALARM” and “QERR” signals are shown in the “QdwState” status word in the successive bits 13, 14 and 15.

“QdwState” bit 13 = 1 at least one warning pending

“QdwState” bit 14 = 1 at least one alarm pending

“QdwState” bit 15 = 1 at least one fault pending

The “QdwState” status word has the “S7_m_c=true” attribute, it is thus created in WinCC during OS compilation and used for the display in the process picture.

Example: “BST_ANALOG” block: The “BST_ANALOG” block uses all three “QWARN”, “QALARM” and “QERR” signals. The block is used to prepare and display an analog value. The “BST_ANALOG” block enables the user to monitor an analog value for limit violation or limit value underflow.

A limit violation can trigger a warning, an alarm or none of the two.

Using the example of the “BST_ANALOG” block type, the figure below shows the generation of the “QERR” signal. A “QERR” group error has occurred for a 4...20 mA analog signal when, for example, one of the following errors has occurred:

• External error

• Wire break

• Short circuit

• Overrun (current > 22.81 mA)

• Underrun (current < 3.6015 mA)

Page 95: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 95/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-49

Page 96: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 96/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

6.7.2 Control signals

Figure 6-50

• “L_RESET” (BOOL, input)

Error signals requiring reset, for instance “QLOCK”, are reset at a positive edge at the “L_RESET” input.

• “OP_dwCmd” (bit 7) By using the “RESET” button in the faceplate of the block type, bit 7 is set in the “OP_dwCmd” control word. The controller evaluates this bit and resets error signals requiring reset, e.g. “QLOCK”.

6.7.3 Display in the process picture

In the process picture, the group messages are displayed within a faceplate type.

The “QdwState” status word is used to display the group display. Status display in conjunction with tag direct connection is used for the dynamization. The “BST_xxx_ICON_Define.pdl” WinCC picture shows the icons for the status displays for each block type. The icons for the display of the group message are defined as follows.

Page 97: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 97/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-51

This was done:

• The graphical icons for the different statuses of the interlock were created,

• the names of the image files (basic picture and flash picture) were displayed in static text fields and

• the status value was assigned to the individual statuses.

Note Section 7.2.3 provides an option for generating the image files of the status display.

The pictures for the basic picture and the flash picture of a status are identical, however, they were still saved twice.

The figure below shows the associated configuration dialog box.

Page 98: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 98/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure6-52

Note The status display (object name: “MSG”) for the display of the group messages (warnings, alarms, faults) is superimposed by the status display (object name: “SIM”) for the display of the simulation. The “MSG” status display is only visible in “Simulation OFF” status since the “SIM” display is then transparent (invisible).

The “Current Status” property (index) of the status display is directly dynamized with the “wMsg” faceplate tag. The faceplate tag is supplied with values by a VBScript (see script in section “”).

The script is executed when the “QdwState” status tag changes. The bits to display the interlock are selected in the script, moved to the right to bit position 0 and the result is written to the “wMsg” faceplate tag.

Page 99: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 99/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-53

6.7.4 Display in the faceplate

The “Standard” view of a faceplate normally also displays the associated block icon and the block icon also includes the status display for the display of the group messages. Depending on the block type, the associated detailed messages are displayed in a view of a block.

Example The “Standard” view of the “BST_VALVE” block displays the group fault in the block icon. In addition, the two faults causing the group message are displayed separately.

Page 100: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 100/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-54

6.7.5 Operating in the faceplate

“RESET” button When the operator uses the “RESET” button in WinCC Runtime, the “BST_xxx_CMD()” C script is executed. The “xxx” string is a wildcard for the name of the block type, e.g. “BST_VALVE_CMD()”. This sets the “OP_dwCmd” control tag (bit 7). The controller evaluates this bit, resets the error outputs and then the control tag.

6.8 Setting/resetting parameters (bit toggle)

6.8.1 Restrictions of the “check box” standard Windows control

By default, WinCC provides the “Windows Objects > Check Box” control to display a bit of a tag (BYTE, WORD, DWORD) and to toggle by clicking if necessary.

Example The standard Windows check box is used, for example, in the faceplate of the “BST_ANALOG” block. In the “LIMITS” view, the different switching points of an analog value can be enabled or disabled.

Page 101: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 101/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-55

In many cases , the layout and the behavior of this standard Windows check box do not meet the requirements for WinCC operation:

• Bits are continuously selected, starting from bit 0 The check box does not enable the user to display, set and reset any bits of a tag. Operator control and monitoring is always possible for the bits following bit “0”. The number of bits is defined by the “Geometry > Number of Boxes” property. For example, it is not possible to configure a check box that includes only one selection field and that accesses bit 2 of a tag. The first selection field always accesses bit 0 of a tag.

• Sensitive area too large

• The sensitive area of the check box is considerably larger than the visible elements of the check box.

• Size cannot be changed For many applications, the check box is too small for plant operation.

• Color cannot be changed The color of the checkmark for “selected” cannot be preset.

• Tooltip text is not displayed

For these reasons, the standard Windows check box was not used in the “BST_ILOCK” faceplate for enabling and disabling interlocks.

Page 102: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 102/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-56

6.8.2 Creating a project-specific “check box”

For this purpose, the check box was recreated as a faceplate type with WinCC graphic objects (polyline, status displays, static text).

The check box is configured in the “BST_CHECKBOX_ICON.fpt” faceplate type.

The check box (faceplate type) contains the following graphic objects that are partly superimposed:

Page 103: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 103/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-57

• BORDER_LR (polyline)

Lower right border of the check box, dark gray

• BORDER_UL (polyline) Upper left border of the check box, white

• ENABLE (status display) Rectangular status display in the background to display the operator enable

• STATE (status display) Status display in the foreground to display the checkmark

• dwBitMask (hexadecimal IO field) Input field for specifying a bit mask; the bit mask is used to specify the bit to be controlled.

• szControlTag (static text) Text field for specifying the tag name for the tag to be modified

The following figure shows the WinCC picture with which the image files for the two “STATE” and “ENABLE” status displays were created for the new (user-defined) check box.

Page 104: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 104/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-58

Note The “Save as Metafile” function of the Graphics Designer is used to generate the individual image files for a status display. To generate the image files for the status display, proceed as described in the “HAND/AUTO changeover” section.

The figure below shows the configuration dialog box for the “STATE” status display.

Page 105: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 105/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-59

The figure below shows the configuration dialog box for the “ENABLE” status display.

Page 106: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 106/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-60

The following figure shows the definition of the faceplate tags. Figure 6-61

The figure below shows the “Configure faceplate type” dialog box.

Page 107: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 107/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-62

6.8.3 Using the project-specific “check box”

• Interconnecting the “STATE” property The following figure shows the interconnection of the “BST_CHECKBOX” faceplate type in the process picture. In this example, the “STATE” property was dynamized with a “Dynamic value ranges” dialog box. When bit “1” of the tag is set, the value “1” is returned and the checkmark is displayed. Otherwise, the checkmark is not displayed.

• Interconnecting the “ENABLE” property In this example, the “ENABLE” property is not interconnected since no corresponding access protection is configured in this example. When configuring an access protection, you can use this property to indicate that operation is possible or not.

Page 108: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 108/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 6-63

Note The “ENABLE” status display is not dynamized, the default static value of the property is “0” (not operator-accessible). Although a gray background has been configured, the check box still has a white background. The reason for this is that the value that has been configured as a static value when creating the faceplate type is active for non-dynamized status displays within faceplate types.

Page 109: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 109/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• Setting the “szControlTag” property In this example, the “QdwState” string is assigned to the “szControlTag” property. In this case, “QdwState” is the name of the WinCC tag whose bit is set or reset.

• Setting the “dwBitMask” property In this example, the value “2” string is assigned to the “dwBitMask” property. The hexadecimal value “2” means that bit 1 is set or reset.

• Configuring the “Mouse > Press left” event The “Mouse > Press left event” is dynamized with the “BST_CHECKBOX_CMD_TOGGLE()” project function. Figure 6-64

The “BST_CHECKBOX_CMD_TOGGLE()” script toggles the bit of an unsigned 32-bit WinCC tag specified in “szControlTag” and “dwBitMask”. The following actions are performed in the script:

– The value of the WinCC tag is read

– The specified bits (bit mask) are toggled. The “^” “Exclusive OR” function is used for this purpose.

Page 110: 61987141 WinCC Blocks en Copy

Configuring technological Subfunctions

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 110/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

– The value of the WinCC tag is written

– An operator message is generated in Tag Logging.

Page 111: 61987141 WinCC Blocks en Copy

Functions for PC Diagnostics

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 111/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

7 Functions for PC Diagnostics

This section provides information on how you can monitor the PC hardware for status and function in WinCC Runtime.

This application uses the procedure described in the FAQ with ID number 29855065 to display information on the general computer utilization and special hardware information.

7.1 Display of the general computer utilization

The general computer utilization (CPU, memory and disk utilization) is displayed in the “PCDiagSysInfo.pdl” picture. The data is provided by the WinCC “System Info” channel. In Runtime, the picture is called using the

button in the footer. Figure 7-1

Page 112: 61987141 WinCC Blocks en Copy

Functions for PC Diagnostics

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 112/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

7.2 Display of special hardware information

If you are using specific SIEMENS Industrial PCs, you can display the following diagnostic information:

• Diagnostic information of the fans

• Diagnostic information of the UPS system

• Temperature of the computer

This information is shown in the “PCDiagBase.pdl” picture. This picture is called using the “PCDiagBase.pdl” button in the “PCDiagSysInfo.pdl” picture. Figure 7-2

Notes These diagnostics are executable only when

• special PC hardware is used (SIMATIC Microbox, SIMATIC Box/Panel/Rack PC)

• additional software is used (“SIMATIC PC DiagBase” and “SIMATIC PC DiagBridge”).

If the hardware requirements are not met, an error message is displayed:

Page 113: 61987141 WinCC Blocks en Copy

Functions for PC Diagnostics

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 113/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 7-3

To avoid this error message if the requirements are not met, the VBS action for reading out the “PCDiagCycle.bac” diagnostic information was disabled. The trigger for calling this action was removed.

Page 114: 61987141 WinCC Blocks en Copy

Functions for PC Diagnostics

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 114/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 7-4

The trigger for this action has to added again when the hardware and software requirements are met and when you require this diagnostic information.

Page 115: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 115/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

8 Description of technological Blocks

This section describes technological blocks that realize basic automation tasks (for example, displaying digital and analog values, displaying and operating valves and motors). The blocks consist of the following parts:

Block in the controller A block in the controller (AS) performs the actual automation function. The automation functions of the controller are also executable without WinCC Runtime. Many blocks can be additionally operated and monitored. Associated block icons can be displayed and faceplates can be called.

Block icons A block icon is used to display the essential properties of a technological function in the process picture. The block icons created in this application have the following properties:

• Only important information is clearly displayed

• Space saving

• Measuring point name can be shown/hidden

• Measuring point name as Tooltip text

• When clicking, the associated faceplate can be opened

• Centrally changeable since realized as faceplate types (NEW! WinCC V7.0 and later)

• Uniform display of the information in different blocks

Faceplates A faceplate is used for the detailed display of the properties of a technological function in the process picture. These properties are normally displayed as a picture window. A faceplate can be made visible and invisible with the “Display” property of the picture window. A faceplate can have different views, for example:

• Standard

• Message

• Trend

• Service

Page 116: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 116/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

8.1 BST_DIGITAL (FB650 binary value display)

The BST_DIGITAL block (FB650) is used to display a binary signal. It can, for instance, be used to display signals of digital input cards. The signal to be monitored can be

• time-delayed,

• negated and

• simulated.

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_DIGITAL_scl.txt” text file.

AS block CFC view Figure 8-1

Page 117: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 117/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

OS block views Table 8-1

View Picture

Block icon Standard

Message

Service

Page 118: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 118/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

8.2 BST_ANALOG (FB640 analog value display)

The BST_ANALOG block (FB640) is used to display an analog signal. The block reads an analog input signal, conditions it and provides the result at the “QfVal”(REAL) output. Different input signals are supported. Depending on the “iMode” parameter, the active input signal and the data format adjustment type are defined.

The following data format adjustments are supported:

• S7 analog value (iMode=0) The “wVal” input (WORD) is used as an input signal. This signal is interpreted as a signal as it is supplied by SIMATIC analog input modules. With the aid of the “fHR” (High Range) and “fLR” (Low Range) parameters, this signal (raw value) is converted to a REAL value and provided at the “QfVal” output.

• REAL value (iMode=1) The “fVal” input (REAL) is used as an input signal. This signal is directly provided at the “QfVal” output without conversion.

Simulation The “QfVal” signal output by the block can be simulated.

• The simulation can be enabled/disabled by the operator in the OS “Service” block view or by setting the SIM_L input signal (linkable input simulation)

• Note: The “SIM_L” signal is evaluated only when the “LIOP_SEL” input has the value “TRUE”.

• Limit monitoring

• The block offers the option of monitoring the output “QfVal” signal for limit violations. A maximum of 4 limits can be parameterized. The following parameters can be set for each limit:

– Limit for limit violation/limit value underflow (LIM_byPositiv)

The “LIM_byPositiv” input parameter (BYTE) is a bit mask that defines the effective direction of each limit. Each limit is represented by one bit, limit 1 by bit 0, limit 2 by bit 1, etc ... If a bit is set, the limit is triggered for limit violation, otherwise for limit value underflow.

– Limit enabled (LIM_byEnable)

The “LIM__byEnable” input parameter (BYTE) is a bit mask that separately enables/disables the limits. Each limit is represented by one bit, limit 1 by bit 0, limit 2 by bit 1, etc ... If a bit is set, the limit is enabled, otherwise disabled.

– Limit as an alarm (LIM_byAlarm)

Page 119: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 119/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

The “LIM_byAlarm” input parameter (BYTE) is a bit mask that separately defines the limits as an alarm message. Each limit is represented by one bit, limit 1 by bit 0, limit 2 by bit 1, etc ... When a bit is set, the limit is defined as an alarm. In this case, a limit violation triggers a message. When at least one limit defined as an alarm has been violated, the “QALARM” output (BOOL) is set to “TRUE”.

– Limit as a warning (LIM_byWarn)

The “LIM_byWarn” input parameter (BYTE) is a bit mask that separately defines the limits as a warning message. Each limit is represented by one bit, limit 1 by bit 0, limit 2 by bit 1, etc ... When a bit is set, the limit is defined as a warning. In this case, a limit violation triggers a message. When at least one limit defined as a warning has been violated, the “QWARN” output (BOOL) is set to “TRUE”.

– Hysteresis

A common hysteresis is parameterized for all limits. The value of the hysteresis is specified at the “LIM_fHys” parameter. The “LIM-bHysAbsolut” parameter is used to set whether the hysteresis is specified as an absolute value or as a percentage value. If the “LIM-bHysAbsolut” parameter has the value “TRUE”, the “LIM_fHys” hysteresis is specified as an absolute value, otherwise as a percentage value.

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_ANALOG_scl.txt” text file.

Page 120: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 120/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

AS block CFC view Figure 8-2

Page 121: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 121/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Block views Table 8-2

View Picture

Block icon

Standard

Message

Trend

Page 122: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 122/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

View Picture

Limits

Service

8.3 BST_ILOCK (FB651 parameterizable AND/OR operation)

The BST_ILOCK block (FB651) is an AND/OR gate that can be operated and monitored. It has the following functions:

• AND/OR function selectable

The “I0_b0”...“ I0_b7” inputs are ANDed or ORed. The logic result is available at the “QON” and “I0_QbOut” outputs.

• The AND or OR function can be selected by the “I0_AND” input parameter (BOOL). If the “I0_AND” input parameter has the value “TRUE”, the “I0_b0”...“ I0_b7” input signals are ANDed, otherwise ORed.

• In the faceplate, the “I0_AND” parameter is displayed by the “AND” or “OR” icon.

• Negation of the output signal

Page 123: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 123/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Depending on the “I0_NEG” input parameter (BOOL), the logic result can be additionally negated. The logic result of the 8 “I0_b0” ... “I0_b7” input signals is additionally negated only if the “I0_NEG” input parameter has the value “TRUE”, otherwise not.

• The “I0_NEG” parameter is displayed in the faceplate.

• Negation of the input signals

Depending on the associated “I0_b0neg”...“ I0_b7neg” input parameters (BOOL), the “I0_b0”...“ I0_b7” input signals can be negated before they are ANDed or Ored. The associated input signal is negated only if the input parameters “I0_b0neg” through “I0_b7neg” have the value “TRUE”, otherwise not.

In the faceplate, the “I0_b0neg”...“ I0_b7neg” parameters are indicated by a negation point at the input signal.

• Display of comment text

The “S7_string_0” texts of the “I0_b0”...“ I0_b7” input signals are displayed in the faceplate as comment text.

• Simulation of the output signal

The “QON” output signal logic result can be simulated depending on the “SIM_bON” input parameter (BOOL) and “SIM_bVal” (BOOL). The value “SIM_bVal” is output as a “QON” output signal only if the “SIM_bON” parameter has the value “TRUE”, otherwise the logic result of the input signals.

In the faceplate, the negation of the output signal is displayed by a negation point at the output.

The “SIM_bON” and “SIM_bVal” parameters can be operated and monitored in the faceplate.

• Simulation of the input signals

The “QON” output signal logic result can be simulated depending on the “SIM_bON” input parameter (BOOL) and “SIM_bVal” (BOOL). The value “SIM_bVal” is output as a “QON” output signal only if the “SIM_bON” parameter has the value “TRUE”, otherwise the logic result of the input signals is output.

• The “SIM_bON” and “SIM_bVal” parameters can be operated and monitored in the faceplate.

Page 124: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 124/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_ILOCK_scl.txt” text file.

AS block CFC view Figure 8-3

Page 125: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 125/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Block views Table 8-3

View Picture

Block icon Standard

Service

This view is identical to the “Standard” view. It is possible to provide the options for manual setting and resetting of interlocks only in the “Service” view.

8.4 BST_MOTOR (standard motor block)

The BST_MOTOR motor block is used for the visualization and control of a motor with fixed speed and fixed direction of rotation.

Functions The block has the functions described above:

• On/Off switching

– HAND/AUTO changeover

– Local/Remote changeover

– Simulation of the On/Off feedback

– Display of the locking conditions by means of “BST_ILOCK”

Error behavior and acknowledgement • The following errors are detected:

• On/Off feedback

• Motor protection

• Error interlock active

• Dry run protection (currently only intended)

Page 126: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 126/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• If one of the errors occurs, it is displayed in the picture and in Alarm Logging.

An error has to be acknowledged using the “RESET” button in the faceplate or via the “RESET_L” input of the block. The acknowledgement of the error in Alarm Logging does not influence the function of the block but only the display in Alarm Logging (Alarm Control).

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_MOTOR_scl.txt” text file.

Page 127: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 127/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

AS block CFC view Figure 8-4

Block views Table 8-4

View Picture

Block icon

Page 128: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 128/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

View Picture

Standard

Message

Service

Page 129: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 129/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

8.5 BST_VALVE (standard valve block)

The BST_VALVE block is used for the visualization and control of a binary valve with the two final states OPEN/CLOSED.

Functions The block has the following functions:

• Setting to OPEN/CLOSED

• HAND/AUTO changeover

• Local/Remote changeover

• Simulation of the OPEN/CLOSED feedback

• Display of the locking conditions by means of “BST_ILOCK”

The following statuses with regard to opening/closing are displayed:

• CLOSE

• OPENING

• OPEN

• CLOSING

Error behavior and acknowledgement The following errors are detected:

• OPEN/CLOSED feedback missing

• Error interlock active

If one of the errors occurs, it is displayed in the picture and in Alarm Logging.

An error has to be acknowledged using the “RESET” button in the faceplate or via the “RESET_L” input of the block. The acknowledgement of the error in Alarm Logging does not influence the function of the block but only the display in Alarm Logging (Alarm Control).

Configuring the interlock When the “LOCK” input is interconnected with the output of an block, the configured interlock condition can be displayed in Runtime. The associated interlock block can be opened using the “INTERLOCK” button.

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_VALVE_scl.txt” text file.

Page 130: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 130/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

AS block CFC view Figure 8-5

Page 131: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 131/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Block views Table 8-5

View Picture

Block icon

Standard

Message

Service

Page 132: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 132/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Display of the interlock by the ILOCK block The interlock condition can be displayed by the associated interlock block of the ILOCK block type. The associated interlock block can be opened using the “INTERLOCK” button.

When the interlock is present and the valve is not controlled (CLOSED status), no error is generated. The valve cannot be opened when it is locked. A yellow “IL” symbol is displayed in the block icon. An error is only generated and indicated by a red “IL” symbol when the valve is controlled and subsequently the locking condition occurs.

The figure below shows the interlock block and a present locking condition is simulated by the “simulation of the output”. Figure 8-6

8.6 BST_SIMODIR (FB611 SIMOCODE pro direct starter)

The SIMODIR block is used to integrate the SIMOCODE pro motor management system as a direct starter.

Page 133: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 133/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Functions: The block has the following functions:

• Switching ON/OFF

• HAND/AUTO changeover

• Local/Remote changeover

• Simulation of the OPEN/CLOSED feedback

• Display of the locking conditions by means of “BST_ILOCK”

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_SIMODIR_scl.txt” text file.

Page 134: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 134/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

AS block CFC view Figure 8-7

Page 135: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 135/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Block views Table 8-6

View Picture

Block icon

Standard

Message

Trend

Page 136: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 136/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

View Picture

Service

Statistics

Diagnostics

Page 137: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 137/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

8.7 BST_SIMOREV (SIMOCODE pro reversing starter)

The SIMODIR block is used to integrate the SIMOCODE pro motor management system as a reversing starter.

Functions The block has the following functions:

• Switching On/Off (ON LEFT / OFF / ON RIGHT)

• HAND/AUTO changeover

• Local/Remote changeover

• Simulation of the On/Off feedback

• Display of the locking conditions by means of “BST_ILOCK”

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_SIMOREV_scl.txt” text file.

Page 138: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 138/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

AS block CFC view Figure 8-8

Block views Table 8-7

View Picture

Block icon

Page 139: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 139/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

View Picture

Standard

Message

Trend

Page 140: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 140/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

View Picture

Service

Statistics

Diagnostics

Page 141: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 141/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

8.8 BST_FF (FB653 operator-controllable flipflop)

The “BST_FF” block is an operator-controllable SR flipflop. The block features a “HAND/AUTO” changeover. In “Hand” mode, the operator can set or reset the “QON” output of the flipflop in WinCC Runtime. In “Automatic” mode, the “QON” output is set by the “AUTO_S” signal and reset by the “AUTO_R” signal.

In addition, the block has an “ERR_EXTERN” error input and a “LOCK” interlock input. If an error or a locking condition occurs, the “QON” output is reset. The output can only be set again after the error condition has disappeared and after the error has been reset.

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_FF_scl.txt” text file.

Page 142: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 142/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

AS block CFC view Figure 8-9

Block views Table 8-8

View Picture

Block icon

Page 143: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 143/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

View Picture

Standard

Message

8.9 BST_COUNT (FB654 counter, integrator)

The BST_COUNT block is a configurable counter function block. It can be used as an integrator (numerical rectangular integrator) to simulate, for example, a level of a tank depending on the feedback of valves or pumps.

The current count value or the value of the integrator is provided at the “QfVal” output (REAL) and can, for instance, be interconnected with “SIM_bVal” of the “BST_ANALOG” block.

It is calculated depending on the old value (value before a sampling interval) and the following input parameters

• INT1_bRun

• INT1_fVal

• INT1_fFactor

• INT2_bRun

Page 144: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 144/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• INT2_fVal

• INT2_fFactor

• SAMPLE_T IF (INT1_bRun)THEN

QfVal := QfVal + (INT1_fVal * INT1_fFactor * SAMPLE_T);

END_IF;

IF (INT2_bRun)THEN

QfVal := QfVal + (INT2_fVal * INT2_fFactor * SAMPLE_T);

END_IF;

The block’s method of operation is explained by means of the following application example:

A tank has an inlet valve and an outlet valve.

You can use the “INT1_xxx” inputs to simulate the inflow and the “INT2_xxx” inputs to simulate the outflow.

Interconnect the “INT1_bRun” input with the “OPEN” feedback of the inlet valve and the “INT2_bRun” input with the “OPEN” feedback of the outlet valve. The integration constant is defined with the “INTx_fVal” and “INTx_fFactor” inputs.

At the “INTx_fFactor” input, you can define, for example, the effective direction and the dimensioning of the pipe diameter is selected at the “INTx_fVal” input. For example, you can specify the value “1.0” (inflow) at the “INT1_fFactor” input and the value 10.0 at the “INT1_fVal” input.

At the “INT2_fFactor” input, you can specify the value “-1.0” (outflow) and the value 5.0 at the “INT2_fVal” input.

The dimensioning of inflow and outflow differs in this example. The inflow is twice the outflow.

Limitation The value “QfVal” is limited according to the “fHR” (High Range) and “fLR” (LOW Range) inputs.

Resetting The current count value can be reset by the “RESET_L”=TRUE input .

The block has neither a block icon nor a faceplate.

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_COUNT_scl.txt” text file.

Page 145: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 145/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

AS block CFC view Figure 8-10

Page 146: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 146/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 8-11

8.10 BST_LAG (PT1 time-delay element)

The “BST_LAG” block simulates a controlled system: “First order time-delay element”. A typical application example is the simulation of a temperature controlled system. The block uses the backward difference quotient as a calculation specification.

IF NOT IN1bOn THEN IN1QfVal := 0.0; ELSE IN1QfVal := IN1fVal; END_IF; IF NOT IN2bOn THEN IN2QfVal := 0.0; ELSE IN2QfVal := IN2fVal; END_IF; IF INSEL THEN //IN2 activ QfVal := fOffset + QfVal + (SAMPLE_T / IN2fT1 * (IN2fKP * IN2QfVal - QfVal)); ELSE //IN1 activ QfVal := fOffset + QfVal + (SAMPLE_T / IN1fT1 * (IN1fKP * IN1QfVal - QfVal)); END_IF;

Page 147: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 147/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Depending on the “INSEL” parameter (BOOL), the “IN1fKP” and “IN1fT1” or “IN2fKP” and “IN2fT1” parameters are used for calculating the controlled system. The result is provided at the “QfVal” output and can, for example, be interconnected with the “SIM_fVal” input of the “BST_ANALOG” block.

In this application, the IN1xxx parameters are used for simulating the controlled system when “heating” and the IN2xxx parameters for simulating the controlled system when “cooling”.

The block has neither a block icon nor a faceplate. Figure 8-12

8.11 BST_SPLITR (splitting a controller control command for two actuators)

The “BST_SPLITR” block splits the output signal of a PID controller into two signals so that, for instance, two actuators that act in opposite directions (e.g., heating/cooling) can be used to control a temperature.

The block has neither a block icon nor a faceplate. Figure 8-13

Page 148: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 148/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 8-14

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_SPLITR_scl.txt” text file.

8.12 BST_CONST (using constants in the CFC)

The BST_CONST block is used to specify fixed values in the CFC program. The block inputs are copied to the associated outputs without changes. This makes it possible to assign the same values (parameters) to the inputs of several blocks.

The block has neither a block icon nor a faceplate.

Page 149: 61987141 WinCC Blocks en Copy

Description of technological Blocks

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 149/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 8-15

Input Output Data type

f1 Qf1 REAL

f2 Qf2 REAL

f3 Qf3 REAL

f4 Qf4 REAL

b1 Qb1 BOOL

b2 Qb2 BOOL

b3 Qb3 BOOL

b4 Qb4 BOOL

AS block SCL source The source is located in the “bsmi.STEP7_Sourcen.zip” zip archive in the “BST_CONST_scl.txt” text file.

8.13 BST_MSG (general message)

The “BST_MSG” block contains an “ALARM_8P” block and a “NOTIFY_8P” block and the inputs/outputs are configured to the interface of this block. Thus, messages can be generated with this block. In this application, the block was used to determine the correlation between the STEP 7 message classes and the WinCC message classes and message types.

The block has neither a block icon nor a faceplate.

8.14 BST_OBGEN (generating error OBs)

Due to the “S7_tasklist” block attribute of this block, error OBs are generated for the S7 program when compiling.

S7_tasklist:='OB100,OB101, OB81, OB82, OB83, OB84, OB85, OB86, OB87';

The actual program code is empty.

Page 150: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 150/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

9 Description of the Example Plant

The configuration example shows how the blocks mentioned above can be used in a project for automating a plant. An example plant consisting of two units was configured. Each unit consists of a tank with agitator, piping, sensors and actuators. Both units are visualized in one process picture. The figure below shows the associated process picture in WinCC Runtime. The measuring point display is enabled on the block icons. Figure 9-1

9.1 Basic level of automation

9.1.1 General instantiation

A separate CFC is created for each measuring point. The chart name includes the measuring point name. In the CFC, the block type corresponding to the measuring point type is then called and interconnected.

Example The “BST_DIGITAL” block is installed for a measuring point of the “binary value” measuring point type (e.g., digital input, overflow protection).

Page 151: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 151/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-2

Note In this sample project, the hardware has not been configured (HW Config) and no icons have been created for the inputs/outputs of the STEP 7 program. For this reason, the actual signal input of the “bInp” block is not yet interconnected with a process interface system input. For actuators, the actual control output is not interconnected with a process interface system output. This also applies to the other measuring points except the “E203” measuring point. When this application was created, a Profibus field device of the “SIMOCODE pro” type was available. In this sample project, the SIMOCODE module was configured as a “reversing starter” (drive with two directions of rotation). In the CFC, the peripheral inputs and outputs of the SIMOCODE are interconnected with the “SIMOREV” block.

Figure 9-3

Page 152: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 152/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

The smart selection of the S7 program name, the CFCs and the included blocks ensures that the measuring points can be stored. This enables you to influence the names of the WinCC tags created during OS compilation. The figure below shows the chart folder in the SIMATIC Manager and a section of the WinCC tag management. Figure 9-4

Notes • Measuring points of “UNIT13” or “UNIT14” were configured in this sample project.

• The name of the S7 program folder of the SIMATIC 400 station was renamed to “PCELL”.

Page 153: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 153/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

9.1.2 Interlocks

Actuators normally have locking conditions. The locking conditions are mostly defined in lists of interlocks by the process engineer. The conditions under which the safety position has to be set is defined for each actuator. For example, for valves the safety position can be “OPEN” or “CLOSED”. A motor can be in the “OFF” or “ON” safety position.

NOTICE The blocks have a “fixed” safety position. “CLOSED” or “OFF”. You have to adjust the blocks if another safety setting is required!

The interlocks are normally realized as a logic operation of “AND” and “OR” blocks. The logic result is interconnected with the “LOCK” block input. To ensure that the interlocks can be can be operated and monitored by the operator in Runtime, the “BST_ILOCK” block was created. This block is a parameterizable “OR” or “AND” block. To ensure that the interlock block can be called by the associated “actuator” faceplate using the “Interlock” button in WinCC Runtime, the following naming convention must be adhered to:

• The interlock block must be installed in the same chart as the block to be interlocked.

• The name of the interlock block in the CFC has to begin with the same name as the actual block to be interlocked. Merely the “_IL” string is added at the end.

Example: The name of the block to be interlocked in the CFC is “VALVE”. The name of the interlock block must be “VALVE_IL”.

In the CFC, the actual interlocking texts are entered at the “string_0” attribute of the individual interlock signals.

Page 154: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 154/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-5

The texts are transferred to the text library during OS compilation and the associated text reference tags are created. The text reference tags created in this way in WinCC are used in the faceplate to display the interlocking texts. The figure below shows the correlation between the interlocking texts parameterized in the CFC and the display in WinCC Runtime.

Page 155: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 155/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-6

9.2 Additional simulation of process variables

The functions for simulating described in this section are only necessary if the control program is to be tested without a real process. The simulation plays a significant role during the configuration and commissioning phase.

The technological blocks described above already feature “SIMULATION ON” mode. In the case of an actuator (valve or motor), the associated block simulates the “OPEN/CLOSED” or “ON/OFF” feedback. The individual control signal is used for the simulation of the feedback. This ensures that a valve can be opened without causing the “Execution Time Check” or “Error Feedback” error.

However, the actual controlled system is not simulated by this type of simulation. For instance, the flow display and the level of a tank do not change when the associated inlet valve is opened.

If higher-level automatic functions, for example controls or step sequences, are to be tested without process interface, it is advisable to simulate the missing signals.

Page 156: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 156/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

For this reason, additional blocks simulating the controlled systems are interconnected for the simulation in this project. Basically, there are two types of controlled systems: Self-regulating processes and controlled systems without inherent regulation.

9.2.1 Central enable/disable of “Automatic” mode

Higher-level automatic functions (controls, step sequences) normally always control any actuators (valves, pumps) to influence the process. This is done via the control signals that are intended for Automatic mode. In the case of the “BST_VALVE” block to control a valve, these are the following signals:

• “AUT_L” and “LIOP_SEL” (for changeover to Automatic mode)

• “AUTO_OPEN” (for control in Automatic mode)

• “L_RESET” (for resetting via automatic functions)

The signal for control in Automatic mode, e.g. “AUTO_OPEN”, causes a control only when the block is “Automatic” mode.

If the higher-level automatic function does not automatically set the used actuators to “Automatic” mode, this has to be done by the operator. To support the operator, a flipflop that can be operated and monitored (“BST_FF” block type) was installed for each unit. Via a faceplate, the operator can set the entirety of all actuators (valves, motors) of a unit to “Automatic” mode.

Page 157: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 157/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-7

The following two figures show the interconnection. As an example, the signals for the central setting of “Automatic” mode for the “V109” valve are marked (red frame). Figure 9-8

Page 158: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 158/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-9

Note Since the “LIOP_SEL” signal input is also used for several changeover functions (e.g., HAND/AUTO, simulation ON/OFF), there is an upstream “OR” block.

9.2.2 Central enable/disable of “Simulation” mode

To ensure that higher-level automatic functions can also be tested without process interface, it may possibly be necessary to set many sensors/actuators to “Simulation ON” mode. To support the operator, a flipflop that can be operated and monitored, “BST_FF” block type, was installed for each unit for this purpose.

The operator can set/reset the flipflop output (“BST_FF”) via a faceplate. This ensures that all actuators of a unit can be set to “Simulation ON” or “Simulation OFF” mode with only one switching action.

Page 159: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 159/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-10

The following two figures show the interconnection. As an example, the signals for the central setting of “Simulation” mode for the “V109” valve are marked (red frame).

Page 160: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 160/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-11

Page 161: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 161/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-12

Note Since the “LIOP_SEL” signal input is used for several changeover functions (e.g., HAND/AUTO, simulation ON/OFF), there is an upstream “OR” block.

9.2.3 Simulation of controlled systems without inherent regulation (for example, level)

Controlled systems without inherent regulation have an integral response characteristic. Examples are the level of a tank or the position (path) of a drive.

In this application, the “BST_COUNT” block type was used for simulating the “UNIT13_LI120” level.

By means of the process picture, the following figure shows which measuring points are involved in the simulation.

Page 162: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 162/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-13

Output interconnection The figure below shows the output interconnection of the “BST_COUNT” block.

The simulated level is provided at the “QfVal” output of the “ANALOG_SIM” block (“BST_COUNT” block type). It is connected to the “SIM_fVal” simulation input of the “ANALOG” analog input block (“BST_ANALOG” block type). The “ANALOG” block uses this signal in “Simulation ON” mode.

Page 163: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 163/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-14

The “QbHR” and “QbLR” outputs of the “ANALOG_SIM” simulation block are used to simulate the following binary displays: “Tank Empty” and “Tank Full” (“overflow protection”). These signals are connected to the “SIM_bVal” simulation input of the two “DIGITAL” digital input blocks.

Input interconnection The figure below shows the input interconnection of the “BST_COUNT” block.

Page 164: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 164/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-15

Depending on the position of the “V101”, “V102” and “V109” valves, the “ANALOG_SIM” block scales up, scales down or remains constant.

The INT1xxx inputs of the “ANALOG_SIM” block are used for “up-scaling” and the “INT2xxx” inputs for “down-scaling”. The “INTx_bRun” input is interconnected with one block of the “BST_ILOCK” type to generate the signals for up-scaling and down-scaling.

• “Fill Tank” condition The “ANALOG_SIM_INT1” block is parameterized as an “AND” operation (“I0_AND=1”). It provides the signal for “up-scaling” at the “QON” output. It is interconnected with the “INT1_bRun” input of the “ANALOG_SIM” block. The “OPEN” feedback of the “V109” valve is connected to the “I0_b0” input of the “ANALOG_SIM_INT1” block.

When the “V109” valve (inlet valve) is opened, the integrator receives the command for “up-scaling” (The product of the two “INT1_fVal=1” and “INT1_fFactor=1” parameters is positive)

• “Empty Tank” condition The “ANALOG_SIM_INT2” block is parameterized as an “AND” operation (“I0_AND=1”). It provides the signal for “down-scaling” at the “QON” output. It is interconnected with the “INT2_bRun” input of the

Page 165: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 165/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

“ANALOG_SIM” block. The “OPEN” feedbacks of the “V101” and “V102” valves are connected to the “I0_b0” and “I0_b1” inputs of the “ANALOG_SIM_INT2” block.

When the “V101” and “V102” valves (outlet valves) are opened, the integrator receives the command for “down-scaling” (The product of the two “INT2_fVal=1” and “INT1_fFactor=-1” parameters is negative) The figure below shows the characteristic of the simulated level of the tank when:

– Only the “V109” inlet valve is opened

– Inlet and outlet valves are closed

– Only the “V101” and “V102” outlet valves are opened

Figure 9-16

9.2.4 Simulation of self-regulating processes (for example, temperature)

Self-regulating processes have a proportional response characteristic. This means that the controlled variable reaches a stationary final value when the controlled variable is constant. Examples are the temperature of a tank or the flow in piping.

In this application, the “BST_LAG” block type was used for simulating the “UNIT13_TIC160” and “UNIT14_TIC260” temperatures.

The following section describes the simulation of the “UNIT14_TIC260” measuring point. The two “V204” and “V205” valves are used for simulating the “TIC260” temperature. The “V204” valve is the heating valve and “V205” is the cooling valve. The figure below shows the measuring points in the process picture.

Page 166: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 166/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-17

Output interconnection The figure below shows the output interconnection of the “BST_LAG” block.

The simulated temperature is provided at the “QfVal” output of the “SIMU” block (“BST_LAG” block type). It is connected to the “SIM_fVal” simulation input of the “ANALOG” analog input block (“BST_ANALOG” block type). The “ANALOG” block uses this signal in “Simulation ON” mode. Figure 9-18

Page 167: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 167/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Input interconnection The figure below shows the input interconnection of the “BST_LAG” block.

The “OPEN” feedback of the heating valve is interconnected with the “IN1bOn” input signal.

The “OPEN” feedback of the cooling valve is interconnected with the “IN2bOn” input signal.

Note • The IN1xxx signals are used for calculating the controlled system when heating. The IN2xxx signals are used for calculating the controlled system when cooling. The outputs of both controlled systems are added to calculate the overall controlled system.

• The parameters of the controlled systems when heating and cooling are set with the “INxfVal”, “INxfKP”, “INxfT1” and “INxfOffset” parameters.

The following figure shows the time characteristic of the simulated tank temperature:

• The heating and cooling valves are closed at the starting point of the characteristic. The temperature is set to 0°C.

• The heating valve is opened. A temperature of 120°C is set.

• The heating valve is closed. The temperature cools down to 0°C.

• The cooling valve is opened. The temperature cools down to -20°C.

• The cooling valve is closed. The temperature rises to 0°C.

• Both valves, heating valve and cooling valve, are opened. The temperature rises to 100 °C.

Page 168: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 168/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-19

9.3 Higher-level automatic functions

9.3.1 Two-step temperature control tank Unit 13 “TIC160”

The “UNIT13_TIC160” chart includes the “ANALOG” block (“BST_ANALOG” block type) to display the temperature. In addition, the chart contains the “SIMU” block (“BST_LAG” block type) to simulate the temperature.

The two-step control is implemented with the limit monitoring function of the “ANALOG” block. The “V104” heating valve is switched depending on the “LIM_f01” limit. For this purpose, the “LIM_Qb01” output of the “ANALOG” block is interconnected with the “AUTO_OPEN” signal of the “V104” valve. The hysteresis is specified with 3% (“LIM_fHys=3.0” and “LIM_bHysAbsolut=0”).

The following figure shows the output interconnection of the “ANALOG” block in the CFC.

Page 169: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 169/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-20

The figure below shows the temperature profile for a setpoint step-change.

Page 170: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 170/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Figure 9-21

9.3.2 PID temperature control tank Unit 14

The “UNIT14_TIC260” chart includes the “ANALOG” block (“BST_ANALOG” block type) to display the tank temperature. The “SIMU” block (“BST_LAG” block type) is used to simulate the temperature. The “CONTC” block (“CONT_C” block type (continuous control)) is used to control the temperature. The “CONTC” block (“CONT_C” block type) is included in the scope of delivery of STEP 7. The “QfVal” output of the analog block is interconnected with the “PV_IN” input (controlled variable) of the “CONTC” block. The setpoint for the control is specified by the “LIM_f01” limit of the “ANALOG” block. For this purpose, the “LIM_Qf01” output of the “ANALOG” block is interconnected with the “SP_INT” input of the “CONTC” block.

Two valves are used as actuators, one binary valve for heating and one for cooling.

Using the “SPLITR” block (“BST_SPLITR” block type), the “LMN” control command of the controller is split into two control signals. Each of the two outputs of the “SPLITR” block is then interconnected with a block of the “PULSGEN” type.

• For this purpose, the “V1” signal of the “SPLITR” block is interconnected with the “INV” signal of the “V1PULS” block (“PULSGEN” block type).

• For this purpose, the “V2” signal of the “SPLITR” block is interconnected with the “INV” signal of the “V2PULS” block (“PULSGEN” block type).

The “QPOS_P” output of the two “PULSGEN” blocks is then interconnected with the “Automatic” control signal of the heating and cooling valve:

• For this purpose, the “QPOS_P” signal of the “V1PULS” block is interconnected with the “AUTO_OPEN” signal of the “UNIT14_V204\VALVE” block.

Page 171: 61987141 WinCC Blocks en Copy

Description of the Example Plant

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 171/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

• For this purpose, the “QPOS_P” signal of the “V2PULS” block is interconnected with the “AUTO_OPEN” signal of the “UNIT14_V205\VALVE” block.

Figure 9-22

The figure below shows the time characteristic of the temperature for a setpoint step-change.

Figure 9-23

Page 172: 61987141 WinCC Blocks en Copy

References

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 172/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

Appendix and References

10 References Table 10-1

Topic Title \1\ Reference to the

entry http://support.automation.siemens.com/WW/view/en/31624179

\2\ Siemens A&D Customer Support

http://support.automation.siemens.com

\3\ Reference to the entry

How do you integrate an existing WinCC project into a STEP 7 project? http://support.automation.siemens.com/WW/view/en/11841504

\4\ Reference to the entry

How should you proceed when "chronological reporting" is to be used, but WinCC has been installed before STEP 7? http://support.automation.siemens.com/WW/view/en/22272911

\5\ Reference to the entry

How are message classes used if WinCC is integrated in the STEP 7 project? http://support.automation.siemens.com/WW/view/en/31622970

\6\ Reference to the entry

How are message texts used if WinCC is integrated in the STEP 7 project? http://support.automation.siemens.com/WW/view/en/30550239

\7\ Reference to the entry

How can you open a faceplate belonging to a customized object at Runtime? http://support.automation.siemens.com/WW/view/en/24193022

\8\ Reference to the entry

How can you have hardware diagnostics information (hard disk status, temperature, fan status, UPS and WinAC RTX) of SIMATIC PCs of the "B generation" displayed in WinCC Runtime? http://support.automation.siemens.com/WW/view/en/29855065

\9\ Reference to the entry

How can you generate user-defined operator input messages? http://support.automation.siemens.com/WW/view/en/24325381

\10\ Reference to the entry

How can you use the texts of enumerations (under Shared Declarations in the SIMATIC Manager) for display in WinCC? http://support.automation.siemens.com/WW/view/en/27147567

\11\ Reference to the entry

How can you have messages displayed in the process picture with the smart object "State Display" when the bit alarm procedure or analog messages is being used? http://support.automation.siemens.com/WW/view/en/17778440

Page 173: 61987141 WinCC Blocks en Copy

Appendix

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 173/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

11 Appendix

BSM_WorkfieldOpen() script Table 11-1

#include "apdefap.h" int BSM_WorkfieldOpen(char *lpszPictureName, char *lpszPictureNameNew) { int iRet = 0; char szPicNew[512]; char szDesk[512]; char szPic[512]; char *pch; if (lpszPictureNameNew== NULL ){ printf ("#I091: BSM_PictureOpen() - lpszPictureNameNew is NULL! ==> ...abort!!!\r\n"); return (-91); } if (lpszPictureName== NULL ){ printf ("#I092: BSM_PictureOpen() - lpszPictureName is NULL! ==> ...abort!!!\r\n"); return (-92); } strncpy (szPicNew, lpszPictureNameNew, sizeof(szPicNew)); // //extract Desk // strncpy (szDesk, lpszPictureName, sizeof(szDesk)); pch = strstr(szDesk, ":BSM_DESK."); if (pch == NULL){ printf ("#I094: BSM_PictureOpen() - \":BSM_DESK.\" not found in lpszPictureName ==> ...abort!!!\r\n"); return (-94); } pch = strstr(pch, "."); *pch = '\0'; strcat(szDesk,".WND_WORK:BSM_WORK"); printf ("#I101: BSM_WorkfieldOpen() - lpszPictureName=\"%s\"\r\n", lpszPictureName); printf ("#I102: SetPropChar(\"%s\", \"WND_DESK\", \"PictureName\", \"%s\" \r\n", szDesk, szPicNew); SetPropChar(szDesk, "WND_DESK", "PictureName", szPicNew); SetPropBOOL(szDesk, "WND_DESK", "Visible", FALSE); SetPropBOOL(szDesk, "WND_DESK", "Visible", TRUE); printf ("#I990: BSM_WorkfieldOpen() - \r\n"); return (iRet);

}

Page 174: 61987141 WinCC Blocks en Copy

Appendix

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 174/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

BSM_TopfieldOpen() Table 11-2

int BSM_TopfieldOpen(char *lpszPictureName, char *lpszPictureNameTop, char *lpszPictureNameReturn, char *lpszPictureWindowReturn, char *lpszTopWindowReturn) { #define BSM_TOPFIELD_MAX 10 int iRet = 0; char szObjectName[256]; char szTopNew[512]; char szDesk[512]; char szPic[512]; char *pch; int i; BOOL bRet; if (lpszPictureName== NULL ){ printf ("#I091: BSM_TopfieldOpen() - lpszPictureNameNULL! ==> ...abort!!!\r\n"); return (-90); } if (lpszPictureNameTop== NULL ){ printf ("#I091: BSM_TopfieldOpen() - lpszPictureNameTopis NULL! ==> ...abort!!!\r\n"); return (-91); } //cut file extension strncpy (szTopNew, lpszPictureNameTop, sizeof(szTopNew)); pch = strrchr(szTopNew, '.'); if (pch){ // *pch='\0'; } // //extract Desk // strncpy (szDesk, lpszPictureName, sizeof(szDesk)); pch = strstr(szDesk, ":BSM_DESK."); if (pch == NULL){ printf ("#I094: BSM_PictureOpen() - \":BSM_DESK.\" not found in lpszPictureName ==> ...abort!!!\r\n"); return (-94); } pch = strstr(pch, "."); *pch = '\0'; sprintf (szPic, "%s.WND_WORK:BSM_WORK", szDesk); //if a top-window is not visible than the top-window is set visible for (i=1; i<=BSM_TOPFIELD_MAX ; i++){ sprintf (szObjectName, "TOP%02d", i); printf ("#I201: szPic=\"%s\" szObjectName=\"%s\" \r\n", szPic, szObjectName); bRet = GetPropBOOL(szPic, szObjectName, "Visible"); if (bRet == FALSE){ SetPropChar (szPic, szObjectName, "PictureName", szTopNew);

Page 175: 61987141 WinCC Blocks en Copy

Appendix

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 175/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

SetPropBOOL(szPic, szObjectName, "Visible", TRUE); if (lpszPictureNameReturn != NULL) sprintf (lpszPictureNameReturn, "%s.%s:%s", szPic, szObjectName, szTopNew); if (lpszPictureWindowReturn != NULL) sprintf (lpszPictureWindowReturn , "%s", szPic); if (lpszTopWindowReturn!= NULL) sprintf (lpszTopWindowReturn, "%s", szObjectName); break; } }//for return (iRet); }

Table 11-3

#include "apdefap.h" void BST_VALVE_TopFieldOpen(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName, UINT nFlags, int x, int y) { #ifdef BST_FUNCTION #undef BST_FUNCTION #endif #define BST_FUNCTION "BST_VALVE_TopFieldOpen" #define BST_GETLINK_PROPERTY "QdwState" //property with linked tag #define BST_GETLINK_MEMBER ".QdwState" // LINKINFO scLink; char szTagName[128]; char szTagNameChart[128]; char szCaptionText[128]; char szTagPrefix[128]=""; char szPictureWindow[512]; char szPictureNameReturn[512]; char szPictureWindowReturn[512]; char szTopWindowReturn[512]; char *pch; BOOL bOK; //=============================== //get tag prefix of parent picture //=============================== strcpy (szPictureWindow, lpszPictureName); pch =strrchr(szPictureWindow, ':'); if (pch != NULL){ *pch = '\0'; } printf ("#I085: %s() - szPictureWindow=\"%s\"\r\n", BST_FUNCTION , szPictureWindow); pch = GetTagPrefix(szPictureWindow,"WND_DESK"); //Return-Type: char* if (pch == NULL){ printf ("#IE089: %s() - GetTagPrefix() failed! ==> ...abort!\r\n", BST_FUNCTION ); // return; }

Page 176: 61987141 WinCC Blocks en Copy

Appendix

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 176/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

else{ strcpy(szTagPrefix, pch); printf ("#I092: %s() - szTagPrefix=\"%s\"\r\n", BST_FUNCTION , szTagPrefix); } //=============================== //get linked tag //=============================== bOK = GetLink(lpszPictureName,lpszObjectName,BST_GETLINK_PROPERTY , &scLink); sprintf(szTagName, "%s%s", szTagPrefix, scLink.szLinkName); printf ("#I210: %s() - szTagName=\"%s\"\r\n", BST_FUNCTION , szTagName); pch = strstr(szTagName, BST_GETLINK_MEMBER ); if (pch != NULL){ *pch = '\0'; } if (strlen(szTagName) < 1){ //open faceplate from block icon within facplate pch = GetPropChar(lpszPictureName, "szTagName","Text"); if (pch){ strcpy (szTagName, pch); } } printf ("#I220: %s() - szTagName=\"%s\"\r\n", BST_FUNCTION , szTagName); //=============================== //Open TopField //=============================== BSM_TopfieldOpen(lpszPictureName, "BST_VALVE_MAIN.PDL", szPictureNameReturn, szPictureWindowReturn, szTopWindowReturn); //Return-Type: long int printf ("#I301: %s() - szPictureNameReturn=\"%s\"\r\n", BST_FUNCTION , szPictureNameReturn); printf ("#I302: %s() - szPictureWindowReturn=\"%s\"\r\n", BST_FUNCTION , szPictureWindowReturn); printf ("#I303: %s() - szTopWindowReturn=\"%s\"\r\n", BST_FUNCTION , szTopWindowReturn); //=============================== //Set Tag Prefix //=============================== SetPropChar(szPictureWindowReturn, szTopWindowReturn, "TagPrefix", szTagName); SetPropBOOL(szPictureWindowReturn, szTopWindowReturn, "Visible", FALSE); SetPropBOOL(szPictureWindowReturn, szTopWindowReturn, "Visible", TRUE); SetPropChar(szPictureNameReturn, "szTagName", "Text", szTagName); //=============================== //Set static properties //=============================== pch = strstr(szTagName, "/"); if (pch != NULL){

Page 177: 61987141 WinCC Blocks en Copy

Appendix

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 177/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

pch++; strcpy (szTagNameChart, pch); } pch = strstr(szTagNameChart, "/"); if (pch != NULL){ *pch = '\0'; } sprintf (szCaptionText, "%s (VALVE)", szTagNameChart); SetPropChar(szPictureWindowReturn, szTopWindowReturn, "CaptionText", szCaptionText); return; }

Initializing the “Tooltip Text” script and the “szTagname” measuring point name Table 11-4

#include "apdefap.h" #include "bst.h" //#include "string.h" int BST_XXX_SetToolTip(char* lpszPictureName, char* lpszObjectName) { #ifdef BST_FUNCTION #undef BST_FUNCTION #endif #define BST_FUNCTION "BST_XXX_SetToolTip" char szTagName[128] = ""; char szTagNameChart[128] = ""; char szBuf[256]; char *pch; int iRet; BOOL bOK; char szTagName[256]; char *pch; DWORD byVal; LINKINFO scLink; //=============================== //get linked tag //=============================== bOK = GetLink(lpszPictureName, lpszObjectName, "QdwState",&scLink); sprintf(szTagName, "%s", scLink.szLinkName); pch = strstr(szTagName, ".QdwState" ); if (pch != NULL){ *pch = '\0'; } pch = strstr(szTagName, "/"); if (pch != NULL){ pch++; strcpy (szTagNameChart, pch); } pch = strstr(szTagNameChart, "/"); if (pch != NULL){

Page 178: 61987141 WinCC Blocks en Copy

Appendix

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 178/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

*pch = '\0'; } //cut unit name strcpy (szBuf, szTagNameChart); pch = strstr(szBuf, "UNIT13_"); if (pch != NULL){ strcpy (szTagNameChart, pch+strlen("UNIT13_")); } //cut unit name strcpy (szBuf, szTagNameChart); pch = strstr(szBuf, "UNIT14_"); if (pch != NULL){ strcpy (szTagNameChart, pch+strlen("UNIT14_")); } printf ("#I200: %s() - szTagNameChart=\"%s\"\r\n", BST_FUNCTION , szTagNameChart); printf ("#I300: %s() - szTagName=\"%s\"\r\n", BST_FUNCTION , szTagName); SetPropChar(lpszPictureName, lpszObjectName, "szTagName", szTagNameChart); SetPropChar(lpszPictureName, lpszObjectName, "ToolTipText", szTagName); return (0); }

Page 179: 61987141 WinCC Blocks en Copy

History

Blocks for STEP 7 and WinCC ID Number: 31624179

V1.0 04.11.2008 179/179

Cop

yrig

ht ©

Sie

men

s A

G 2

008

All

right

s re

serv

ed

3162

4179

_win

ccbl

ocks

_e.d

oc

12 History Table 12-1 History

Version Date Modification

V1.0 11/04/08 First edition