AFAnalysisService.RuntimeFieldValue.ToObject(T) Method
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Converts the value to an object of the specified type or throw exception on error.
Namespace: OSIsoft.AF.Analysis
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public T ToObject<T>()
Public Function ToObject(Of T) As T Dim instance As AFAnalysisServiceRuntimeFieldValue Dim returnValue As T returnValue = instance.ToObject()
public: generic<typename T> T ToObject()
member ToObject : unit -> 'T
Type Parameters
- T
- The following types are supported: String, Int32, Int64, Double, AFTime, and Guid (for .NET 4 only).
Return Value
Type: TValue converted to the specified type.
Exceptions
| Exception | Condition |
|---|---|
| InvalidOperationException | Thrown when unsupported type T is specified. |
| ArgumentException | Thrown when the value conversion to type T was unsuccessful. |