Example 3.7 – Event Based Input
səhifə 43/50 tarix 07.04.2018 ölçüsü 1,66 Mb. #46960
SQL Statement
(file PI_EVENT.SQL)
SELECT PI_TIMESTAMP, PI_VALUE, PI_STATUS FROM T3_7;
Relevant PI Point Attributes
Extended
Descriptor
Location1
Location2
Location3
Location4
Location5
/EVENT=sinusoid
1
0
0
Not evaluated
0
InstrumentTag
Point Type
Point Source
PI_EVENT.SQL
String
S
RDBMS Table Design
Table T3_7
PI_TIMESTAMP
PI_VALUE
PI_STATUS
Datetime
(MS SQL Server)
Date/Time
(MS Access)
Varchar(1000)
(MS SQL Server)
Text(255)
(MS Access)
Smallint
(MS SQL Server)
Byte
(MS Access)
Example 3.8 – Multi Statement Query
SQL Statement
(file PI_MULTI.SQL)
INSERT INTO T3_8 (PI_TIMESTAMP, PI_VALUE, PI_STATUS) VALUES (?, ?, ?);
DELETE FROM T3_8 WHERE PI_TIMESTAMP < ?;
Relevant PI Point Attributes
Extended Descriptor
Location1
Location2
Location3
Location4
Location5
P1=TS
P2=VL
P3=SS_I
P4=TS
1
0
0
0
0
InstrumentTag
Point Type
Source Tag
Point Source
PI_MULTI.SQL
Float32
SINUSOID
S
RDBMS Table Design
Table T3_8
PI_TIMESTAMP
PI_VALUE
PI_STATUS
Datetime (MS SQL Server)
Date/Time (MS Access)
SmallInt (MS SQL Server)
Number-Whole Number (MS Access)
Smallint (MS SQL Server)
Number Single Precision (MS Access)
SQL Statement
{CALL SP_T3_9(?,?)};
Stored procedure definition
CREATE PROCEDURE SP3_9 @Start_Time DateTime, @End_Time DateTime AS
SELECT PI_TIMESTAMP,PI_VALUE,PI_STATUS FROM T3_9 WHERE PI_TIMESTAMP BETWEEN @Start_Time AND @End_Time
Relevant PI Point Attributes
Extended Descriptor
Location1
Location2
Location3
Location4
Location5
/SQL=
"{CALL SP3_9(?,?)};"
P1=LST P2=ST
1
1
0
1
0
InstrumentTag
Point Type
Point Source
Float16
S
RDBMS Table Design
Table T3_9
PI_TIMESTAMP
PI_VALUE
PI_STATUS
Datetime
(MS SQL Server)
Real
(MS SQL Server)
Smallint
(MS SQL Server)
Dostları ilə paylaş: