Example 3.3 – Tag Group, Arbitrary Column Position – Aliases
səhifə 40/50 tarix 07.04.2018 ölçüsü 1,66 Mb. #46960
Example 3.3 – Tag Group , Arbitrary Column Position – Aliases
SQL Statement
(file PI_GR2.SQL)
SELECT PI_TIMESTAMP, PI_VALUE1, PI_VALUE2, PI_STATUS1=0, PI_STATUS2=0 FROM T3_3 WHERE PI_TIMESTAMP > ? ORDER BY PI_TIMESTAMP ASC;
or
SELECT PI_TIMESTAMP, VALUE1 AS PI_VALUE1, VALUE2 AS PI_VALUE2, 0 AS PI_STATUS1, 0 AS PI_STATUS2 FROM T3_3 WHERE PI_TIMESTAMP > ? ORDER BY PI_TIMESTAMP ASC;
Relevant PI Point Attributes
Tag
Instrument
tag
Extended Descriptor
Location1
Location2
Location3
Location4
Target_Point1
PI_GR2.SQL
P1=TS
1
1
1
1
Target_Point2
PI_GR2.SQL
1
1
2
1
RDBMS Table Data
Table T3_3
PI_TIMESTAMP
PI_VALUE1
PI_VALUE2
20-Oct-2000 08:10:00
1.123
4.567
20-Oct-2000 08:10:10
2.124
5.568
20-Oct-2000 08:10:20
3.125
6.569
20-Oct-2000 08:10:30
4.126
7.570
Values selected in column PI_VALUE1 go to Target_Point1
Values selected in column PI_VALUE2 go to Target_Point2
SQL Statement
(file PI_DIST1.SQL)
SELECT PI_TIME, PI_TAGNAME, PI_VALUE, 0 FROM T3_4a WHERE PI_TIME > ? ORDER BY PI_TIME;
Relevant PI Point Attributes
Tag
Instrument
tag
Ext. Desc.
Location1
Location2
Location3
Location4
Tag1
PI_DIST1.SQL
P1=LST
1
-1
1
Tag2
1
1
Tag3
1
1
Tag4
1
1
RDBMS Table Data
Table T3_4a
PI_TIME
PI_TAGNAME
PI_VALUE
20-Oct-2000 08:10:00
Tag1
4.567
20-Oct-2000 08:10:10
Tag2
5.568
20-Oct-2000 08:10:20
Tag3
6.569
Example 3.4b – Tag Distribution, Search According to Tag's ALIAS Name
SQL Statement
(file PI_DIST2.SQL)
SELECT TIME, PI_ALIAS, VALUE,0 FROM T3_4b WHERE TIME > ?;
Relevant PI Point Attributes
Tag
Instrument
tag
Extended Descriptor
Location1
Location3
Location4
Tag1
PI_DIST2.SQL
P1=TS
1
-1
1
Tag2
/ALIAS=Valve1
1
1
Tag3
/ALIAS=Valve2
1
1
Tag4
/ALIAS=Valve3
1
1
RDBMS Table Data
Table T3_4b
Time
PI_Alias
Value
20-Oct-2000 08:10:00
Valve1
"Open"
20-Oct-2000 08:10:00
Valve2
"Closed"
20-Oct-2000 08:10:00
Valve3
"N/A"
Dostları ilə paylaş: