AFDataCache.TrimData Method (AFAttribute, AFTime, Int32)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Trims cached data for the AFAttribute while maintaining coverage for events from a specified time.
Namespace: OSIsoft.AF.Data
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public void TrimData( AFAttribute attribute, AFTime minTime, int eventsBeforeMinTime )
Public Sub TrimData ( attribute As AFAttribute, minTime As AFTime, eventsBeforeMinTime As Integer ) Dim instance As AFDataCache Dim attribute As AFAttribute Dim minTime As AFTime Dim eventsBeforeMinTime As Integer instance.TrimData(attribute, minTime, eventsBeforeMinTime)
public: void TrimData( AFAttribute^ attribute, AFTime minTime, int eventsBeforeMinTime )
member TrimData : attribute : AFAttribute * minTime : AFTime * eventsBeforeMinTime : int -> unit
Parameters
- attribute
- Type: OSIsoft.AF.AssetAFAttribute
The attribute to trim data for. - minTime
- Type: OSIsoft.AF.TimeAFTime
The minimum time that should be kept in the cache. - eventsBeforeMinTime
- Type: SystemInt32
The event count to keep before minTime. If 0 is passed, events will be kept to allow interpolation at or after minTime.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | The AFAttribute is null |
| KeyNotFoundException | The AFAttribute has not been added to this AFDataCache. |
| ArgumentOutOfRangeException | The eventsBeforeMinTime is negative. |