|
Example 2.1d – insert sinusoid values with (string) annotations into RDB table (event based)
|
səhifə | 39/50 | tarix | 07.04.2018 | ölçüsü | 1,66 Mb. | | #46960 |
| Example 2.1d – insert sinusoid values with (string) annotations into RDB table (event based)
SQL Statement
(file PI_ANNO2.SQL)
|
INSERT INTO T2_1d (time, value, annotation) VALUES (?,?,?);
|
Relevant PI Point Attributes
|
Extended Descriptor
|
Location1
|
Location2
|
Location3
|
Location4
|
Location5
|
P1=TS
P2=VL P3=ANN_C
|
1
|
0
|
0
|
0
|
0
|
Instrumenttag
|
Point Type
|
Source Tag
|
Point Source
|
|
|
PI_ANNO2.SQL
|
Float32
|
SINUSOID
|
S
|
|
|
RDBMS Table Design
|
Table T2_1d
|
TIME
|
VALUE
|
ANNOTATION
|
Datetime (MS SQL Server)
Date/Time
(MS Access)
|
Real
(MS SQL Server)
Number-Single Precision
(MS Access)
|
Varchar(255)
(MS SQL Server)
Text(50)
(MS Access)
| Example 3.1 – Field Name Aliases
SQL Statement
(defined in file PI_STRING2.SQL)
|
SELECT VALIDITY AS PI_STATUS, SCAN_TIME AS PI_TIMESTAMP, VOLUME AS PI_VALUE FROM T3_1 WHERE KEY_VALUE = ?;
|
Relevant PI Point Attributes
|
Extended Descriptor
|
Location1
|
Location2
|
Location3
|
Location4
|
Location5
|
P1="Key_1234"
|
1
|
0
|
0
|
1
|
0
|
Instrumenttag
|
Point Type
|
Point Source
|
|
|
|
PI_STRING2.SQL
|
String
|
S
|
|
|
|
RDBMS Table Design
|
Table T3_1
|
SCAN_TIME
|
VOLUME
|
VALIDITY
|
KEY_VALUE
|
Datetime
(MS SQL Server)
Date/Time
(MS Access)
|
Varchar(1000) (MS SQL Server)
Text(255) (MS Access)
|
Smallint (MS SQL Server)
Whole Number
(MS Access)
|
Varchar(50) (MS SQL Server)
Text(50) (MS Access)
|
SQL Statement
(file PI_GR1.SQL)
|
SELECT Time0, VALUE1, 0, VALUE2, 0 FROM T3_2 WHERE Time0 > ?;
|
Relevant PI Point Attributes
|
Tag
|
Instrument
Tag
|
Extended Desc.
|
Location1
|
Location2
|
Location3
|
Location4
|
Target_Point1
|
PI_GR1.SQL
|
P1=TS
|
1
|
1
|
2
|
1
|
Target_Point2
|
PI_GR1.SQL
|
|
1
|
1
|
4
|
1
|
RDBMS Table Data
|
Table T3_2
|
Time0
|
Value1
|
Value2
|
20-Oct-2000 08:10:00
|
1.123
|
"String1"
|
20-Oct-2000 08:10:10
|
2.124
|
"String2"
|
20-Oct-2000 08:10:20
|
3.125
|
"String3"
|
20-Oct-2000 08:10:30
|
4.126
|
"String4"
|
Values selected in column Value1 go to Target_Point1
Values selected in column Value2 go to Target_Point2
Dostları ilə paylaş: |
|
|