_smooth (Smoothing)
Smoothing
Smoothing is used to reduce the amount of communication and volume of data processed in a WinCC OA system. In other words it reduces the communication load between drivers and other managers and the amount of data that is processed in a WinCC_OA system.
In order to smooth values of data points in WinCC OA, the configs _smooth and _archiveare used. If you are not familiar with WinCC OA configs, see chapter Data point configs, basics.
The configs _smooth and _archive represent two different categories of smoothing. The _smooth config is used for the driver smoothing and the _archiveconfig for the archive smoothing by the WinCC OA DATA manager.
Driver Smoothing
Periphery-provided data can be smoothed in the driver before being further processed as original values in the WinCC OA control system. The driver compares the last read value from the PLC with the currently read value from the PLC.
The following image shows the communication between the PLC - a driver (D) and a WinCC OA system (EV = Event manager). In the figure you can see the smoothing.
Archive Smoothing
In the archive smoothing values are archived only when they pass the smoothing. The values are smoothed by the DATA manager of the WinCC OA system. The DATA manager compares a new system value with the last archived value before the value is archived or smoothed.
Several different smoothing types are available for both driver and archive smoothings. The different smoothing types are listed below and are described in more detail in the following:
Tolerance/time-dependent/combined
Value AND time-dependent smoothing
Value OR time-dependent smoothing
Note that the Increase-dependent smoothing and the flicker suppression are only valid for the driver smoothing.
Smoothing types and how to use the smoothing
To add a smoothing config, proceed as follows:
-
-
Open the PARA module. Open a data point and right-click the data point name.
-
Select the option "Insert config".
-
Check the check box "Smoothing" and click on the OK button.
-
The smoothing config is added to the data point structure. See figure below.
-
A panel is displayed in the PARA module to configure a smoothing.
The smoothing configuration allows you to specify the smoothing mode for the data types integer, unsigned and float. The same panel is also shown for other data types such as boolean but fewer options are displayed.
Smoothing panel
DPE: displays the name (description or alias) of the data point element to be edited.
Smoothing type: Select the smoothing type from the combo box; new lists and options are displayed in the panel depending on your selection.
Smoothings performed on nodes in a data point structure are inherited by all lower-level elements.
The following table displays the possible smoothing types dependent on the data type. NOTE that the types "increase dependent" and "flicker suppression" can only be used for the driver smoothing. NOTE also that the type "flicker suppression" is only available for booleans and increase-dependent for the data types float, int and unsigned.
Smoothing mode | All types | float, int, unsigned | bool |
old/new comparison | x | x | x |
old/new AND time-dependent | x | x | x |
old/new OR time-dependent | x | x | x |
value-dependent smoothing | x | ||
time-dependent smoothing | x | x | x |
value AND time-dependent smoothing | x | ||
value OR time-dependent smoothing | x | ||
increase-dependent | x | ||
flicker suppression | x |
The config attributes can be found in the Appendix.
The smoothing types listed above are described in more detail in the following.
A smoothing configured for a data point that contains an input/output address, is only valid for the input.
Smoothing types
The smoothing types are described in more detail below. Note that the same smoothing types exist for both driver and archive smoothing except for the Increase-dependent smoothing and the flicker suppression that are only valid for the driver smoothing.
In the archive smoothing values are only archived when they pass the smoothing. This also applies to the driver smoothing, the value is sent to the system by the driver only if the value passes the smoothing. In the description of the smoothing types both smoothing categories "driver" and "archive" are described and referred to as "passes the smoothing" meaning that a value is archived or sent to a WinCC_OA system. In the description in this chapter also the words "tolerance time" or “tolerance period” and "tolerance range" are used. The tolerance time/period is the time that is specified by using the option "All" - see below. The tolerance range is the value that is specified by using the option "Deadband" - see figure below.
Tolerance/time-dependent/combined
Value-dependent smoothing
For relative smoothing (if you select the check box "relative value") a value passes the smoothing when the value is the defined % (percentage value) smaller or bigger than the last valid value. This means that when the percent is e.g. 5% a value passes the smoothing when it changes from 1 to 1,5 and does not pass the smoothing when it changes from 100 to 104. The relative smoothing cannot be used for the mass configuration. For mass configuration and when you do not check the check box "Relative value", the smoothing is absolute. This means that the value passes the smoothing when the specified value for the deadband is e.g. 5 and a value changes from 0 to 5.001
Value-dependent smoothing can only be used for integer, natural or floating point data points!
The precision of the deadband value is restricted to 3 decimal places. This can lead to small rounding differences inside smoothing when using very fine segmentation of values. Consider this when configuring a smoothing. See the example above (a value changes from 0 to 5.001).
Absolute: If the original value changes more than the set absolute value (Absolute value = the check box "Relative value" is not checked), the value passes the smoothing.
Relative: If the original value changes more than the set relative value (Relative value = the check box "Relative value" is checked), the value passes the smoothing.
Time-dependent smoothing
Values during the set tolerance time after the last value are discarded. After the time has elapsed, the next value change passes the smoothing.
When the config entry keepLastTimeSmoothedValue = 1 is set in the [data] section of the config file:
-
If a value changes during the smoothing period, the last value change during the smoothing period is archived if it is different from the last archived value.
-
Any other value changes during the smoothing period are discarded.
In the example below the tolerance time was set to 10 seconds. Value 5 is not archived when the entry is not used (see column "Without entry:Archived:" below). When the entry is used, also the value 5 is archived.
Example:
=======
Time Value Without entry: Archived: With entry: Archived:
0 s 2 2 2
3 s 3 - -
5 s 4 - -
9 s 5 - -
10s 5
future 7 7 7
This feature described above (keepLastTimeSmoothedValue ) only applies to time-dependent smoothing and smoothing periods configured using the "archive" config. In other words the feature only applies to the Archive Smoothing. This feature is deactivated by default and no additional value is archived.
Value AND time-dependent smoothing
Discards all values that arrive within the tolerance time AND are within a specified tolerance range. This means that after the time has elapsed or when the set value (limit) is exceeded within the tolerance time, the value is not smoothed and the value passes the smoothing.
Value OR time-dependent smoothing
Values within the set tolerance time OR within the set tolerance range after the set tolerance time has elapsed are discarded. After the time has elapsed and when the set value (limit) is exceeded, the value passes the smoothing. Thus, BOTH value limits (time and range) must be exceeded via a value to pass the smoothing.
Old/new comparison
Values pass the smoothing only if the value itself or one of the status bits of the variables (of course, the latter only with drivers that provide such bits) changes. For status bits see the description of status bits and smoothing at the end of this chapter.
Old/new AND time-dependent
All variable values that occur within a tolerance time and remain unchanged are suppressed.
This means that after a value change unchanged values do not pass the smoothing during the tolerance time until at least the original value or one of the status bits changes. Thus, if the value changes within the tolerance time, the new value passes the smoothing. The old/new comparison is restricted to the tolerance time. After the end of the tolerance time range, a new value passes the smoothing in any case, even if the value or status is identical to the former value.
Old/new OR time-dependent
Value changes or changes of status are suppressed within the tolerance time (due to the time dependency). After the end of the tolerance time only the old/new comparison is valid. The value changes that occur later only pass the smoothing if either the original value or a status bit changes (due to the old/new comparison). Thus, either the time dependent smoothing OR the old/new comparison is valid.
Depending on the selected smoothing method, description fields are displayed on the right next to the radiobox:
All includes:
the input boxes Seconds and Milliseconds . Enter here the interval within which to suppress values. Enter seconds and milliseconds as integers.
Opens a child panel (shown in the figure below) which allows you to set periods as structured time units (days, hours, minutes…) . Activate Time period in seconds if you prefer this display. The dialog box switches to second/millisecond display.
Deadband: The option deadband is used for value-dependent smoothing. If you check the check box "relative value",a value passes the smoothing when the value is the defined % (percentage value) less or greater than the last valid value. The relative smoothing cannot be used for the mass configuration. For mass configuration the smoothing is absolute. This means that a value passes the smoothing when the specified value for the deadband is 5 and a value changes e.g. from 0 to 5.001.
The precision of the deadband value is restricted to 3 decimal places. This can lead to small rounding differences inside smoothing when using very fine segmentation of values. Consider this when configuring a smoothing.
Increase-dependent
Smoothing panel - increase-dependent
The increase-dependent smoothing corresponds to the value-dependent smoothing with absolute deadband
The deadband can however, be switched depending on the increase.
This means that if the increase is greater than the specified value, the first specified deadband is used. Otherwise the second deadband is used.
The smoothing starts with the second deadband since the increase must be calculated from several values.
In the range where the sine has a minor increase, all values pass the smoothing since the second deadband is 0.
If the increase exceeds the limit 1.4, the deadband is 5. This means that the value must change by more than 5 (for example 5.001) so that it passes the smoothing. See the figure below.
In case of other settings (see the figure below), the range with lower increase is smoothed since the second deadband is 2.
Flicker suppression
With the flicker suppression values are ignored during the set time range after the last value.
Panel SMOOTHING– Flicker suppression
-
If both time and "Perform old/new comparison" are activated, the following applies: Value changes or changes of status are suppressed within the tolerance time (due to the time dependency). After the end of the tolerance time only the old/new comparison is valid. The value changes that occur later are only send to the system/archived if either the original value or a status bit changes (due to the old/new comparison). Thus, either the time dependent smoothing OR the old/new comparison is valid.
-
Time interval ("all"):Allows you to set the tolerance time(seconds/milliseconds). The clock button opens atime intervaldialog where you can se a time interval. If you set a time interval, all values within the set interval are ignored.
Status bits in Smoothing
The following status bits meaning the GQ bit, invalid bit and user bits are included in the smoothing process. This means that values pass the smoothing only if the value itself or one of the these bits of a data point changes. The GQ bit is only included in the driver smoothing.
GQ bit (value from general query):If smoothing mode is set to " always smooth except for the general query" (value is set to 1 in the internal data point _DriverCommon.SM), values with the GQ bit set are never discarded.
Invalid bit (original value is invalid). The original value can be invalid if it was set to invalid via the system or by the user. See the _invalid attribute of the _original config.
For the 32 user bits adjust the config file so that they are taken into account, e.g. user bit 1 and 3 are taken into account for the following entries in the respective driver section (see also smoothBit for more information). Note that if the user bits should be taken into account, the smoothBit entry must be used!
smoothBit = "Userbit 1"
smoothBit = "Userbit 3"
The invalid bit and the user bits are valid for both smoothing categories - driver and archiving smoothing. Note also that the bits are valid for several smoothing types: Tolerance/time-dependent/combined, Value-dependent smoothing,Value AND time-dependent smoothing, Value OR time-dependent smoothing, Old/new comparison, Old/new AND time-dependent, Old/new OR time-dependent, Increase-dependent and Flicker suppression except for the Time-dependent smoothing.