Skip navigation
All Places > PI Developers Club > Blog > Author: Ahmad Fattahi
1 2 3 4 Previous Next

PI Developers Club

60 Posts authored by: Ahmad Fattahi Employee

OSIsoft Users' Conference 2011 is over. It was our most-attended conference ever. At the same time we celebrated the 30th anniversary of the PI System! We entertained about 1300 attendees and got representation from 86 countries!


As for our Community, we had a presentation, a lunch gathering, as well as a product booth. Thanks everyone for attending our events; it was great to see you all in person! We discussed several different ideas and received great feedback from the attendees.


It was extremely heart-warming to see how much value our fellow community members are getting out of vCampus. Besides, we received invaluable suggestions from the attendees. We are constantly working to get better. Share your feedbacks and ideas with us on the forums or via email.


You will be able to watch the presentation as soon as they are processed and posted to the OSIsoft UC page. See you all online and in our future events!

Ahmad Fattahi

Happy PI Day!

Posted by Ahmad Fattahi Employee Mar 14, 2011



Today is March 14 or 3/14, hence PI day! Happy PI day to all PI Community including our beloved OSIsoft vCampus.


thinking about PI, I couldn't resist revisiting this beautiful equation, known as the Euler's formula. The equation is:


e ^ ( i * pi) + 1 = 0


You may ask "Where is the beauty?" Well:

  • e is the base of the Natural Logarithm whose roots go back to the integral of the function y = 1 / x.
  • i is the imaginary unit; as you know i = sqrt (-1).
  • pi is the irrational number which is the ratio of every circle's perimeter to its diameter.
  • 1 is the multiplicative identity hence pretty fundamental in calculus.
  • 0 is the additive identity hence pretty fundamental in calculus.

As you see all these numbers come from very different backgrounds and is each very fundamental in its own turn. The Euler's equation bonds all of them together in a very basic way.


Some geeks call this "the most beautiful equation in mathematics"!

Ahmad Fattahi

Microsoft-Nokia deal

Posted by Ahmad Fattahi Employee Feb 16, 2011

The news broke last Friday that Microsoft and Nokia agreed on a partnership mainly focusing on developing smart phones. Everybody knew that Nokia was somehow struggling to catch up with the smart phone crowd. Also, Microsoft claims only a small portion of the smart phone market at this time.


This is important for us the PI community; sooner or later we will see more mobile apps developed for PI users. iPhone and Android are currently more ubiquitous but Windows platform meshes much more easily with the PI infrastructure. Which platform would you choose for development today?


Also, what do you think of the deal? Will this resurrect Nokia and help Microsoft find its footing in the smart phone market? Or you believe there is little chance the deal boosts Windows phone?

Ahmad Fattahi

Smart Phone Apps

Posted by Ahmad Fattahi Employee Jan 19, 2011

Smart phones and tablets are getting ubiquitous. In light of this thread and many more similar discussions, I would like to know what our vCampus Community thinks about the need, value, and considerations this topic deserves. The specific questions are as follows:

  • Do you see a strong need in your industry for having custom smart phone applications? If yes, what are those needs? Some examples are trending and Notifications on a smart phone.
  • Who do you see best fit to render this task? Do you think OSIsoft should develop such applications? Or otherwise, given the smaller nature of such products, 3rd party developers and organizations would be better solutions?


Ahmad Fattahi

Generations online 2010

Posted by Ahmad Fattahi Employee Dec 16, 2010

We are close to the end of the year. Let's take a look back and see how people are using Internet these days and how it would compare with last year. According to a recent research by "Pew Internet" email and social media (read vCampus ) usage is moving up while blogging (ironic!) and virtual world usage has been going down. Here are some key points:

  • Email usage is ubiquitous across all age groups
  • Social media and networking has been getting more and more popular (thanks to Facebook and Twitter)
  • Blogs are losing ground

You can see a short overview and analysis of the report here as well.





Ahmad Fattahi

On Users' Communities

Posted by Ahmad Fattahi Employee Dec 8, 2010

We have been having a good time in OSIsoft vCampus Community for the past two years. Thanks to every single community member (read "you"!) who has made OSIsoft vCampus a vibrant and progressive "developers' community".


Now that our beloved vCampus is beyond infancy, we can start thinking about a parallel and complementary world. Once in a while we see questions and comments in the forums where we need some feedback and/or exposure from end-users of our products as developers. This brings me to the main point of this post.


What do you think of creating a parallel universe in the virtual world in which end users and PI System administrators get to participate, respond to inquiries, bring up their concerns, and get exposure to the world of developers? Would that be of interest to our community? How do you think the relationship between the two should be? Would it help nourish vCampus as the provider of solutions to the actual end users? Do you see it as a win-win for developers and end users? Isn't it time to bring end users and PI System administrators with similar strategic interests under one umbrella, as OSIsoft vCampus has done for PI developers community?


Please share your thoughts!

25 Years ago Microsoft released its first version of then-GUI Windows 1.0. I let you enjoy a screenshot of how it looked back then and compare it with where we are standing right now!


No question how instrumental Windows has been in the ubiquity of Personal Computers. I'm not old enough to remember but I've heard when OSIsoft was making the decision to provide PI for PCs, many people in the industry thought that would be an absolute waste as "the PCs are just toys" and "no one is going to use toys in a plant"!


To read more on the history of Windows see this nice article.



Have you ever desired to know what is a most likely trajectory your tag is going to follow? Ever wanted to be able to predict which way an equipment's temperature or pressure is moving based on what you have seen in the past several hours? How about ability to predict when an equipment is likely to fail? If so, you may be interested in this post. This is a sequel to my previous post on combining PI and R.


Our goal here is to write a script in R that reads PI data and makes some projections into the future. Here is how I'm composing the story: we collect PI data from a single tag into a flat text file. We can do this in several ways such as using PI DataLink or piconfig scripting. Then we read the values and timestamps from the file into R in the form of two vectors (I have added some noise to the values to make the situation more realistic). Note that R doesn't like commas; so different entries are separated either by space or end-of-line character.


The next step is to make a regression to best model the values as a function of time. I have used a 3rd degree polynomial. The degree is arbitrary and should be chosen to best represent the physical model. The blue part of the resulting graph shows the real events in dots and the continuous line shows the regression model.


The next step is to put this whole thing to a test. The green part of the graph is the prediction. Some more events are read from PI which have not been used to make the regression. Those are plotted against what the regression model is predicting. Note how closely the model follows the data; but of course as we get farther in time the quality of the predictor deteriorates.


This is a predictor based on a polynomial regression. There are many other ways to make such models. My goal here is to showcase one example of how effectively and simply PI and R could be combined to create such predictive models. The other stressing point is the performance. The whole procedure finishes in a blink of an eye on my humbly light-weight laptop  Please find attached the R script along with the flat file containing PI data.





Ahmad Fattahi

PI in the Post-PC era?

Posted by Ahmad Fattahi Employee Oct 26, 2010

Microsoft's chief architect, Ray Ozzie, just released this memo about the world after PCs. In a nutshell it signifies the fact that a lot of activities in the software world will be shifted to the Cloud and will be offered as a service. He calls it the dawn of a new day.


OSIsoft does offer its Network Operating Center (NOC) services to its enterprise customers to monitor their PI System on the web 24/7. That is the closest we have come to offering a web-based service to our customers. There is a long gap between this and a full-fledged Cloud-based PI System.


As the community on the cutting edge of PI development and integration, what do you think of offering PI as a service in the Cloud? What are the potential opportunities? How about the challenges? What would it take to win the trust of customers to let someone else host their PI System? How would you envision the interaction between the PI System and data sources in the plants? Would it provide a good opportunity for our partners? Share your ideas with us.

R is an open source programming language and software environment specialized in statistical analysis, programming, and graphics. It provides lots of powerful analytical tools for statistical purposes. We, the PI professionals, deal with huge amounts of data on a constant basis. Therefore, it seems like a natural quest to have some statistical tool for analyzing and extracting statistically valuable information from data stored in PI.


This post is a first attempt to get us all familiarized with R and how we can link that with PI data. To keep things simple we use an add-in to Microsoft Excel called RExcel that brings in R capabilities inside Microsoft Excel. From that point on we use PI DataLink to bring in PI data and perform our statistical operations on them using RExcel. Later on we will see other ways to connect PI with R.


What you would need to do is to download and install R and RExcel. You can access the documentation here. Then you can use the Excel sheet attached to this post. The only change you need to do is pointing PI DataLink to your PI server as opposed to mine in the “Values” column. It is made as a self-explanatory first step on how you can perform some basic statistical operations on PI data (obviously you need PI DataLink to bring in PI data).


The operations include mean value, variance, linear regression, and regression analysis along with some plotting of the regression. Some of these features may be possible through MS Excel itself; however, once we know how to use R we will see that the features will surpass MS Excel pretty fast. You are all set and ready to go; good luck and have fun!



Ahmad Fattahi

Got Energy?!

Posted by Ahmad Fattahi Employee Oct 6, 2010

Hello everyone! The great OSIsoft vCampus community is making several lively and vivacious moves in different fronts.


We are about to kick off two very exciting Community Projects very soon. One talks extensively about using PI for StreamInsight through several examples; this is being offered by GregDouglas. The other one creates a matrix view add-in to PI ProcessBook and is being done by wpurrer .


There is at least one more proposal on the table that concerns predictive analytics and preemptive maintenance. We will make its announcements in due time.


If you have any interesting ideas in the form of a project that you would like to share with the community drop us a line or start a discussion thread in the forums so we can get the ball rolling fast


Also, there is this interesting discussion thread started by Kenneth Rice on ways to address everybody's questions faster and more efficiently in the community. Either if you are a newbie to PI development and OSIsoft vCampus or a seasoned PI developer you may need to know where to look for certain information in vCampus. Please cast your ideas on the thread and share what you think is the best way to get everyone up to speed.

OK it’s time to revisit the “diet problem” we saw in my earlier post in more detail. The first thing to do is to add the Solver add-in to Microsoft Excel to use it. It is shipped as part of Microsoft Excel but may not be added by default.


The next step is to build up the problem set up. We need to dedicate a cell to every variable in the problem. In this example every price, limit, quantity, or decision variable has to have its own cell on the data sheet. So, we allocate 2 cells to the decision variables, being the units of each mineral purchased, and units of each substance in the two minerals. We also need to know how much of each substance we currently have. These are calculated as a function of the two previous quantities, i.e., units of each mineral times the amount each mineral contains, all summed up for the two minerals.


We also create cells for the minimum levels of the substances as well as the minerals (not to go below zero!). The objective function, i.e. the cost, is defined as a function of the prices and units purchased very easily.


A key point here is that any of these parameters can come from a PI server through PI DataLink. In fact, I have decided to get the unit mineral prices from PI. You would need to change those two cells to point to your PI server before you can use the attached file. But in general the amount of each substance in each mineral or the grades or even the constraint limits could come from a PI server.


When everything is set up we choose the “Data” tab on Excel and choose “Solver”. All the steps to define the problem for the optimization engine are very intuitive at this point. The only explanation is regarding the algorithms used. Since this is a linear optimization program, a Simplex LP would suffice. However, for nonlinear or non-smooth programs, which are more complicated, GRG Nonlinear or Evolutionary methods are also provided. Once you click on “Solve” you will have the optimal results on your Excel sheet in a matter of seconds!








Don't forget to make the PI server references point to your PI server on the Excel sheet.

Our annual in-depth PI Technology event is already behind us. During the event tremendous amounts of valuable information was exchanged around so many geeky talks. A quick recap of the event:

  • 24 presentations - divided into 2 tracks within the 2 days
  • A New 'Vox Pop' open session - where top 5 topics of interest voted by the attendees were opened for discussion
  • Technology Roundtables - Attendees could corner Lead Developers and Product Managers (well, we helped them a bit...) to get all their questions answered
  • Live! Pub - Drink, eat and play games with their peers and many OSIsoft employees

The OSIsoft vCampus Team would also like to take this chance to thank the members who  participated and contributed to the event, be it providing feedback and suggestions on the Discussion Forum, or taking the time to prepare and present in OSIsoft vCampus Live! 2010. We definitely appreciate your contributions to make this event a success.


During OSIsoft vCampus Live! 2009 we announced the OSIsoft vCampus All-Stars program, to recognize outstanding contributions of three community members. They devoted significant time and effort to contribute and share information on OSIsoft vCampus and helping hundreds of other fellow OSIsoft vCampus members. We proudly announced 3 All-Stars for 2010:

Congratulations and thanks to our 2010 All-Stars! Looking forward to seeing them run their own blogs soon. Are you ready to be a 2011 all-star? The field is all yours!


Now that OSIsoft vCampus Live! 2010 is behind us, we look forward to the 2011 event. The dates and venue for OSIsoft vCampus Live! 2011 are already confirmed to be the week of September 12th, 2011 at the Palace Hotel in San Francisco. Mark your calendars now!!!


Once again, this event is dedicated to you as a member of OSIsoft vCampus community. Get involved in OSIsoft vCampus Live! 2011 and make it YOUR event. OSIsoft vCampus Live! 2010 was a great event with lots of improvements from 2009, but with your help we can make it even better! Let's start discussing the 2011 event by sharing your feedback and suggestions: please do not hesitate to start a discussion thread on the "Generic vCampus Discussions" forum, or email your input to us at The earlier we hear from you, the better you'll make OSIsoft vCampus Live! 2011!



Yes! OSIsoft vCampus Live! 2010, our second one in the Live! series, is almost over now; it was quite an excitement. A lot of exciting material with so many interesting people to hang out with... hard to miss!






Good thing is that OSIsoft vCampus Live! 2011 version is already scheduled in the same venue and almost the same dates: September 12 and 13, 2011 San Francisco Palace hotel. It will be here sooner than we realize; so mark your calendars today!








One of the major points of interest this year was the "Community Projects". These are spaces specifically defined around a project for a community member, like you, who is interested in working on a project and get feedback from other vCampus members. You would get to show your progress, post your successes as well as challenges, and essentially use this space as an active diary of your project. So, if you have any interesting ideas or questions don't hesitate to contact us at to discuss creating your own dedicated project space.





Imagine a production environment where there are three substances A, B, and C necessary for production. These three substances come from two minerals to be purchased at variable going price of the market. This price is provided by PI in real time through PI DataLink. Each mineral contains some different levels of the substances in it. We have to meet some minimum levels of each substance for the production to go forward.




The goal is to minimize the total cost while meeting the constraints. The decision  factors are how many units of each mineral we buy.












This kind of problems, and many many more, can be very effficiently solved in real time using PI DataLink and Microsoft Excel. To see exactly how we can solve such interesting optimization problems and much more come see my presentation at OSIsoft vCampus Live! 2010 titled "Intergrating the PI System with Third-Party Analytics" on Tuesday Septmber 14, 2010. The registration is now open!








PS: This problem is also known as the "diet problem" where we need to receive certain levels of different nutrients while minimizing the cost by choosing our diet basket properly.













Filter Blog

By date: By tag: