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

AF SDK Reference

AFDataCache.WriteToCache Method (AFValue, AFUpdateOption)

AFDataCache.WriteToCache Method (AFValue, AFUpdateOption)

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFDataCache.WriteToCache Method (AFValue, AFUpdateOption)
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

ExceptionCondition
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.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

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