The Xentara KEB Service v1.0
User Manual
|
Upon connection, the plugin writes the JSON structures to the database to describe the data layout. The key "Services" contains a hash object with three mandatory JSON fields. "dataPointsKey" and "dataTypesKey" contain the keys of the hash objects that store the KEB Data Points and KEB Data Types. "cmdChn" contains a key of the Redis stream object, which is used by the plugin to read the incoming commands and respond to them.
Services hash field and value pair format:
A single Xentara Data Point is represented in the database as a combination of the KEB Data Type, the KEB Data Point and autogenerated Channels. Each Channel corresponds to one Xentara Attribute
The KEB Data Type is a JSON array representing a unique combination of the Xentara Attributes. Each object in the array contains "name" - the relative name of the attribute (starts with '.'), "type" - one of the KEB inbuilt types (Int, String, ...), "size" - size of the variable in bits, access modifier (r/w/b), "updateCh" - the relative name of the update channel (starts with '.').
KEB Data Type example:
Each KEB Data Point represents a single Xentara Data Point and uses one of the KEB Data Types. The "name" field contains the primary key of the Xentara Data Point, "type" contains the key of one of the KEB Data Types, "size" contains the sum of all sizes of the "type", "access" is always 'b' and the "updateChn" contains the first of the channel key.
"updateChn" format:
KEB Data Point example:
The KEB Data Type can be seen as a template used by the KEB Data Point. Thus, the Xentara Data Points with the same set of attributes will we be represented as the KEB Data Points that share the same KEB Data Type. Eventually, the names and the update channels of the KEB Data Type and the KEB Data Point are concatenated internally to generate the set of the channels, one for each Xentara Attribute.
Channel format:
Channel example:
Corresponding Xentara Attribute primary key:
The plugin allows the two-way communication with the database by reading commands from the {serviceName}.Commands stream.
When the "set" command is received, the value from the command is written to the channel and to the corresponding WriteHandle of the Xentara Attribute.
The "subscribe" command contains a list of the channel names. The plugin then starts reading data from the correspoding Xentara Attributes via ReadHandle when attributes change. Then, the read values are written to the channels.
"command" TODO