AFDataCache.WriteToCache Method (AFValue, AFUpdateOption)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Writes value to the data cache. The AFAttribute property of the passed AFValue is the key
to lookup the data cache. This 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( AFValue value, AFUpdateOption updateOption )
Public Sub WriteToCache ( value As AFValue, updateOption As AFUpdateOption ) Dim instance As AFDataCache Dim value As AFValue Dim updateOption As AFUpdateOption instance.WriteToCache(value, updateOption)
public: void WriteToCache( AFValue^ value, AFUpdateOption updateOption )
member WriteToCache : value : AFValue * updateOption : AFUpdateOption -> unit
Parameters
- value
- Type: OSIsoft.AF.AssetAFValue
The value to be written - updateOption
- Type: OSIsoft.AF.DataAFUpdateOption
update option
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | The AFAttribute associated with the value is null |
| KeyNotFoundException | The AFAttribute associated with the value has not been added to this AFDataCache. |
| InvalidOperationException | The AFAttribute associated with the value was added to AFDataCache with DataPipe. |
Remarks
The value is only written to the cache, not to the system of record associated with the AFAttribute.
If there are already events in the cache for this AFAttribute, new event older than
the first event in the cache will be ignored and no exception will be thrown.