Clear cache and refresh platform
When you add, delete, or update a device or topic, you need to shut down and then restart the Power Operation Runtime. At that time, we recommend that you also clear the cache and then refresh the platform. This ensures that data is .
Clearing the cache removes stale data. Refresh updates the Schneider Electric CoreServiceHost list of devices and topics, making it available to App Mods.
Clearing and refreshing uses the PLSProviders.ci module. See PLSProviderEngine.ci Module for instructions on creating the statements needed.
PLS_ClearCache
In the Schneider Electric CoreServiceHost, when you call a provider and it returns its result, it caches that result for a given amount of time (which varies by provider). If someone calls that provider again, the system will return the cached result.
If someone adds a device during this time, and then restarts run mode, the device is not available for features like LiveView or basic reporting. Thus, if someone tries to view a table or run a basic report, using the new device, it will not display. The next call that is made to the cache will refresh it.
NOTE: You can create a graphics page that includes a button that calls the cache or refresh.
To clear the cache, call the PLS_ClearCache
function by doing one of the following:
- If the Schneider Electric CoreServiceHost is on the machine from which you are invoking the function, you can call it with no input parameters:
- If the Schneider Electric CoreServiceHost is on a different machine, you must supply parameters to identify where the Application Services core resides. For example, if the customer's Schneider Electric CoreServiceHost resides on an I/O Server named "IOServer1" on "Cluster1", to call PLS_ClearCache, enter:
PLS_ClearCache();
This can be done during startup or by using a button handler.
PLS_ClearCache("IOServer", "IOServer1", "Cluster1");
NOTE: This cannot be done at startup; you must do it after the startup routine is run. For example, you can use a button handler.
PLS_PlatformRefresh
After you clear the cache, run the platform refresh to update the Schneider Electric CoreServiceHost, causing it to refresh its list of devices and topics.
To run the refresh, call the PLS_PlatformRefresh
function by doing one of the following:
- If the Schneider Electric CoreServiceHost is on the machine from which you are invoking the function, you can call it with no input parameters:
- If the Schneider Electric CoreServiceHost is on a different machine, you must supply parameters to identify where the Application Services core resides. For example, if the customer's Schneider Electric CoreServiceHost resides on an I/O Server named "IOServer1" on "Cluster1", to call PLS_PlatformRefresh, enter:
PLS_PlatformRefresh();
PLS_PlatformRefresh("IOServer", "IOServer1", "Cluster1");