Device based on AggreGate Standard Communication Protocol

Top  Previous  Next

Device based on AggreGate Standard Communication Protocol Plugin is a Data Transfer/Device Plugin that allows LinkServer to interact with Devices. Every Device that works with AggreGate should implement a standard communication protocol that provides access to the number of settings and allows to download recent events from the Device.

note_warning-wt

The AggreGate Standard Communication Protocol plugin is deprecated. AggreGate Agent plugin should be used to connect any new hardware device to AggreGate.

AggreGate Standard Communication Protocol allows to connect multiple Devices to LinkServer through a single Device Server. Devices are addressed by number. It is possible to connect up to 99 Devices to Device Server and numeration starts from 1. For example, if two Devices are connected to Device Server admin.ds1 they will be named admin.ds1.1 and admin.ds1.2.

note_tip-wt

In this manual we say that Device connects to the LinkServer when Device Server to which this Device is attached (or embedded into) logs in to the LinkServer and then plugin logs in to the Device and starts sending commands to it.

Plugin Lifecycle

As all other Data Transfer/Device Plugins, this plugin gets control when Device Server connects to LinkServer and logs in. It executes a number of actions on startup:

1.Logs in to the Device
2.Synchronizes Device internal real-time clock with the server time
3.Reads info about all Device settings
4.Synchronizes values of Device settings with the server cache or creates this cache is Device was logged in first time
5.Reads and deletes all events from the Device's internal event log. Events are stores in the server event history.

If the above actions were completed successfully, plugin switched to the constant monitoring mode. It periodically executes item values synchronization and event log downloading (steps 5 and 6 from list). Periods of these actions are defined in the plugin global settings.

Global Settings

Device poll interval. Default is 1 second. Defined how often plugin reads recent events from Device internal event log and puts them to the server event history.
Synchronization period. Default is 300 seconds. Defines how often plugin synchronizes values of Device settings with the server.
Device command timeout. Default is 3 seconds.
Device command retries. Default is 5.

These options allow to customize command transmitting and receiving. Both timeout and number of retries should be increased in the networks where packets are often lost, such as wireless networks.

User Settings

None defined.

Device Server Settings

Connected Devices. This settings specifies which Devices are actually connected to the Device Server. "Active" field should be set to true is Device with the corresponding number exist. Fill the password field if Device requires a login password.

Settings Cache and Synchronization

When LinkServer reads values of Device settings at the first time, it persistently stores these values in the database. This is called settings caching. User can view and edit settings of any Device even if its Device Server is not currently connected to the LinkServer.

note_glossary-term

NEW TERM: A cache is a collection of data duplicating original values stored elsewhere or computed earlier, where the original data is expensive (usually in terms of access time) to fetch or compute relative to reading the cache.

note_tip-wt

Viewing or editing of settings of the Device (for example through a AggreGate Client) always shows or edits a server cache. There is no way to edit the actual Device settings directly. New settings are written to the Device when item values synchronization occurs.

Setting Values Cache can be synchronized with the Device. Synchronization occurs in the following cases:

When Device connects to the LinkServer
When setting values are changed in the cache (using a AggreGate Client for example) and Device is connected to the server
Periodically, as defined by the Synchronization period plugin global setting.

Every setting is synchronized according to the following algorithm:

If setting value does not exist in the server cache, it is cached
If setting value in the server cache was changed later then in the Device, cached value it written to the Device
If setting value in the Device was changed later then in the server cache, cached value is replaced by a current value of a Device setting

Cached Settings Synchronization Status

Every setting value in the server cache is represented by a variable in the server context corresponding to the Device. When settings are being viewed or edited (for  example using a Properties Editor of AggreGate Client) Synchronization Status of every setting appears near to the setting description.

Synchronization Status takes on the following values:

Synchronized from Server to Device.
Synchronized from Device to Server.
Waiting for Synchronization. Indicated that value in the server cache was changed since last synchronization.
Synchronization Error. Indicates that error occurred during last synchronization of this setting.

Using Common Tables for Storing Shared Values of Device Settings

It is possible to create master values of Device settings. Master values are stored in the Common Data tables instead of the normal server cache. Every common table contains value of a single Device setting, so values of simple settings such as String or Number are stored in a table containing one column and one row.

When synchronizing Device with the server, plugin tries to detect if there are common tables that contain values of the settings. If Global Common Data contains a table which name equals to the name of setting, value of the setting represented by a common table will be written to all Devices in the system which have settings with this name. If common table is found in User Common Data, its contents will be used as the settings of all Devices under the user's account that have setting with the same name.

If plugin finds that some setting should be synchronized using a common table, synchronization is always performed in Server to Device direction. Contents of a common table are never overridden of modified according to the value of the Device setting.

If some setting is synchronized using common table, it is not possible to view or change value of the setting using a Configure Device action. Values of properties that are synchronized from common table are just a read-only strings like "Using Common Table XXX".