Skip to main content
Version: 5.4

... Reading Out a New, Current Data Set?

In the preceding example the current data set from the table or the filtered result was transfered cyclicly. The following shows, how the current data set is transfered just when it´s new, thus when it hasn´t been transfered before. For this you need a second column beside the time stamp column, in which a succeeded data transfer is recorded. This example includes an additional filter (ConfigID used as ID of the test series) and a filter on the column Transfer, to filter just data sets which hasn´t been transfered before. Just as the example before this connection could be realised alternatively as a template/ instance. Shown here is just the simple model.

Required fields/columns:

<Time Stamp>Time stamp from type date/ time, from which is sorted
<Transfer>Column, in which a successfull transfer is shown (type: int, standard value: 0)
ConfigIDID of the test series
<Value>Column(s) with the values of interest

Project a data base transfer object with the following properties:

Data Base Access Data<Your data base access data from the plug in configuration>
TypeSelect

Tab: General

Table<Table, which includes your data>
Available Columns/ Used Columns<All Value Columns>

Tab: Filter

Filter“Add Filter” creates a new filter. You need 2 filters. The connections AND is standard.
Edit Filter/ Filter Group

Column: ConfigID

Compare Operator: EQUAL

Column: Transfer

Compare Operator: EQUAL

PreviewHere should be given out now: WHERE (ConfigID = ? AND Transfer = ?)

Database Select Transfer Object - Filter

Tab: Query

Sorting by Columns<Time Stamp Column>
Sorting OrderDescending (latest value on top)
Reduce number of data sets to1 (just the first data set = just the latest is to be transfered)
Error With Empty Selectdeactivated. If no new, current data set is available, that shouldn´t be counted as an error.
Cancel Transfer with Empty Selectactivated. Nothing is transfered, if no new, current data set is available.

This transfer object thus filters the data from the ConfigID to enter and the transfer code. For the transfer code you have to enter “0”. Create a constant object with:

Required constants

<ConfigID>ID of the test series
0for not transfered data sets

Connect the ConfigID value to the filter detail ConfigID and the 0 to the filter detail Transfer:

Transfer Objects

Project a time trigger, which polls the data base cyclic.

After transferring the OPC Router gives out “1” the column Transfer, with transfer error “2”. In this projecting only the new, current data set is transfered with Transfer = 0.

note

Note: If the data comes into the data table faster, than the time trigger polls, it can happen, that the transfered data set is not current any more, because data sets are left out. Scale the needed precision and the needed ressources from the data base server. For data base server using a notification service you can use a script trigger, which starts the transfer as soon as the information comes from the data base server. But there would be another lag because of the cycle time of the OPC Router (max. 50 ms in the standard setting). If you want to have every data set available, you should read out all data sets, which havn´t been transfered.