Relational Database(rdbms via odbc) Interface


Example 3.7 – Event Based Input



Yüklə 1,66 Mb.
səhifə43/50
tarix07.04.2018
ölçüsü1,66 Mb.
#46960
1   ...   39   40   41   42   43   44   45   46   ...   50

Example 3.7 – Event Based Input


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)


Example 3.9 – Stored Procedure Call


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)

Yüklə 1,66 Mb.

Dostları ilə paylaş:
1   ...   39   40   41   42   43   44   45   46   ...   50




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin