CAUTION: Users must not modify the caching files created by the application. User modification of either of the caching files has the potential of invalidating the file and inducing a data loss situation.
If a file has been modified by the user, it should be deleted to allow the application to create valid files necessary for the Point caching configuration. Newly created files will require a connection to the PI Server to start the application.
An application that wishes to utilize the point caching configuration requires the caching files be validated to determine their usability. The validation process ensures the point and digital set cache files are designated for a particular instance of the application and the files are capable of receiving new data. If the cache files are validated, the process will then be able to provide the application with the stored PI Server versioning information. The validation process also determines if the cache file has stored all point information needed for the application to function without a connection to the PI Server.
The SCacheConfig structure passed to the picm_opencache function call contains a field to define the type of validation that is to be applied to the cache files. The possible initialization options are described below.
CACHE_OPEN - Open existing cache files only. Return error if cache files do not exist or are invalid.
CACHE_OPEN_CREATE - Open existing cache files. Rename and create new cache files if cache files do not exist or are invalid.
CACHE_RENAME_CREATE - Rename existing cache files if they exist. Create new cache files.
CACHE_DELETE_CREATE - Delete existing cache files if they exist. Create new cache files.
CACHE_RENAME_INCOMPLETE - Rename and create new cache files if cache files are incomplete or invalid. Create new cache files if cache files do not exist.
CACHE_DELETE_INCOMPLETE - Delete and create new cache files if cache files are incomplete or invalid. Create new cache files if cache files do not exist.
Note: The user must have previously called picm_setcachebuildcomplete on the cache file in order for the initialization process to determine that the cache file is complete.
If the validation process determines the cache file need to be created, the application will require a connection to the PI Server. If the PI Server is unavailable, the call to picm_opencache will return an error. The status of the validation process is returned with the call to picm_opencache.
A file which cannot be validated may be renamed and a new file created as described in the “Creation” section. Renamed files will contain an inserted numerical date time change string in the filename. If either of the point or digital set cache files cannot be found, the necessary file(s) will be created as previously described.