Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Powershell

AddPIDigitalStateSet Class

  • Last UpdatedDec 15, 2025
  • 3 minute read
AddPIDigitalStateSet Class

Add a PI Digital State Set

The Add-PIDigitalStateSet cmdlet creates a new PI Digital State Set on a PI Data Archive.

The connection parameter specifies which connection to a PI Data Archive to use.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddPIDigitalStateSet

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)

Syntax

[CmdletAttribute("Add", "PIDigitalStateSet", SupportsShouldProcess = true)]
public class AddPIDigitalStateSet : OSICmdletBase
<CmdletAttribute("Add", "PIDigitalStateSet", SupportsShouldProcess := true)>
Public Class AddPIDigitalStateSet
	Inherits OSICmdletBase

Dim instance As AddPIDigitalStateSet
[CmdletAttribute(L"Add", L"PIDigitalStateSet", SupportsShouldProcess = true)]
public ref class AddPIDigitalStateSet : public OSICmdletBase
[<CmdletAttribute("Add", "PIDigitalStateSet", SupportsShouldProcess = true)>]
type AddPIDigitalStateSet =  
    class
        inherit OSICmdletBase
    end

The AddPIDigitalStateSet type exposes the following members.

Constructors

  NameDescription
Public method
AddPIDigitalStateSet

Properties

  NameDescription
Public property
Connection

Connection to a PI Data Archive from which to add the PI Digital State Set

Public property
DigitalStates

Digital states to apply to the new PI Digital State Set

The index of the state in the array of passed states is the integral representation of the state.

Run "Get-Help Add-PIDigitalStateSet -Examples" for further explanation.

Public property
Name

Name of the PI Digital State Set to add

Examples

Add-PIDigitalStateSet -Name "BoilerState" -States "ON","OFF","STARTUP","COOLDOWN" -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

This example creates the digital state set "BoilerState" on the "PISRV1" PI Data Archive. This state set contains 4 digital states with the following integral representations:

0="ON" : 1="OFF" : 2="STARTUP" : 3="COOLDOWN"

See Also

TitleResults for “How to create a CRG?”Also Available in