Direct read functions

The CONTROL RDB read functions described in this section are used to read history alerts and events from the connected RDB.

You can access the RDB directly using specific CONTROL RDB read functions, that is, you can read data directly from the RDB.

The WinCC OA client (UI, CONTROL) has a direct connection and communication to the RDB, no matter whether the RDB Archive Manager is running or not. The CONTROL RDB functions are implemented in a separate DLL, therefore, the DLL must also be loaded for the Managers you want to use it in.

For details on activating the read functions, refer to Possible config entries for RDB archiving under "queryRDBdirect". If you are using the normal WinCC OA read functions (without RDB suffix), they are redirected to the RDB via the direct read functions (if the necessary entries are set in the config file).

The advantage of using the RDB read functions is the shorter data flow (queries go straight to the RDB and not via the Event, Data and RDB Manager).

Additionally, there are own APM query functions which can be used to query another RDB database. The functions use the DPE name instead of the element ID for the query. The functions can be used to query data of another RDB database. Note that you have to use APM specific config entries like APMDbUser, see chapter Possible config entries for RDB archiving.

Note:

To improve performance with historical alert queries (Alert Screen) you can limit the number of additional values (_add_value) of alerts that are queried. This does not affect or limit the number of additional values that are stored.

To specify the maximum number of additional values to be queried, set the parameter "max_add_value" to a value from 1 to 32 in the ARC_CONFIG table. Values outside the range 1 to 32 are ignored. If the _add_values ​​are not queried, these views are not used. By default all 32 default values will be queried.

CTRL RDB read functions

The length of string values that can be written to the database is limited to 4000 characters.

If several queries are executed in the UI, a thread is started per query via queryRDBdirect. All threads share the same DB connection. When the UI is closed, the currently active query should be closed too. The UI displays the message 'Database query has been cancelled'. The system, however, waits until the query has been executed before closing the connection.

System wide queries with different schemas work solely when "queryRDBdirect = 1" has been set.

CTRL RDB read functions Original WinCC OA read functions
alertGetPeriodRDB() alertGetPeriod()
dpGetAsynchRDB() dpGetAsynch()
dpGetPeriodRDB() dpGetPeriod()
dpQueryRDB() dpQuery()
dpGetPeriodAPM dpGetPeriod()
dpQueryAPM dpQuery()
alertGetPeriodAPM alertGetPeriod()
dpGetAsynchAPM dpGetAsynch()

The specific RDB functions support the same parameters as the standard WinCC OA functions. Only the differences are detailed below.

The speed of the dpGetPeriod was increased in the version 3.7. The query is now much faster. To use the improved dpGetPeriod, execute a database update by running the and the RDB_packages.sql scripts. The scripts are located in the <wincc_oa_path>/data/RDBSetup/ora directory.

alertGetPeriodRDB()

Parameter: The same parameters as explained in the alertGetPeriod() function. The alert timestamp in the RDB is always different and thus the counts parameter always returns 0.

Description: This function is used to read history alert attributes (alert1, alert2, ...) for which there are alerts in the connected RDB in the period between t1 and t2.

dpGetAsynchRDB()

Parameter: The same parameters as explained in the dpGetAsynch() function.

Description: This function is used to read history data point attributes (dp1, dp2, ...) from the connected RDB at a certain source time t1.

dpGetPeriodRDB()

Parameter: The same parameters as explained in the dpGetPeriod() function.

Description: This function is used to query history data point attributes (dp1, dp2, ...) from the connected RDB over a certain period t1 to t2.

dpQueryRDB()

Parameter: The same parameters as explained in the dpQuery() function.

Description: Retrieves attribute values from the connected RDB with the help of SQL statements.

The following specific WinCC OA attributes are not supported:

_KF (Config)

_DT (Detail)

_AT (Attribute)

If you query them anyway, an error message indicates that the query was not completed. You can query all attributes for events.

For alerts, you can query all attributes listed in the table under Description of tables and views. In addition, you can query all attributes coded in the _state attribute.

dpGetPeriodAPM

The same parameters as in the function dpGetPeriod().

dpQueryAPM

The same parameters as in the function dpQuery().

alertGetPeriodAPM

The same parameters as in the function alertGetPeriod().

dpGetAsynchAPM

The same parameters as in the function dpGetAsynch().

SQL Query Functions

The SQL query functions can be used to query the RDB database via SQL.

runRealSQL()

runRealSQLQuery()