The Xentara KEB Service v1.0
User Manual
KEB Service

Service registration

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:

"{serviceName}"
"{\"dataPointsKey\":\"{serviceName}.DataPoints\",\"dataTypesKey\":\"{serviceName}.DataTypes\",\"cmdChn\":\"{serviceName}.Commands\"}"

Conversion between Xentara and KEB

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

KEB Data Type

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:

"[{\"name\":\".updateTime\",\"type\":\"String\",\"size\":46,\"access\":\"r\",\"updateChn\":\".updateTime\"},{\"name\":\".value\",\"type\":\"Int\",\"size\":32,\"access\":\"r\",\"updateChn\":\".value\"}]"

KEB Data Point

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:

{serviceName}Value:{serviceName}{Xentara Data Point primary key}

KEB Data Point example:

"{\"name\":\"KEBXentaraService.Signals.Sine Wave\",\"type\":\"t_1\",\"size\":1573212,\"access\":\"b\",\"updateChn\":\"KEBXentaraServiceValue:KEBXentaraService.Signals.Sine Wave\"}"

Channels

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:

{serviceName}Value:{serviceName}{Xentara Data Point primary key}{updateChn of the Data Type}

Channel example:

KEBXentaraServiceValue:KEBXentaraService.Signals.Sine Wave.value

Corresponding Xentara Attribute primary key:

Signals.Sine Wave.value

Commands

The plugin allows the two-way communication with the database by reading commands from the {serviceName}.Commands stream.

Set

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.

Subscribe

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

"command" TODO