AFDataCache.WriteToCache Method (AFAttribute, IList(AFValue))
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Initialize the data cache of the AFAttribute with passed values. The AFAttribute
must already be added to the AFDataCache with Manual
or ManualRange.
Namespace: OSIsoft.AF.Data
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void WriteToCache( AFAttribute attribute, IList<AFValue> initialValues )
Public Sub WriteToCache ( attribute As AFAttribute, initialValues As IList(Of AFValue) ) Dim instance As AFDataCache Dim attribute As AFAttribute Dim initialValues As IList(Of AFValue) instance.WriteToCache(attribute, initialValues)
public: void WriteToCache( AFAttribute^ attribute, IList<AFValue^>^ initialValues )
member WriteToCache : attribute : AFAttribute * initialValues : IList<AFValue> -> unit
Parameters
- attribute
- Type: OSIsoft.AF.AssetAFAttribute
The AFAttribute key - initialValues
- Type: System.Collections.GenericIListAFValue
List of AFValue to be written to the data cache
Exceptions
| Exception | Condition |
|---|---|
| KeyNotFoundException | The AFAttribute has not been added to this AFDataCache. |
| InvalidOperationException | The AFAttribute was added to AFDataCache with DataPipe. InvalidOperationException can also be thrown if the initialValues are not in ascending time order. |
Remarks
Events are only written to the cache, not to the system of record associated with the AFAttribute.
All the AFValue in the list are assumed to belong to the passed key. No verification will
be done to compare the AFAttribute property of the passed values with the passed key.
If there are already events in the cache for this AFAttribute, new events older than
the first event in the cache will be ignored.