Managing Digital State Sets

Overview

Digital state sets are stored in a master list in P2 Server and then applied to tags and calculations (see Editing Tags).

Here are some examples of digital state sets:

On Off

 

Status

 

Well Status

Name Value   Name Value   Name Value
Off 0   Offline 0   Offline 0
On 1   Online 1   Online 1
      Open 2   Shutin 2
      Closed 3   Slugin 3

This is how the On Off Digital State Set (from the examples above) is configured in P2 Server:

A Digital State Set can be manually created, edited, or deleted. If it is associated with a datasource that uses a PI or an IP21 Adaptor, it can also be imported during tag discovery (whereby the digital states belonging to a digital state set are updated, added, or deleted).

Digital State Sets can be manually assigned to tags or calculations. They can also be assigned to (or unassigned from) tags via adaptors, during tag discovery (for tags with a datasource that uses a PI or an IP21 Adaptor).

Below is an example of a tag that has the On Off Digital State Set assigned to it:

Digital State Sets in P2 Explorer

In P2 Explorer, tags and calculations that are assigned a Digital State Set will display the string value (Name) from the Digital State Set in place of the corresponding digital value (Value) from that State Set, when used in any of the following of Explorer’s page components:

  • Data Label
  • Text Label
  • Status Tile
  • Data Table
  • Table Layout

For example, a data label’s value is a calculation that has the On Off digital state set from the examples above. When the calculation returns the value 0, the data label displays ‘Off’. When the calculation returns the value 1, the data label displays ‘On’. For any other value, the data label displays that value, as there is no matching name in this digital state set.

A data label displaying the name ‘On’, when the data value is 1

Server Management

To create a new digital state set in P2 Server Management:

1. Open P2 Server Management, and click the Configuration configurationicon icon.

2. Click Digital State Sets.

3. Click Create New Digital State Set.

Note: If you want to edit an existing digital state set, select it from the list below the search box.

4. Add a Name for the digital state set. Digital State Set names must be unique.

5. If you assign a Datasource by selecting from the drop-down list, the digital state set is updated during tag discovery for that datasource (if it uses a PI or an IP21 adaptor).

6. Add the Digital States for this set: a Name with a corresponding Value. Value must be an integer (zero or greater) that is unique within the set.

7. Save the new Digital State Set by clicking the Save button in the top right corner.

 

Import/Export Spreadsheet

The Import/Export spreadsheet is generally only used to make bulk changes.

For details on the spreadsheet and how to obtain it, see Exporting Your Configuration.

If you want to create or update digital state sets as part of a bulk configuration, use the following tabs in the Import/Export spreadsheet:

  • Digital State Set
  • Digital State
  • Tag
  • Calculation Tag

Look for the red comment commentred icon in the row headers, to get help with each column.

Read more: Understand Object Dependencies

Digital State Set Tab

The screenshot below shows an example of a spreadsheet tab for Digital State Sets.

Key Columns:

  • The Digital State Set Global Id is a unique identifier and should not be edited or deleted.
  • Name is a unique name for the digital state set. The name cannot contain reserved characters.
  • Datasource (Optional) contains the name of the datasource that imported this digital state set. If the digital state set was manually created then this field should be left empty.

Dependencies

  • The Datasource column has a direct dependency on the Name column in the Datasource tab.

Digital State Tab

The screenshot below shows an example of a spreadsheet tab for Digital States.

Key Columns:

  • The Digital State Global Id is a unique identifier and should not be edited or deleted.
  • The Digital State Set column contains the name of the digital state set that the digital state belongs to.
  • The Datasource column contains the name of the datasource that the digital state belongs to. If this is filled in, the digital state is updated during tag discovery for that datasource (where if it uses a PI or an IP21 adaptor).
  • The Name column can be a number or text
  • The Value column must be an integer value of zero or greater, that is unique within a digital state set.

Dependencies

  • The Digital State Set column has a direct dependency on the Name column in the Digital State Set tab.
  • The Datasource column has a direct dependency on the Name column in the Datasource tab.

Tag Tab

The screenshot below shows an example of a spreadsheet tab for Tags.

Key Columns:

  • The Digital State Set column contains the name of the digital state set that the tag belongs to.
  • The Digital State Set Datasource column is optional, and contains the name of the datasource that the digital state belongs to.

Dependencies

  • The Digital State Set column has a direct dependency on the Digital State Set column in the Digital State Set tab.
  • The Digital State Set Datasource column has a direct dependency on the Name column in the Datasource tab.

Calculation Tag Tab

The screenshot below shows an example of a spreadsheet tab for Calculation Tags.

Key Columns:

  • The Digital State Set column contains the name of the digital state set that the calculation tag belongs to.
  • The Digital State Set Datasource column is optional, and contains the name of the datasource that the digital state belongs to. Keep blank for calculation tags.

Dependencies

  • The Digital State Set column has a direct dependency on the Digital State Set column in the Digital State Set tab.
  • The Digital State Set Datasource column has a direct dependency on the Name column in the Datasource tab.

Related: Updating the Configuration

 

Comments are closed