Lesson 5 hints and tips
- Last UpdatedMay 16, 2023
- 1 minute read
- PI System
- AF SDK 2.10
- PI Server
CaptureValues() is used only on closed event frames; that is, an Event Frame with an EndTime that occurs before AFTime.MaxValue. Event frames that are not closed have values that can still change. If the CaptureValues() method is called and the EndTime has not been set, then an exception is thrown.
Use the template NamingPattern property to define the event frame names. To obtain an understanding of how the template works, try setting it in PI System Explorer first before using it in AF SDK. For example, try the template shown here:
TEMPLATE%-%ELEMENT%-%STARTTIME:yyyy-MM-dd%-EF*
To configure the event frame attribute to report an average, set the data reference to a PI Point DR. Use the following ConfigString:
.\Elements[.]|Energy Usage;TimeRangeMethod=Average
The ConfigString shown above configures the Average Energy Usage attribute to report the average of the primary referenced element's Energy Usage over the event frame's time range.