AddPIDigitalStateToStateSet Class
- Last UpdatedDec 15, 2025
- 3 minute read
Add a PI Digital State to an existing PI Digital State Set
The Add-PIDigitalStateToStateSet cmdlet adds a PI Digital State to 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
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellOSICmdletBaseWithConnection
OSIsoft.PowerShellAddPIDigitalStateToStateSet
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)
Syntax
[CmdletAttribute("Add", "PIDigitalStateToStateSet", SupportsShouldProcess = true)] public class AddPIDigitalStateToStateSet : OSICmdletBaseWithConnection
<CmdletAttribute("Add", "PIDigitalStateToStateSet", SupportsShouldProcess := true)> Public Class AddPIDigitalStateToStateSet Inherits OSICmdletBaseWithConnection Dim instance As AddPIDigitalStateToStateSet
[CmdletAttribute(L"Add", L"PIDigitalStateToStateSet", SupportsShouldProcess = true)] public ref class AddPIDigitalStateToStateSet : public OSICmdletBaseWithConnection
[<CmdletAttribute("Add", "PIDigitalStateToStateSet", SupportsShouldProcess = true)>] type AddPIDigitalStateToStateSet = class inherit OSICmdletBaseWithConnection end
The AddPIDigitalStateToStateSet type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| AddPIDigitalStateToStateSet |
Properties
| Name | Description | |
|---|---|---|
| Connection | Connection to a PI Data Archive to use when adding the PI Digital State to the PI Digital State Set | |
| DigitalStates | Digital states to add | |
| InsertAtIndex | Index at which the new PI Digital State should be added If InsertAtIndex is not specified, then the states are appended to the end of the PI Digital State Set | |
| Name | Name of the PI Digital State Set to which the states should be added |
Examples
Add-PIDigitalStateToStateSet -Name "BoilerState" -States "Unknown" -Connection $con
Where:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
This example adds a PI Digital State "Unknown" to the "BoilerState" PI Digital State Set. Since the -InsertAtIndex parameter is not specified, the new state is appended to the end of the digital state set.
Examples
Add-PIDigitalStateToStateSet -Name "ProcessLoopSet" -States "Pulverizing","Drying","Washing","Packaging" -InsertAtIndex 3 -Connection $con
Where:
$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
This example adds four (4) digital states to the PI Digital State Set "ProcessLoopSet" on the "PISRV1" PI Data Archive. The states are inserted into the PI Digital State Set at index three (3). For example, if the initial PI Digital State Set configuration was:
0="Startup" : 1="Cooling" : 2="Grinding" : 3="Finalizing"
Then the resulting PI Digital State Set configuration after running this example would look like:
0="Startup" : 1="Cooling" : 2="Grinding" : 3="Pulverizing" : 4="Drying" : 5="Washing" : 6="Packaging" : 7="Finalizing"