Relational Database(rdbms via odbc) Interface


Example 1.3 – three PI points forming a GROUP



Yüklə 1,66 Mb.
səhifə36/50
tarix07.04.2018
ölçüsü1,66 Mb.
#46960
1   ...   32   33   34   35   36   37   38   39   ...   50

Example 1.3 – three PI points forming a GROUP


SQL Statement
(defined in file PI_INT_GROUP1.SQL)

SELECT PI_TIMESTAMP, PI_VALUE1, 0 ,PI_VALUE2, 0, PI_VALUE3, 0 FROM T1_3 WHERE PI_TIMESTAMP > ? ORDER BY PI_TIMESTAMP ASC;

Relevant PI Point Attributes

Extended Descriptor
(Master Tag)

Location1

(All points)



Location2

(All points)



Location3


Location4

(All points)



Location5

(All points)



P1=TS

1

1

Target_Point1 2
Target_Point2 4
Target_Point3 6

1

0

Instrumenttag

(All Points)



Point Type

Point Source

(All Points)












PI_INT_
GROUP1.SQL

Int32

S










RDBMS Table Design

Table T1_3

PI_TIMESTAMP

PI_VALUEn

Datetime
(MS SQL Server)

Date/Time


(MS Access)

Smallint
(MS SQL Server)

Number (Whole Number)


(MS Access)

Example of an appropriate result-set:

PI_TIMESTAMP PI_VALUE1 PI_VALUE2 PI_VALUE3

20-Oct-2000 08:10:00 10 20 30

20-Oct-2000 08:20:00 11 21 31

20-Oct-2000 08:30:00 12 22 32

Target_Point1 gets 10, 11, 12



Target_Point2 gets 20, 21, 22

Target_Point3 gets 30, 31, 32


Example 1.4 – Tag Distribution


SQL Statement
(defined in file PI_REAL_DISTR1.SQL)

SELECT PI_TIMESTAMP, PI_TAGNAME, PI_VALUE, PI_STATUS FROM T1_4 WHERE PI_TAGNAME LIKE 'Tag%' ORDER BY PI_TMESTAMP, PI_TAGNAME;

Relevant PI Point Attributes

Extended Descriptor

(Distributor)



Location1

(All points)



Location2

(All points)



Location3

Location4

All points



Location5

All points






1

0

'Distributor'
-1

'Target_Point(n)'


0

1

0

Instrumenttag

(Distributor)



Point Type

(Distributor)



Point Source

(All Points)












PI_REAL_DISTR1.SQL

Float32

S










RDBMS Table Design

Table T1_4

PI_TIMESTAMP

PI_VALUE

PI_STATUS

PI_TAGNAME

Datetime
(MS SQL Server)

Date/Time


(MS Access)

Real
MS SQL Server)

Number (Single) Prec.(MS Access)



Varchar(12)
(MS SQL Server)

Text(12)
(MS Access)



Varchar(80)
(MS SQL Server)

Text(80)
MS Access)



Example of an appropriate result-set:

PI_TIMESTAMP PI_TAGNAME PI_VALUE PI_STATUS

20-Oct-2000 08:10:00 Target_Point1 10 NULL

20-Oct-2000 08:10:00 Target_Point2 20 NULL

20-Oct-2000 08:10:00 Target_Point3 30
10 goes to Target_Point1; 20 to Target_Point1; 30 to Target_Point3 …

Note: See also section: Detailed Description of Information the Distributor Tags Store.


Yüklə 1,66 Mb.

Dostları ilə paylaş:
1   ...   32   33   34   35   36   37   38   39   ...   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