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

PI Powershell

SetPIDigitalStateSet Class

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

Set a PI Digital State Set

The Set-PIDigitalStateSet cmdlet sets an existing 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.PowerShellOSICmdletBaseWithConnection
            OSIsoft.PowerShellSetPIDigitalStateSet

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)

Syntax

[CmdletAttribute("Set", "PIDigitalStateSet", SupportsShouldProcess = true)]
public class SetPIDigitalStateSet : OSICmdletBaseWithConnection
<CmdletAttribute("Set", "PIDigitalStateSet", SupportsShouldProcess := true)>
Public Class SetPIDigitalStateSet
	Inherits OSICmdletBaseWithConnection

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

The SetPIDigitalStateSet type exposes the following members.

Constructors

  NameDescription
Public method
SetPIDigitalStateSet

Properties

  NameDescription
Public property
Connection

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

(Overrides OSICmdletBaseWithConnectionConnection.)
Public property
Name

Name of the PI Digital State Set to set

Public property
States

Digital states to apply to the existing 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.

Examples

Set-PIDigitalStateSet -Name "StamperStatus" -States "RUNNING","OFF" -Connection $con

Where:

$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"

This example edits an existing digital state set "StamperStatus" on the "PISRV1" PI Data Archive. This states contained in the PI Digital State Set will be set with the following integral representations:

0="RUNNING" : 1="OFF"

See Also

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