AFValue.Create Method (AFAttribute, Single, AFTime, UOM, AFValueStatus, Object)
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFValue Create( AFAttribute attribute, float value, AFTime timestamp, UOM uom = null, AFValueStatus status = AFValueStatus.Good, Object additionalInfo = null )
Public Shared Function Create ( attribute As AFAttribute, value As Single, timestamp As AFTime, Optional uom As UOM = Nothing, Optional status As AFValueStatus = AFValueStatus.Good, Optional additionalInfo As Object = Nothing ) As AFValue Dim attribute As AFAttribute Dim value As Single Dim timestamp As AFTime Dim uom As UOM Dim status As AFValueStatus Dim additionalInfo As Object Dim returnValue As AFValue returnValue = AFValue.Create(attribute, value, timestamp, uom, status, additionalInfo)
public: static AFValue^ Create( AFAttribute^ attribute, float value, AFTime timestamp, UOM^ uom = nullptr, AFValueStatus status = AFValueStatus::Good, Object^ additionalInfo = nullptr )
static member Create : attribute : AFAttribute * value : float32 * timestamp : AFTime * ?uom : UOM * ?status : AFValueStatus * ?additionalInfo : Object (* Defaults: let _uom = defaultArg uom null let _status = defaultArg status AFValueStatus.Good let _additionalInfo = defaultArg additionalInfo null *) -> AFValue
Parameters
- attribute
- Type: OSIsoft.AF.AssetAFAttribute
The AFAttribute to be associated with the value. - value
- Type: SystemSingle
The new value to be assigned to the Value property. - timestamp
- Type: OSIsoft.AF.TimeAFTime
The timestamp associated with the value. - uom (Optional)
- Type: OSIsoft.AF.UnitsOfMeasureUOM
The UOM of the specified value. - status (Optional)
- Type: OSIsoft.AF.AssetAFValueStatus
The status which indicates whether the new value is a good or bad status, substituted, questionable, or annotated. - additionalInfo (Optional)
- Type: SystemObject
The additionalInfo associated with the value, such as AFAnnotation or AFAnnotations object.
Return Value
Type: AFValueAn instance of AFValue.
Remarks
This method is useful for creating an AFValue of primitive type that avoids boxing/unboxing
through Object, when writing or reading data to or from a data server.