Tag Archives: pi system

Read and Write A Tag Value From PI-Server Using PI-SDK Through VBA (Visual Basic)

13 Mar

Reading a tag value from PI-Server

Private Function TargetValue()
Dim valueRet As String
Dim srv As Server
Dim dt As New PITimeFormat
Dim pt As PIPoint

Dim MYPIServer As PISDK.Servers
Set srv = PISDK.Servers.DefaultServer

TargetValue = srv.PIPoints(“Target”).Data.Snapshot

‘ Target is the tag name here.
End Function

Writing a tag value to PI-Server

‘***************************Writing into Target Tag****************************
Private Sub WriteTargetInstructionPI()
Dim srv As Server
Dim dt As New PITimeFormat
Dim pt As PIPoint

Dim MYPIServer As PISDK.Servers
Set srv = PISDK.Servers.DefaultServer

TagName = “Target”
Set pt = srv.PIPoints(TagName) ‘ it’s your PI point

dt.InputString = “*”        ‘it’s data. InputString – Converting String in PIdata format

pt.Data.UpdateValue TextBoxTarget.Text, dt, dmReplaceDuplicates ‘function for Update (reed help)

End Sub


Note: I have used Sub for writing the tag value and Function for reading tag value for my own business logic. You can use either Function or Sub according to your own requirements.

What is PI Server?

2 Nov

Much of this information is copied from OSI Soft

Business Challenge: Where PI Server is used?

Process-focused manufacturing companies produce copious amounts of data from a wide variety of sources throughout their operations. Usually data of plants like you have installed boilers, chillers etc. Plant managers and business executives need to have access to this information, in a meaningful and practical format, so they can direct operations toward best profitability and
productivity, and conduct effective business planning. Information aggregation from a multitude of sources manually or through custom programming can be costly and slow to deliver business value. E.g previously this process was manual. Plant manger manually collect the reading and then process. Important thing here is that process was manual i,e done by the humans.

Companies need to find a way to unify the streams of information from many sources into a single, comprehensive system that lets them accomplish their business goals as they manage their operation to achieve the highest levels of performance
and productivity.

PI Server: What it is?

The PI Server™ is the real-time data collection, archiving and distribution engine that powers the PI System™. The PI Server brings all relevant data from your many disparate sources into a single system, secures it so appropriate access is given to individuals based on their roles and delivers it to users at all levels of the company in a uniform and consistent manner. The PI Server optimizes data storage to provide needed fidelity while delivering data instantly. As a result, users have a comprehensive real-time and historical
view into operational, IT infrastructure and business activities enabling them to make timely and profitable decisions.