MATLAB analytics for PI AF

by The MathWorks, Inc.

Actionable analytics using MATLAB on your PI AF data streams

Solution Overview

Do you need to perform advanced analytics on your asset data as it streams into PI AF? Would you like to apply sophisticated time-series or signal processing methods to detect anomalies? Would you like to save money by optimizing your processes, or avoid costly downtime by pre-emptively performing maintenance? You can do all this using MATLAB (you may already have programs written by other departments within your company that you can leverage). Take advantage of application specific toolboxes such as Signal Processing Toolbox, Optimization Toolbox, Statistics and Machine Learning Toolbox, and Predictive Maintenance Toolbox to perform the following types of analytics on your asset data:

  • Condition based monitoring
  • Process optimization
  • Anomaly detection
  • Preventive Maintenance

Solution Approach

These analytics can be run on your asset attributes either in an event triggered manner or on a periodic basis from PI AF by calling MATLAB Production Server.


  1. Import historical data into MATLAB using the PI Web API client library for MATLAB Toolbox for algorithm or model development.
  2. Utilize MATLAB toolboxes to perform signal processing, optimization, time-series analysis, machine learning, or deep learning
  3. Package the model or algorithm into a deployable archive using MATLAB Compiler SDK
  4. Publish the model or algorithm onto MATLAB Production Server as a microservice function
  5. Configure the connection between PI AF and MATLAB Production Server from the Tools -> Manage External Systems dialog box. All you need to know is the hostname and port of MATLAB Production Server, which your IT department should be able to provide you
  6. Browse the list of analytic functions/services published on MATLAB Production Server through the 'MATLAB' drop down menu entry
  7. Call any published MATLAB function inside your Asset Analytics expression just like any other function. Both single-values as well as arrays of values can be passed back and forth
  8. Store the results of MATLAB function calls as PI Points for later usage


  • Asset Framework 2018
  • MATLAB Production Server R2018a or later
  • MATLAB, MATLAB Compiler, MATLAB Compiler SDK R2018a or later

Supporting Documents



  • MATLAB is tightly integrated with PI AF so that MATLAB functions can be called in the same manner as native functions in Asset Analytics.
  • MATLAB Production Server acts is a highly scalable application server that can handle a heavy volume of requests from PI Asset Analytics
  • MATLAB Production Server automatically manages and loads the appropriate MATLAB Runtime library no matter which version of MATLAB you created your program in (R2016b or later)
  • Reduce cost, optimize operations, and minimize downtime.

PI System Requirements

Asset Framework 2018, PI System version 3.4.390

Solution Type

Advanced Analytics, IoT


  • Chemical & Petrochemical
  • Oil & Gas
  • Pharmaceuticals & Life Sciences
  • Power Generation

Business Impacts

Optimize Processes, Increase Asset Health & Uptime, Improve Energy Efficiencies


Applications for the PI System