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

PI Powershell

AddAFUnitOfMeasure Class

  • Last UpdatedDec 15, 2025
  • 4 minute read
AddAFUnitOfMeasure Class

Add an AF Unit of Measure

The Add-AFUnitOfMeasure cmdlet creates a new AF Unit of Measure on an AF Server.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellAddAFUnitOfMeasure

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

Syntax

[CmdletAttribute("Add", "AFUnitOfMeasure", DefaultParameterSetName = "FactorOffset", 
	SupportsShouldProcess = true)]
public class AddAFUnitOfMeasure : OSICmdletBase
<CmdletAttribute("Add", "AFUnitOfMeasure", DefaultParameterSetName := "FactorOffset", 
	SupportsShouldProcess := true)>
Public Class AddAFUnitOfMeasure
	Inherits OSICmdletBase

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

The AddAFUnitOfMeasure type exposes the following members.

Constructors

  NameDescription
Public method
AddAFUnitOfMeasure

Properties

  NameDescription
Public property
Abbreviation

Abbreviation of the AF Unit of Measure to add. This can be an SI abbrevation or custom abbreviation

Public property
AFServer

AF Server for which to add the AF Unit of Measure

Public property
CheckIn

Check in changes immediately

Public property
Description

Description of the AF Unit of Measure to add

Public property
FromFormula

Formula used to convert new AF UOM to reference UOM

Note that formula UOMs have limitations as well as a performance impact. Simply UOMs with reference factors and reference offsets should be used instead whenever possible.

Public property
Name

Name of the AF Unit of Measure to add

Public property
ReferenceFactor

Reference factor for the AF Unit of Measure to add

Public property
ReferenceOffset

Reference offset for the AF Unit of Measure to add

Public property
ReferenceUnitOfMeasure

Reference Unit of Measure used to define the UOM to add

Public property
ToFormula

Formula used to convert reference AF UOM to AF UOM to add

Note that formula UOMs have limitations as well as performance impact. Simple UOMs with reference factors and reference offsets should be used instead whenever possible.

Examples

Add-AFUnitOfMeasure -Name "decimeter" -Abbreviation "dm" -ReferenceUnitOfMeasure $refUOM -ReferenceFactor 0.1 -ReferenceOffset 0 -CheckIn -AFServer $afServer

Where:

$afServer = Get-AFServer -Name PIAF1

$refUOM = Get-AFUnitOfMeasure -Name "meter" -AFServer $afServer

Creates a new AF UOM "decimeter" using a reference factor and reference offset. A decimeter is equal to 0.1 meters, with SI abbreviation "dm". The change is checked in immediately.

Examples

Add-AFUnitOfMeasure -Name "decimeter" -Abbreviation "dm" -ReferenceUnitOfMeasure $refUOM -ToFormula "dm = m * 10" -FromFormula "m = dm / 10" -CheckIn -AFServer $afServer

Where:

$afServer = Get-AFServer -Name PIAF1

$refUOM = Get-AFUnitOfMeasure -Name "meter" -AFServer $afServer

Creates a new AF UOM "decimeter", using toformula and fromformula. A decimeter is equal to 0.1 meters, with SI abbreviation "dm". The change is checked in immediately.

Note that formula UOMs have limitations and also performance impacts and reference offset/factor UOMs should be used whenever possible. This is example is provided for demonstration purposes only, and a "decimeter" AF UOM should be created as shown in the first example.

See Also

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