Custom SQL Visualization+ for AVEVA PI Vision

PI Vision visualization of AF table data written by an AI from your prompt

Show the rows of linked or static AF tables together with live PI Vision values, in a view that an AI writes from your description. The symbol copies a prompt for you to paste into an AI that your company allows, and runs the HTML document you paste back.

Two Custom SQL Visualization+ views in PI Vision built from AF table rows: a list of stages with their depth and an Open or Done state, and a stacked bar chart titled Active well with the plug types Cast Iron, Composite and Dissolvable per well, the active well highlighted and the other well dimmed
Two views written by an AI from AF tables and live values: a list of points that turn from Open to Done, and an active-well chart. Demo data. Select the image to enlarge.

Let an AI write your PI Vision visualization from AF tables

Describe the view in words, and get a document that shows your AF table rows and live values, without a dedicated symbol or programming skills.

Copy an AI prompt, paste the answer, run it

The symbol gives you the prompt, so your AI knows your tables and the functions a document can use. You add the request.

  • Copy AI prompt lists each table’s name, columns and column types.
  • Include sample rows adds up to 5 rows of each table to the next copy, so the AI sees what the values look like.
  • Paste the AI’s answer into the code area and select Run to see a preview with the current data, with errors listed in Output.
  • Select Apply, close the pane and save the display. Use any AI that your company allows.
Custom SQL Visualization+ code editor with the HTML document on the left, a preview of a list of stages with depth and Open state, a Run button, an Output area, an Include sample rows tick box and the buttons Copy AI prompt for a change, Copy AI prompt for a new document, Copy error report, Cancel and Apply
The code editor: the document, a preview with current data, Output for errors and the buttons that copy the prompt. Demo data. Select the image to enlarge.

Add the AF tables the document reads

Give each table a name, and the document reads it by that name, so you can swap the table without changing the code.

  • Pick any AF table, linked to SQL or static, from the AF database of the first data source, or from an AF server and database you choose.
  • Pass values to the @ parameters of a linked SQL table, as in SQL Table+.
  • Reload each table at an interval, every minute by default.
  • Starts with an example that lists the rows of your table.
Custom SQL Visualization+ in PI Vision showing the starting example that lists the five rows of a table named limits, next to the Tables settings with Name, Source Datasource, AF Table, Query Parameters, Auto Reload and Ignore Master and the Add table button
A table named limits added to the symbol; the starting example lists its rows. Demo data. Select the image to enlarge.

Combine AF tables with live PI Vision values

Plans, limits and status lists that people maintain in AF become part of the display, next to the values operators already watch.

A live value against a table of planned points

Mark each planned point as open or done as a live value passes it, for example a depth track against a list of stages.

  • A data source names the active item, and another carries the live number.
  • The table holds the plan, and the people who maintain it can change it in AF without touching the display.
  • The documentation includes an example document for this case to adapt.
  • Ask the AI to change column names, layout or colours with a follow-up prompt.
A stacked bar chart written by an AI from one AF table, titled Active well with a plug count, showing plug types Cast Iron, Composite and Dissolvable per well, the active well in full colour and the other well dimmed
A chart built from the rows of one AF table, with the active item taken from a data source. Demo data. Select the image to enlarge.

Several tables in one view

Join up to five AF tables in the document, and show their rows next to live values.

  • Name the tables and the column that connects them in your request, for example to join plugs and wells on Well.
  • Status from one table, a count from another and a highlight from a live data source in one row.
  • Each table delivers up to 10,000 rows, and the document is told when rows were cut off.
  • The document can only read the tables; it writes values only to its data sources, and only if Allow writes is on.
A table written by an AI from two AF tables in Custom SQL Visualization+, one row per well with status Active, Standby or Closed, a plug count and depth figures, next to the Tables settings listing the tables plugs and wells
One view from two tables: status from wells, counts from plugs. Demo data. Select the image to enlarge.

Follow SQL Filter+ selections and the display asset

The same visualization can narrow itself to what the operator clicked, or move with the asset the display shows.

SQL Filter+ selections reach the document

When operators click a value in SQL Filter+ on the same AF table, only the matching rows reach the document.

  • Show selected against total by adding the same table a second time with Ignore Master on.
  • The document reports the row count of the selection and the total.
  • With no match, the rows are empty, not an error.
  • Ask the AI to show the filter state; the symbol has no filter indicator of its own.
A SQL Filter+ list on the left with one value selected and a Custom SQL Visualization+ document beside it reporting 239 of 2,752 rows and listing selected against all rows per work kind, next to the Tables settings with Ignore Master on
After one click in SQL Filter+: 239 of 2,752 rows, selected and all per work kind. Demo data. Select the image to enlarge.

One display for several assets

Use attributes of the asset as data sources, and the symbol reads the table of the same name in the new asset’s AF database.

  • Leave Source on Datasource and choose the table; each asset’s database needs a table of that name.
  • When the asset changes, the values follow.
  • The rows of the old table are withdrawn first, so nobody reads them as this asset’s.
  • The document shows the new asset’s own rows.
The same stacked bar chart after the asset changed, now titled with the other asset’s active well and showing only the rows of that asset’s table
After the asset changed: the other asset’s active well and the rows of its table. Demo data. Select the image to enlarge.

Check AI-written visualizations before operators rely on them

A first answer can have the values right and still crowd the view, so the symbol helps you check and improve it.

Row limits and failed loads the document can show

The symbol tells the document when rows were cut off or a table could not be read, so you can ask the AI to show it.

  • A reload that fails keeps the last rows, passes the error to the document and retries by itself, less often the longer it lasts.
  • If a table does not exist in the asset’s database, the document gets no rows and the message.
  • Above 10,000 matching rows the document is told how many match.
  • You own the generated code; compare values with the AF table and a PI Vision trend first.
A list of stages in Custom SQL Visualization+ with a notice above it that the AF server is not available and the last rows read are shown
A failed reload: the document shows the error and keeps the last rows read. Demo data. Select the image to enlarge.

Incomplete data stated in the view

Ask the AI to say when figures are based on fewer rows than the table holds.

  • The document receives the matching row count and the total.
  • A truncated flag tells it that only the first 10,000 rows were delivered.
  • Ask for one change at a time with Copy AI prompt for a change.
  • Check the values after every answer, with rows on both sides of a limit.
A grouped summary table in Custom SQL Visualization+ with a notice that the figures cover only the 10,000 delivered rows although the table has 10,050, then rows per group with counts, averages and a bar
A summary that states it covers only the first 10,000 rows. Demo data. Select the image to enlarge.

PI Vision AF table visualization examples

Four ways teams can use Custom SQL Visualization+ on their displays.

Depth track against planned points

Data
A table of stages with their depth, and two data sources: the active well and the live depth
Settings
Code from your AI that marks each row Open until the live value reaches it
Shows
Stages turn to Done as the live value passes them

Status board from several tables

Data
Two or three AF tables joined on a shared column, plus a live data source
Settings
Tables named in the prompt; the document joins them
Shows
One row per item with status, counts and the highlighted active item

Filter-aware summary

Data
An AF table and the same table again with Ignore Master on, next to SQL Filter+
Settings
Document shows selected against total
Shows
The rows an operator selected out of all rows

One display for several assets

Data
A table of the same name in each asset’s AF database
Settings
Source on Datasource, asset attributes as data sources
Shows
The chart and rows of whichever asset is shown

Custom SQL Visualization+ FAQ

Questions we are asked most often. Read the Custom SQL Visualization+ documentation or ask a technical question.

Does Custom SQL Visualization+ include an AI?

No. The symbol copies a prompt that holds your tables, their columns and types, the current values of the data sources and the functions a document can use. You paste it into an AI that your company allows, add your request, and paste the HTML document the AI returns into the code area. Select Run to preview it, then Apply.

Where does the data come from?

From AF tables, linked or static, and from the symbol’s data sources. The symbol reads AF tables; for a linked SQL table, the query stays in the linked AF table and the symbol only supplies values for its @ parameters, set as in SQL Table+. Each symbol reads up to 5 tables and up to 10,000 rows per table, and needs at least one data source so the tables reload.

When should we use it instead of SQL Table+ or Custom Visualization+?

Use SQL Table+ when a plain table of the rows is enough, because it needs no code. Use Custom Visualization+ when the document needs no tables. Use Custom SQL Visualization+ when you want a visualization that combines table rows with live values, joins several tables or follows the asset.

Can we rely on what the AI writes, and can it change our tables?

Tables are read only: a document can write only to the symbol’s data sources, and only if Allow writes is on. You own a generated document and its correctness on live operations, so compare its values with the AF table and a PI Vision trend before operators rely on it. Software Athlete supports the symbol and its document functions.

What do we need to run it?

Vision Library+ 2.2, with the frames folder installed on the PI Vision server by your administrator, an AF table that exists, and access to an AI that your company allows. See the installation and administration guide for the details.

How do we get Custom SQL Visualization+?

Custom SQL Visualization+ is part of Vision Library+, together with the other Vision Library+ symbols. Request a trial to test it in your own PI Vision environment.

Try Custom SQL Visualization+ in your PI Vision

Custom SQL Visualization+ is included in Vision Library+, the PI Vision custom symbol library from Software Athlete. Test it on your own displays and data.