Solutions
...
Litmus Companion Solutions for...
Litmus Production Record Exter...

Basic JSON structure of the event configuration

6min

The JSON file created with the solution Litmus Production Record External Event Configurator, will include the JSON configuration for one or more events.

This allows, that more than one event can be monitored for example by the flow from the solution Litmus Production Record Event Processing Flow.

Each individual event consist of a unique event name of three sub sections.

Document image


Sub section EventTrigger

The first sub section will hold the configuration for the trigger and is setup using the sheet Event_and_Trigger_Definition.

It consists of the a series of key-value pairs.

JSON key

What is defined

Example

TriggerTagName

The DeviceHub Tag Name of the tag used as trigger tag.

Note: The DeviceHub Device is not defined. This allows the flow using this configuration to monitor the same event for multiple devices if they all have the same tag.

ProgramName

TriggerCondition

The condition used to monitor the tag value against.

OnValueChangeNotIncluded

TriggerMonitorSource

If the TriggerCondition does require a value to check against, this key holds what the source of that value is.

ConstantValue

TriggerMonitorValue

If the TriggerCondition does require a value to check against, this key holds that value.

O9

TriggerSecondMonitorSource

If the TriggerCondition does require a second value to check against, this key holds what the source of that value is.

FromFlowVariable

TriggerSecondMonitorValue

If the TriggerCondition does require a second value to check against, this key holds that value.

IsMasterPart

TriggerMsgCount

The number of data model items updated through this trigger

5

EventUserTopic

The message broker topic prefix used to publish the data for the items updated through the trigger.

MSSQLData

Each event has only one trigger condition.

Document image


Sub section Identifier

The second sub section will hold the configuration for the Identifiers and is setup using the sheet Event_Identifier_Definition.

To learn more about Identifiers, please review the chapter How are data recorded in Litmus Production Record Database.

The sub section Identifier consist of 1-5 sub-keys called IdentifierTagRelation. How many of these sub-keys exist is based on how many Identifiers had been setup for the data model.

Each sub-key IdentifierTagRelation consists of a key-value pair and a JSON sub structure called IdentifierCollection.

JSON key

What is defined

Example

TagName

The DeviceHub Tag Name of the tag used to to update the value of one or more Identifier(s).

Note: The DeviceHub Device is not defined. This allows the flow using this configuration to monitor the same event for multiple devices if they all have the same tag.

SerialNumber

IdentifierCollection

This JSON substructure consist of 1-5 sub-keys called ID.



This allows to use the same DeviceHub Tag to update more than one Identifier Item, if they for example use both the value of the tag and the timestamp.



Note: If a sub-key IdentifierCollection has 5 ID substructures, no additional IdentifierCollection sub-keys can exist, as only a maximum of 5 Identifiers can exist per data model.



Each substructure called ID consists of a series of key-value pairs.

JSON key

What is defined

Example

TypeOfDataSource

This defines where the value for the Identifier is read from the DeviceHub tags message object.

FromTag

IdentifierEvent

If the value for the Identifier is read from a different event, this hold the unique event name.

Status_Tracking_Asset

IdentifierDevice

If the value for the Identifier is read from a different event and different DeviceHub device, this can be used to specify the DeviceHub device.

Line_PLC

IdentifierValue

This is used to either provide a fixed value or specify the DeviceHub message object JSON key.

Value

IdentifierName

This is a data model Item which has been set as Identifier for this data model.

Asset_Name

Each event is required to have at least one and up to 5 IdentifierTagRelation sub-keys. Each of these sub-keys has at least One and up to 5 ID substructures.

Note: If one sub-key IdentifierCollection has 5 ID substructures, no additional IdentifierCollection sub-keys can exist, as only a maximum of 5 Identifiers can exist per data model.

Document image


Sub section Items

The third sub section will hold the configuration for the Identifiers and is setup using the sheet Event_Item_Definition.

To learn more about data models used to store event data in Litmus Production Record Database, please review the chapter Core Concept behind recording production record data via data model.

The sub section Items consist of 1-n sub-keys called ItemTagRelation. How many of these sub-keys exist is based on how many Items are to be updated by the event.

Each sub-key ItemTagRelation consists of a key-value pair and a JSON sub structure called ItemCollection.

JSON key

What is defined

Example

TagName

The DeviceHub Tag Name of the tag used to update the value of one or more Item(s).

Note: The DeviceHub Device is not defined. This allows the flow using this configuration to monitor the same event for multiple devices if they all have the same tag.

SerialNumber

ItemCollection

This JSON substructure consist of 1-n sub-keys called Item.



This allows to use the same DeviceHub Tag to update more than one Item, if they for example use both the value of the tag and the timestamp or are a constant value.



Each substructure called Item consists of a series of key-value pairs.

JSON key

What is defined

Example

ItemName

The name of the data model Item.

SerialNo

NodeNameSource

The source where the flow reads the data model name from

ConstantValue

NodeName

The value or source of the data model name

Geometry

LevelName

A pipe symbol "|" separated string of the hierarchy level names under which the Item resides in the data model.

Gauge|Actual

isIdentifier

Is the Item an Identifier?

Yes

SendAtStartEnd

If the trigger does execute, is the value written to the new event or to the previous event?

NewEvent

ValueSource

Defines the source of the value for the Item

FromTag

Value

This is used to either provide a fixed value or specify the DeviceHub message object JSON key.



Each event is required to have at least one ItemTagRelation sub-keys. Each of these sub-keys has at least One Item substructure.



Document image