Removal of future-time snapshots
- Last UpdatedOct 02, 2024
- 1 minute read
The piconfig utility can be used to remove specific snapshot events. When the snapshot event is removed, PI Snapshot Subsystem attempts to retrieve the latest archived event from the archive and replace the snapshot event with it. If there are no events for the point in the archive, the snapshot is deleted and remains uninitialized until a new snapshot event is sent.
The following example script extracts all the events that are later than 10 minutes past the current time into a file. Next, using the PIARC table, the script removes all the extracted events from the snapshot. The last archive event for each tag replaces the snapshot.
piconfig table pisnap
* (Ls - PISNAP) piconfig> @sele tag=*,time>"*+10m"
* (Ls - PISNAP) piconfig> @ostru tag,value,time
* (Ls - PISNAP) piconfig> @sigd 8
* (Ls - PISNAP) piconfig> @output deletesnap.dat
@endsection
@output
* (Ls - PISNAP) piconfig> @table piarc
* (Ls - PIARC) piconfig> @mode ed,t
* (Ed - PIARC) piconfig> @modify mode=remove
* (Ed - PIARC) piconfig> @istru tag,value,time
* (Ed - PIARC) piconfig> @echo v
* (Ed - PIARC) piconfig> @input deletesnap.dat
Any combination of conditions can be used to select the events to be deleted, for example all tags of a specific interface.
Note: The significant digit command, , ensures that rounding errors do not cause values to be missed.