Update tags from more rows in table considering just the newer timestamps since the last scan (distribution by alias) without the /RBO startup parameter set
- Last UpdatedNov 18, 2022
- 1 minute read
- PI System
- Interfaces
Update tags from more rows in table considering just the newer timestamps since the last scan (distribution by alias) without the /RBO startup parameter set
In this example, the database table includes a column (alias) specifying the PI point
that is to be updated with the value. In the ExDesc of each target point, there is the /ALIAS=alias keyword defined.
SELECT timestamp,
alias,
value,
status
FROM table6
WHERE timestamp > GETDATE() - 1./24. AND key1 LIKE 'Tank1' ORDER BY alias,
timestamp;
Configure the target PI point with the following settings:
|
Point Attribute |
Description |
Setting |
|---|---|---|
|
ExDesc |
Placeholders and options |
Target points: /ALIAS=T1_Temp /ALIAS=T1_Press /ALIAS=T1_Lev |
|
Location2 |
First row/all rows |
N/A for distribution |
|
Location3 |
Data distribution strategy |
Distributor point: -1 Target points: 0 |
|
Location4 |
Scan class |
1 |
|
Location5 |
Exception reporting |
Distributor tag: 1 Target points: 3 |
|
InstrumentTag |
Name of the SQL file |
Example6.SQL |
|
PointType |
Data type of PI points |
Float32 |
In the RDBMS, create a table formatted as follows:
|
Column name |
SQL Server data type |
|---|---|
|
timestamp |
DateTime |
|
value |
Real |
|
status |
Smallint |
|
alias, key1 |
Varchar(255) |
Example result set
|
timestamp |
alias |
value |
status |
|---|---|---|---|
|
20-Oct-2015 08:15:00 |
T1_Temp |
42 |
NULL |
|
20-Oct-2015 08:15:00 |
T1_Press |
20 |
NULL |
|
20-Oct-2015 08:15:00 |
T1_Lev |
300 |
NULL |
Given this result set, the interface assigns values to PI points as follows:
|
Point |
Value assigned |
|---|---|
|
Tank1_Temperature |
42 |
|
Tank1_Pressure |
20 |
|
Tank1_Level |
300 |