Details on RDB Compression

Querying RDB compressions

Compressed values can be queried using the WinCC OA query functions: dpGetPeriod(), dpGetAsynch() (time parameter is ignored) and dpQuery() (with time range). The definition of the compression interval takes place in the detail of the DP identifier (between config and attribute).

The general syntax is:

<system>:<DPE name>:_offline._<compression step>_<compression function>._value

Example of a 10 day average value:

System_1:Pump_1.ControlValue:_offline._10day_avg._value

In one SQL statement only one "_value" config is allowed. That means that when querying compressed values using dpQuery() only one "_value" config can be queried in the same function.

Querying compressions when queryRDBdirect = 0

With the aid of querying the _offline.._compressions attribute the configured RDB compressions can be determined via the dpGetAsynch(), if queryRDBdirect = 0 (no direct read queries to the database). The source time parameter is ignored.

The following queries are possible:

Querying all data point types that have a configured compression

A dpGetAsynch() query with a DpIdentifier in which

  • system,

  • _offline config and

  • _compressions attribute

are set, returns a dynamic unsigned integer with the data point type numbers.

Example:

main()
{
  dyn_int a;
  dpGetAsynch(1963, "System1:_offline.._compressions", a);
  DebugN(a);
}

Querying all data points that have a configured compression

A dpGetAsynch() query with a DpIdentifier in which

  • system,

  • data point type,

  • _offline config and

  • _compressions attribute

are set, returns a dynamic unsigned integer with the data point numbers.

Example:

main()
{
  dyn_int a;
  dpGetAsynch(1963, "System1:Valve.:_offline.._compressions",a);
  DebugN(a);
}

Querying all data point elements of a data point, which have a configured compression

A dpGetAsynch() query with a DpIdentifier in which

  • system,

  • data point type,

  • data point,

  • _offline config and

  • _compressions attribute

are set, returns a dynamic unsigned integer with the data point element numbers.

Example:

main()
{
  dyn_int a;
  dpGetAsynch(1963,
  "System1:Valve.Valve1:_offline.._compressions", a);
  DebugN(a);
}

Querying of all configured compressions of a data point element

A dpGetAsynch() query with a DpIdentifier in which

  • system,

  • data point type,

  • data point,

  • data point element

  • _offline config and

  • _compressions attribute

are set, returns a dynamic unsigned integer with <superDetail, detail>.

The lower 16 bits are the compression step (detail). The upper 16 bits are the compression step used for calculation of its own compression (superDetail).

Example:

A _3day_avg compression step is calculated on the base of a _5min_avg compression step. Then, there is the superDetail number of _5min_avg in the upper 16 bits and the detail number of _3day_avg in the lower 16 bits.

Oracle Jobs

The control of interval calculations is carried out using jobs. Per interval (e.g. 5 hour) an individual job exists that calculates the compression steps and functions, which belong to this interval.

The control of the jobs is carried out by the Oracle Job Scheduler.

Interval Jobs

With each new compression interval a new job for the interval is created. This controls the start of the calculation cycles. The number of jobs must equal to the number of intervals. For further details see CSINTERVAL table.

Each job is started with a delay against "its" interval (see JOBDELAY column in the CSINTERVAL table).

Before an interval calculation can be carried out effectively after the start, the following requirement must be met ("timely synchronization with shorter intervals"):

An interval calculation is carried out only if the last calculation (LASTCALC, CSINTERVAL table) of all shorter intervals (see SIZE_ORDER in CSINTERVAL table) lies behind the calculated end time of the current interval. This is necessary as the calculation of larger intervals is based on the data of shorter intervals (see CSHISTORY_xy, CSCALCULATION and CSSTEP tables).