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 (AFAttribute, IList(AFValue))

AFDataCache.WriteToCache Method (AFAttribute, IList(AFValue))

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

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

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