I am looking for a way to create Performance Equations through Powershell, any one know if this is possible or if there is another good way to achive this?
This is done through Event=<TriggeringPIPoint> in Exdesc field. The definition is separated by comma from the Equation that is also going into the Exdesc field.
A good way to figure these details out is to use PI Performance Equation builder add-in to PI SMT (Points -> Performance Equations)
Are you intending to
Your question for PowerShell indicates you are looking for a kind of bulk operation. Have you checked if you could use PI Builder?
Please elaborate a bit more detailed on what you like to do. Other users may have had a similar use case and may be able to chime in with some hints and their experience.
I have made scripts for unattended configuration of the PI System for new installations. One of these creates all PI Points as needed in the PI Data Archive. Some of these also include conversion from radiens to degrees using the conversion factor attribute. This works great, but I still need to alter the behavior of some of these to display degrees from -180 to 180 instead of the sensors 0 to 3,14 radian.
Currently we solve this manually by creating a PE like this:
IF ('Gyro1') < 0 THEN -'Gyro1' * 57.295779513 ELSE ('Gyro1' * 57.295779513) *2
Is there a way to use the CmdLet Add-PIPoint to achieve this or do I need another approach?
In case you want to create PI Points to be serviced by PI Performance Equation Scheduler, you can use the PowerShell Tools for the PI System. There is a command called Add-PIPoint that creates a PI Point on the PI Data Archive. In this command there is an input called Attributes which is a hashtable where you define the PI Point attributes. Therefore, it is possible to create PI Performance Equation points as long as the Attributes input is correct. This is the high level overview but I can provide more details about this option if you want to.
If you are not familiar with the PowerShell Tools for the PI System, please refer to this blog post.
Hope it helps!
Hello Marcos and thanks for your answer!
I am trying to find detailed information about the Add-PIPoint CmdLet and the attributes available, do you have a good reference I can look at?
See my answer to Gregor for an explanation of what I am trying to achieve.
You can find the documentation online here: Add-PIPoint
Thanks! Do you know where the possible attributes are described as well?
One way to find them is to lookup in PI-SMT:
And this lists the attributes for the built-in classes: https://livelibrary.osisoft.com/LiveLibrary/content/en/server-v6/GUID-4E8FF925-6D5A-4F53-BA2E-8F1B377EA4E3
Those classes are the same used in piconfig, PI Tag Configurator or PI Builder.....
Now I manage to create new PI Points and PE through the use of the exdesc attribute and Add-PIPoints .
Next challenge is to change the scheduling of these PEs to be event-driven from the instrumenttag with the raw value, any idea?
Good morning and thanks for your help!
I got it running perfectly now, I really like the possibilities the OSIsoft CmdLets are opening up for, allowing us to automatically configure the PI System during our setup.
The best part is if PowerShell Tools for the PI System does not provide a certain functionality you can still use/import PI AF SDK on PS since it is fully compatible with .NET libraries!
Retrieving data ...