×
Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 21913875, Entry date: 07/30/2008
(4)
Rate

How do you configure bit-triggered trends (curves) in WinCC flexible?

  • Entry
  • Associated product(s)

Instructions:
A trend is a graphical representation of one or more values from the controller.


Fig. 01

By setting a trigger bit in the "trend transfer" variable the operator panel reads in either one trend value or a complete trend buffer. This is defined in the configuration. Bit-triggered trends are usually used to display rapidly changing values. One example of this is the injection pressure in the production of plastic parts. In order to trigger bit-triggered trends, in the configuration you must create the relevant external variables in the "Variables" editor in the WinCC flexible Engineering System and link them to trend areas. The operator panel and controller then communicate with each other via these trend areas.

Contents:

  1. Explanation of terms
  2. Configuration instructions
    2.1 Bit-triggered trend

    2.2 Bit-triggered trend with switch buffer
  3. Download

1. Explanation of terms: 

  • Trend variable (trend buffer):
    External variable whose values are displayed as a trend. The variable must be an array variable. The number of array elements must match the trend's number of measured values.
    The variable is only available if the archive has not been selected as "Settings source".
  • Trend request:
    If you open a picture on the operator panel with one or more trends, the operator panel sets the associated bits in the trend request area. After deselecting the picture, the operator panel resets the relevant bits in the trend request area.
    Via the trend request area it can be evaluated in the controller which trend is currently being displayed on the operator panel. Trends can also be triggered without evaluation of the trend request area.
  • Trend transfer 1:
    This area serves to trigger trends. In your controller program you must set the bit assigned to the trend in the trend transfer area and the trend group bit. The trend group bit is the last bit in the trend transfer area. The operator panel recognizes the triggering and reads either one word or the complete buffer from the controller. Then it resets the trend bit and the trend group bit.


Fig. 02

The trend transfer area must not be changed by the controller program until the trend group bit has been reset.

  • Trend transfer area 2
    (trend transfer 2, only required for switch buffer)
    The trend transfer area 2 is required for trends that are configured with switch buffer. It is structured in the same way as trend transfer area 1.
  • Trigger bit:
    Every trend is assigned a specific bit for communication between operator panel and controller. If, for example, you assign the trigger bit "4" to a trend, that trend is identified by Bit 4 in the trend request and in the trend transfers.
    Do not use the group bit as trigger bit. The operator panel recognizes the triggering via the group bit. The position of the group bit in the trend transfer depends on the controller set.
  • Switch buffer:
    The switch buffer is a second buffer for the same trend, which can be installed with the configuration. If the operator panel reads the values out of buffer 1, the controller writes to buffer 2. If the operator panel reads the values out of buffer 2, the controller writes to buffer 1. This prevents the trend values being overwritten by the controller when the operator panel is reading out the trend.


Fig. 03

2. Configuration instructions:
The following examples show how to proceed for a bit-triggered trend with and without switch buffer.

2.1 Example of a bit-triggered trend
 

No. Procedure
1

Create data blocks in STEP 7
You first create the following tags in the controller:

  • Trend buffer (trend variable of the array type)
  • Trend request
  • Trend transfer 1

In the controller you create, for example, DB10 for the trend buffer.


Fig. 04

In the controller you create, for example, DB12 for the trend request.


Fig. 05

In the controller you create, for example, DB14 for the trend transfer 1.


Fig. 06
2

Configure trend display in WinCC flexible
First, you configure the following in WinCC flexible:

  • Create a new picture.
  • Insert a trend view in the picture via "Tools > Advanced objects".
  • Create controller variables in WinCC flexible.

Parameterizing the trend view:

  • General
    In the "General" properties you define whether you want to have buttons and the value table displayed as well.


Fig. 07
  • Properties, X Axis
    "Mode" - here you preset "Points".
    "Number of points" - here you specify how many points are to be displayed on the X axis.
    If the measurement consists of 50 measured values and you enter 25 there, then 25 of the 50 measured values will be displayed accordingly. If you have configured "Buttons" under General, Button bar style, then you can have the other values displayed in the picture via the buttons.


Fig. 08
  • Properties, Trend
    "Name" -  here you can assign an appropriate name to each trend.
    "Number of points" - the number of points depends on the how many array variables you have specified for the "trend variable" (trend buffer). If you have specified 51 array variables (ARRAY[0..50]) for "trend variables" in controller, then 51 is the "number of points".
    "Trend type" - here you specify the trend type "Buffer bit-triggered".


Fig. 09
  • Parameterizing the fields in the "Source" folder.
    If you configure a new trend under "Trends", in the "Source settings" field, the tags are defined for the following parameters:
        - Trend buffer (array tag with trend values)
        - Bit (bit position in "Trend request" and "Trend transfer")
        - Trend request (picture selected on operator panel)
        - Trend transfer 1 (trigger to read the trend values 1)


Fig. 10

Here you enter the variables defined beforehand.

3

Function:
If the picture with the trend view is called on the operator panel, the operator panel sets the relevant bits in the trend request area (DB12.DBW0).
In this example, Bit "1" has been configured for the "Trend_1" (Fig. 9).
After deselecting the picture, the operator panel resets the relevant bits in the trend request area.


Fig. 11

If, in the controller program, the bit assigned to the trend is set in trend transfer area 1 (DB14.DBW0) and the trend group bit is set, the operator panel recognizes triggering and reads the complete buffer (because of the configuration "trend type: buffer bit-triggered") out of the controller. Then it resets the trend bit and the trend group bit.
In this example, the bit DB14.DBX1.1 (trend bit) and the bit DB14.DBX0.7 (trend group bit) had to be set for "Trend_1" in the controller.


Fig. 12

The values transferred are the values stored in the trend buffer. In this example the values are those stored in DB10 as from DBW0.

2.2 Example of a bit-triggered trend with switch buffer
 

No. Procedure
1 Create data blocks in STEP 7
The procedure is primarily the same as for configuration of a bit-triggered trend without switch buffer.

You create the following additional variables in the controller:

  • Trend transfer 2 (e.g. DB16)
  • Switch buffer (e.g. DB18,  trend variable of the array type)
  • Trend buffer (e.g. DB20,  trend variable of the array type)
2 Configure trend display in WinCC flexible
The controller variables for the trend view are added in WinCC flexible.
  • Add controller variables in WinCC flexible.
  • Parameterizing the fields in the "Source" folder.

    Note:
    If you configure a new trend under "Trends", in the "Source settings" field, the tags are defined for the following parameters:
        - Trend buffer (array variable with trend values)
        - Switch buffer (array variable with trend values)
        - Bit (bit position in "Trend request" and "Trend transfer")
        - Trend request (picture selected on operator panel)
        - Trend transfer 2 (trigger to read the trend values 2)
        - Trend transfer 2 (trigger to read the trend values 2).
    The "Trend transfer 2" parameter is the trigger for the switch buffer.


Fig. 13

Here you enter the variables defined beforehand.

3 Function:
If the picture with the trend view is called on the operator panel,
the operator panel sets the associated bits in the trend request area (DB12.DBW0). In this example, Bit "3" has been configured for the "Trend_1" (Fig. 12).
After deselecting the picture, the operator panel resets the relevant bit in the trend request area.


Fig. 14

If, in the controller program, the bit assigned to the trend is set in trend transfer area 1 (DB14.DBW0) and the trend group bit is set, the operator panel recognizes triggering and reads either one value or the complete buffer. Then it resets the trend bit and the trend group bit.
In this example, the bit DB14.DBX1.3 and the bit DB14.DBX0.7 had to be set for "Trend_1" in the controller.

If, in the controller program, the bit assigned to the trend is then set in trend transfer area 2 (DB16.DBW0) and the trend group bit is set, the operator panel recognizes triggering and reads the complete buffer (because of the configuration "trend type: buffer bit-triggered") out of the controller. Then it resets the trend bit and the trend group bit.
In this example the bit DB16.DBX1.3 (trend bit) and the bit DB16.DBX0.7 (trend group bit) had to be set for "Trend_1" in the controller.

Through alternating calling of "Trend transfer 1" and "Trend transfer 2", one trend is displayed on the operator panel, respectively with the value from the "trend buffer" and "the switch buffer".
In this example the values are those stored in DB18 and DB20 respectively.


Fig. 15

3. Download
The following download includes a STEP 7 V5.3 project with the functions described above. Integrated in the STEP 7 project is a WinCC flexible 2004 configuration for OP270B. You can change the blocks and WinCC flexible project as you wish to suit your requirements.

ktrigger.zip ( 2956 KB )

Runnability and test environment:
The following table lists the components that have been used to create this entry and verify the functions described.
 

Components Product and version designation
PC operating system Microsoft Windows XP Professional SP1
Standard tools STEP 7 V5.3 SP2
HMI software WinCC flexible 2004 Advanced V1.0 SP1
HMI devices WinCC flexible 2004 Runtime V1.0 SP1
Controllers S7-PLCSIM V5.3 SP1

Keywords:
Trend curves, Trends, Curves, Trend display, Bar chart, Diagram