Upload
noel-richardson
View
233
Download
1
Tags:
Embed Size (px)
Citation preview
Three Tier Applications using the PI Historian, Microsoft Transaction Server (MTS),
Internet Information Server (IIS), ActiveX Data Objects
(AD0) and ActiveX Controls.
Building DNA Applications Using PI
Microsoft Windows Distributed InterNet Applications (DNA) Architecture can enable clients to interact with PI using a Web Browser.
N-tier PI Historian applications can be developed with Visual Basic, the PI API and COM objects building data active components managed by Microsoft Transaction Server (MTS).
Middle tier applications can send data and receive data using ADO 2.0. Using the PI API, the Historian data can be sent to ADO records sets and then passed to a requesting Client Browser using Active Server Pages and WebClass objects.
Applications can be developed using Microsoft Visual Basic 6.0 and Interdev.
VB Demonstration
Will Demonstrate the development of PI Class objects which interact with PI from n-tier application servers.
Will Demonstrate Web Based Client retrieving PI Server data as ADO Recordset using Active Server Pages.
Will demonstrate the Utilization of Custom ActiveX Controls.
Will demonstrate the IIS vb Application. Build Webclasses to talk to PI and or SQL Server.
MTS will manage n-tier Data Access Components using ADO 2.0 and the PI
API
Using MTS enables the Visual Basic PI Programmer to focus on application functionality.
The key to integrating PI API with n-tier applications is the use of ADO 2.0!
ADO 2.0 enables a programmer the ability to programmatically instantiate a new recordset using the ADO Append Method.
ADO Append Method
Retrieve data from a PI Server using the PI API
The Append method of ADO 2.0 enables returned PI Data arrays to be converted to n-tier recordsets using MST and Active Server Pages.
Automated COM Objects using the PI API communicating with PI Servers utilized ADO methods to interact with OLE DB Databases.
Active Server Pages Call ActiveX Components running within IIS / MTS
Data access component classes are developed as an ActiveX dynamic-link library (DLL) and deployed in the Microsoft Transaction Server (MTS) environment running on Windows NT Server.
VB 6 Enables the programmer to build reusable COM components available which can be utilized within n-tier server architecture.
Reusable objects can include ActiveX Controls custom built to enable reusable client browser applications.
Reusable Class Objects able to communication with PI via the PI API
Reusable Class Objects able to communication with OLE DB datasources such as SLQ Server 7
PI / RDBM S I nterf ace
I nterf ace can be mult iple S ervers and Client A pplicat ions
Client Browser
PI A PI Vb A utomation I nter f ace
A pplicat ion A utomat ion Class O bj ects
PI to SQ L S erver Class O bj ects
PI A PI Class O bj ects
S erver - MT S T ransact ion Server PI H istor ian and
S Q L S erver Data S tores
S erver A pplicat ion Class O bj ects
D at a A c cess Classes
PI A r r ay t o A DO R ecor d set Classes
PI A r r ay Classes - Re t r e ive PI Dat a
S erver PI A PI Logger Class O bj ects
A utomation ClassA u tos ta r tup
L a stv a lid O b je ct T ra nsa ctionS et M o n ito r ing S che du le
M onitor PI ClassA n a lo g V a lue s / D ig i ta l V a lu es
A na log A g greg a te V a lu es
A utomated PI T ag M onitor ingView PI Records f or specifi ed t r igger
Retrieve PI Time as single variant
Public Function DisplayPITime() As VariantDim apistat As LongDim sCurtime As String
' Add this first pitm_parsetime to derive the current value' This will be used later as a relative time in case'the user enters -1d (insted of *-1d)sCurtime = "*"apistat = pitm_parsetime(sCurtime, 0, iRelTime)DisplayPITime = iRelTimeEnd Function
Retrieve PI Array as ADO Record Set
With rs
' Place the trimmed strings into the Collection -
.Fields.Append "PITime", adBSTR, 12
.Fields.Append "PITagVal", adBSTR, 19
.Open
For i = 0 To (iNumVals - 1)
.AddNew
!pitime = sTimesArray(i)
!PITagVal = sValsArray(i)
Next i
End With
PI Time Web Page ActiveX DLL to demonstrate three tier PI Applications run from MTS
IIS Visual Basic Applications can be built to Interact with the PI Historian
and Other Data SourcesDevelop and Debug PI API WEB
Applications in the standard VB IDE Environment
Application runs on IIS Machine.PI Reports and Data EntryConnection to other data sourcesEasy to maintain Web code within
SourceSafe.
IIS Vb Applications running under within IIS
Can use the PI API.Can use ADO 2.0.Utilized ActiveX Controls.Send HTML and script to the client
browser.Enables the development of reusable
components.