Using Cache Data Store as Data Source
When the cache data store is enabled, Assets caches the last known real-time values of equipment properties and stores them in a Microsoft SQL database table.
GENESIS Assets Point Manager keeps a copy of the table in memory and periodically synchronizes it with the database. On startup or whenever it reconnects to the database after a failure, the point manager checks whether the cache table is present. If no table is detected, it creates a new one. If it finds a cache table with an obsolete structure (from an older GENESIS version), it is automatically upgraded.
When restoring the SQL database to a previous state, the in-memory copy becomes out of sync and still contains the values from before the restore. Writing to the cache continues normally, though.
To refresh the values, either restart the Assets point manager, or call the following method from a client:
ac:\AcCacheReinitialize
To enable logging data source values in the cache data store, you need to set up the connection to the database from Assets (see the following procedure).
Then you can use the last cached value of any equipment or equipment class parameter as its data source. It is useful when a real-time data source cannot be reached or if it changes very frequently.
For any equipment created from an equipment class, configure the settings on the related equipment class property, as described in the following procedure. Otherwise, the settings will be lost when the equipment class configuration is regenerated.
To set up the cache data store and use it as a data source of an equipment class property:
- Open Workbench and in Project Explorer, expand your project > Product Configuration and double-click Other settings to open the configuration. Optionally, customize the General section settings as desired.
-
In the Cache Data Store section, click Configure connection to open the connection settings dialog.
By default, the Connection String setting is empty, and the Assets cache is disabled. - In Database, select the desired logging database for storing the table, and then click Next to close the dialog. The connection string is entered in the Connection String text box.
- Use the settings in the Cache synchronization period section to specify how often the Assets point manager will connect to the SQL database and synchronize the table. When finished, click Apply & Close.
-
In Project Explorer, expand Assets > Equipment classes, navigate to the desired equipment class, and do one of the following to open the property configuration dialog:
- Expand the equipment class node and double-click the desired equipment property.
- Right-click the equipment class node and select Add Equipment class property to create a new one. Learn more
To use a cached value as a data source for a specific equipment instance that has not been created from an equipment class, perform steps 5 and 6 in Assets > Equipment. -
On the Real-time Data tab, select the Use database cache checkbox, and then click Apply.
When creating a new property, the checkbox is displayed after you select a data source.