---
schema_version: "1"
id: cc32cbda08da1ca802f39ddbcd5cb430612ff5f1cc730b81ea3679008655495e
title: OSISoft PI Setup Guide for Productive Maintenance
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/manufacturing/latest/osisoft-pi-setup-guide.md
canonical_url: https://docs.mulesoft.com/manufacturing/latest/osisoft-pi-setup-guide
source_site: docs.mulesoft.com
content_type: documentation
content_hash: d4524f279a6e430fcb396ab89605a2fce9bb0e4af7477d643d1ec26955adf117
description: MuleSoft Documentation Site
release: "1.4"
latest: true
---
---
product: Manufacturing
version: 1.4
is-latest-version: true
---

# OSISoft PI Setup Guide for Productive Maintenance

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

This section explain how to configure several components of OSI PI in order to connect to PI servers
to retrieve time series data from PI data server.

## Configuration Steps

1.  [PI Data Server Connection](#pi-data-server-connection)

2.  [PI Web API Configuration](#pi-web-api-configuration)

3.  [Web API System Configuration](#web-api-system-configuration)

4.  [Configure PI Randomizer Interface](#configure-pi-randomizer-interface)

5.  [Configure PI Points](#configure-pi-points)

6.  [Use PI Web API to Retrieve Attributes and Values of PI Points](#use-pi-web-api-to-retrieve-attributes-and-values-of-pi-points)

7.  [PI Point Configuration for this Use Case](#pi-point-configuration-for-this-use-case)

## PI Data Server Connection

The PI data server hosts configuration of PI points, stores values of the PI points and allows PI
Web API connect to it and retrieve data from the clients. Make sure your machine can connect to the
running instance of the PI data server.

1.  Go to the Windows menu items or location of PI system typically located at
    C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\PI System.

2.  Run PI system explorer and select Servers menu.

3.  If you see Data Server (and Asset Server) are connected no further configuration is required.
    Otherwise select Tools > Options menu.

4.  Check PI Trust, uncheck Windows Security and check Allow login prompt. Then when you try to
    connect to data server it will prompt you with Windows authentication and your windows
    credentials.

## PI Web API Configuration

The PI Web API needs to be configured to retrieve PI points attributes and values using REST.

1.  Go to the Windows menu items or location of PI system typically located at
    C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\PI System.

2.  Run PI Web API Admin Utility and connects to the PI Asset Server instance.

3.  Select HTTPS port 443 and Firewall exception.

4.  Select Bypass Advanced Certification Check.

5.  Select account type and account name.

6.  Select AF server and database, and data server.

7.  Follow the screens to continue configuration and note down the PI Web API url.

## Web API System Configuration

This section talks about configuration items which are supported but not configured by default.
Follow these steps to configure Web API system:

1.  Open PI System Explorer

2.  Click on Database and select Configuration

3.  Expand Elements / OSISoft / PI Web API / PI\_Server\_Host / System Configuration, and then click
    on 'Attributes' tab

4.  Configure the following items:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Item</th><th>Details</th><th>Comments</th></tr></thead><tbody><tr><td><p>Basic Auth config</p></td><td><p>* Select AuthenticationMethods<br>* Value field click on String Array<br>* Type Basic in value and click on Add+ * Click on Check-In button</p></td><td><p>Needed to authenticate and connect client to Web API.</p></td></tr><tr><td><p>Bulk Request config</p></td><td><p>* If you see IgnoreCacheControlForBulkRequests make sure it is set to True<br>* Otherwise Click on New Attribute button on top and set the value to IgnoreCacheControlForBulkRequests, type to Boolean and value to True<br>* Click on Check-In button</p></td><td><p>Needed for value set URL to get data for multiple points</p></td></tr><tr><td><p>POST Request config</p></td><td><p>* Set EnableCSRFDefense to false</p></td><td><p>Needed for POST to work to avoid 403 suite access denied error</p></td></tr></tbody></table>

## Configure PI Randomizer Interface

Follow these steps to configure the random interface and install it as a Windows service.

1.  Run PI Interface Configuration Utility

2.  Select Interface > New Windows interface instance from a bat file or from an exe file and browse
    to Random interface installation directory typically C:\\Program Files\\PIPC\\Interfaces\\Random
    containing random.exe or random.bat file

3.  Select Host PI data server and click on add

4.  In the general section make sure the point source is R and in the scan frequency, you specify
    the frequency at which random interface will simulate PI points. You can specify multiple
    frequencies

5.  In the Service section make sure tcp/ip is selected as a dependency

## Configure PI Points

PI Interface for Random Simulator Data is installed and configured with PI Data Archive, is an
excellent source of test data. You can configure points to generate various types of randomized
data. The default point source for this interface is R.

Point builder will allow you to configure PI points. Run PI System Management Tools and select
Points > Point Builder . Click on 'New' and provide point details as described in the following
sections.

### General Tab

- Name: it must be a unique name across all points, for example, FlowLevel-M23

- Descriptor: can be used to store some important info such as machine or location where the point
  is attached

- Stored Value: how value is stored in data server, select Real-time data

- Point Source: source of value, for Random interface select R

- Point Class: select Classic

- Point Type: data type of the point such as int, float, string, timestamp, blob or digital

- Digital Set: if the data type is Digital, select the set of value defined in the Digital Set

- Eng Units: engineering unit of the point being measured, for example, PSI for flow, F for
  temperature

### Archive Tab

- Typical Value: typical value of the point, for example, 50

- Zero: minimum value of the point, for example, 10

- Span: maximum value of the point, for example, 100

- Make sure the Scan and Archiving are selected On

### Classic Tab

The values in the Location 1 to 5, depends on the Data Type, Scan Class of the random interface
being used, desired amount of change between each value, and number of value to change before
midpoint resets to current value. Note that not all location values are required for each point. For
example:

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Field</th><th>Value</th><th>Description</th></tr></thead><tbody><tr><td><p>Location1</p></td><td></td><td></td></tr><tr><td><p>Location2</p></td><td><p>10</p></td><td><p>If the span is 100, it will allow to change value by 1 in each scan (10*(100/1000)) = 1</p></td></tr><tr><td><p>Location3</p></td><td><p>25</p></td><td><p>After 25 random value it will reset to current value</p></td></tr><tr><td><p>Location4</p></td><td><p>1</p></td><td><p>Scan class of PI point. Look at random.bat or Random interface configuration. This says the PI point will be changed as per line 1, so if that is 30 sec, the PI point value will change every 30 seconds.</p></td></tr><tr><td><p>Location5</p></td><td><p>1</p></td><td><p>Number from 0 to 5 depending on point data type</p></td></tr></tbody></table>

**Digital States configuration**

When point data type is selected as Digital, its value can be one of those specified in a Digital
State.

1.  Select Points > Digital States and click on Add icon.

2.  Name the set and set of state values with state name.

The result should be a Digital State for a Maintenance Status, which can be `0=Active` and
`1=Broken`.

## Use PI Web API to Retrieve Attributes and Values of PI Points

Once PI servers, data server, Web API, random interface and PI points are configured you can use PI
Web API to retrieve and update point attributes and values from PI server. The Web API provides REST
interface to interact with PI server over the web.

The following table describes some of the common endpoints to retrieve PI point information. Note
that each points and assets in PI server is identified using a unique webId.

<table><colgroup><col> <col></colgroup><thead><tr><th>Description</th><th>Web API URL</th></tr></thead><tbody><tr><td><p>PI Web API home page</p></td><td><p><code><a href="https://host:port/piwebapi/">https://host:port/piwebapi/</a></code></p></td></tr><tr><td><p>Get attributes of all PI points</p></td><td><p><code><a href="https://host:port/piwebapi/dataservers/DataServer_webId/points">https://host:port/piwebapi/dataservers/DataServer_webId/points</a></code></p></td></tr><tr><td><p>Get attributes of multiple specified PI points</p></td><td><p><code><a href="https://host:port/piwebapi/points/multiple?webId=Point1_WebId_&amp;webId=Point2_WebId">https://host:port/piwebapi/points/multiple?webId=Point1_WebId_&amp;webId=Point2_WebId</a></code></p></td></tr><tr><td><p>Get value of a specific PI point</p></td><td><p><code><a href="https://host:port/piwebapi/streams/Point_webId/value">https://host:port/piwebapi/streams/Point_webId/value</a></code></p></td></tr><tr><td><p>Get values of multiple specified PI points</p></td><td><p><code><a href="https://host:port/piwebapi/streamsets/value?webId=Point1_webId_&amp;webId=Point2_webId">https://host:port/piwebapi/streamsets/value?webId=Point1_webId_&amp;webId=Point2_webId</a></code></p></td></tr><tr><td><p>Get attributes of multiple specified PI points using POST method</p></td><td><p>POST: <code><a href="https://host:port/piwebapi/batch">https://host:port/piwebapi/batch</a></code><br><code>Body:{ "1" : { "Method": "GET", "Resource": "https://host:port/piwebapi/points/multiple?webId=Point1_webId&amp; webId=Point2webId" } }</code></p></td></tr><tr><td><p>Get data values of multiple specified PI points using POST method</p></td><td><p>POST: <code><a href="https://host:port/piwebapi/batch">https://host:port/piwebapi/batch</a></code><br><code>Body:{ "1" : { "Method": "GET", "Resource": "https://host:port/piwebapi/streamsets/value?webId=Point1_webId&amp;webId=Point2_webId" } }</code></p></td></tr></tbody></table>

## PI Point Configuration for this Use Case

This use case measures vibration delta, temperature, oil level, noise level, and maintenance status
of several machines. The following table describes the configuration of these PI points for one
machine.

<table><colgroup><col> <col> <col> <col> <col> <col></colgroup><thead><tr><th>Attribute</th><th>Point1</th><th>Point2</th><th>Point3</th><th>Point4</th><th>Point5</th></tr></thead><tbody><tr><td colspan="6"><p><em>General Tab</em></p></td></tr><tr><td><p>Name</p></td><td><p>Vibration Delta</p></td><td><p>Temperature</p></td><td><p>Oil Level</p></td><td><p>Noise Level</p></td><td><p>Maintenance Status</p></td></tr><tr><td><p>Descriptor</p></td><td><p>Machine1</p></td><td><p>Machine1</p></td><td><p>Machine1</p></td><td><p>Machine1</p></td><td><p>Machine1</p></td></tr><tr><td><p>Stored Values</p></td><td><p>Real-time data</p></td><td><p>Real-time data</p></td><td><p>Real-time data</p></td><td><p>Real-time data</p></td><td><p>Real-time data</p></td></tr><tr><td><p>Point Source</p></td><td><p>R</p></td><td><p>R</p></td><td><p>R</p></td><td><p>R</p></td><td><p>R</p></td></tr><tr><td><p>Point Class</p></td><td><p>classic</p></td><td><p>classic</p></td><td><p>classic</p></td><td><p>classic</p></td><td><p>classic</p></td></tr><tr><td><p>Point Type</p></td><td><p>Int32</p></td><td><p>Int32</p></td><td><p>Int32</p></td><td><p>Int32</p></td><td><p>Digital</p></td></tr><tr><td><p>Digital Set</p></td><td></td><td></td><td></td><td></td><td><p>MachineStatus</p></td></tr><tr><td><p>Eng Units</p></td><td><p>Hz</p></td><td><p>F</p></td><td><p>Percentage</p></td><td><p>Decibels</p></td><td></td></tr><tr><td><p>Display Digits</p></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td colspan="6"><p><em>Archive Tab</em></p></td></tr><tr><td><p>Typical Value</p></td><td><p>500</p></td><td><p>125</p></td><td><p>50</p></td><td><p>115</p></td><td><p>1</p></td></tr><tr><td><p>Span</p></td><td><p>1000</p></td><td><p>160</p></td><td><p>100</p></td><td><p>160</p></td><td><p>1</p></td></tr><tr><td><p>Zero</p></td><td><p>10</p></td><td><p>90</p></td><td><p>0</p></td><td><p>70</p></td><td><p>0</p></td></tr><tr><td><p>Scan</p></td><td><p>On</p></td><td><p>On</p></td><td><p>On</p></td><td><p>On</p></td><td><p>On</p></td></tr><tr><td><p>Archiving</p></td><td><p>On</p></td><td><p>On</p></td><td><p>On</p></td><td><p>On</p></td><td><p>On</p></td></tr><tr><td colspan="6"><p><em>Classic Tab</em></p></td></tr><tr><td><p>Location1</p></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td><p>Location2</p></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td><p>Location3</p></td><td><p>100</p></td><td><p>100</p></td><td><p>100</p></td><td><p>100</p></td><td></td></tr><tr><td><p>Location4</p></td><td><p>1</p></td><td><p>1</p></td><td><p>1</p></td><td><p>1</p></td><td><p>1</p></td></tr><tr><td><p>Location5</p></td><td><p>2</p></td><td><p>2</p></td><td><p>2</p></td><td><p>2</p></td><td><p>1</p></td></tr><tr><td colspan="6"><p><em>Misc</em></p></td></tr><tr><td><p>Data Type</p></td><td><p>Station Data</p></td><td><p>Station Data</p></td><td><p>Station Data</p></td><td><p>Station Data</p></td><td><p>Random Data</p></td></tr><tr><td><p>Scale</p></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## See Also

- [Prerequisites](https://docs.mulesoft.com/manufacturing/latest/prerequisites)

- [MuleSoft Accelerator for Manufacturing](https://docs.mulesoft.com/manufacturing/latest/)
