Solutions
...
Litmus Production Record Exter...
Creating an event monitoring c...

2. Defining the Identifiers used to identify an event

24min

The purpose of the sheet Event_Identifier_Definition is to define which DeviceHub Tags will provide the values for the Identifiers.

Document image


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

The entries in this sheet will be used to create the Identifier JSON key of the event configuration JSON structure.

Uploading...

Document image


Note: The sequence of steps shown in this guide is a recommendation, as it felt the most natural for the author. But users are free to follow their own preferred sequence.

The configuration created by this sheet will be used to solution Litmus Production Record Event Processing Flow to create in the published message the values for the Identifiers which are "datatype" = identifier Values and "registerid" = Identifier Names.

{"tagName":"PartNo","deviceID":"Tooling_Shop","success":false,"datatype":"PN7458,BN87564","timestamp":1684854704011,"value":"PN7458","registerId":"PartNo,SerialNo"}

Important: While defining where the Identifiers are being updated from in this sheet, they will have to be defined as actual items in the sheet Event_Item_Definition again.

Select the event name

To define for which Event Name which Litmus Edge DeviceHub Tag are used to update the required Identifier values for an event the user selects the Event Name from the drop-down menu in the column labeled Event Name.

Document image


Note: Only values available through the drop-down menu can be selected.

The user selects the desired event name into the column labeled Event Name.

Document image


Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.

Check that an Event Name is only defined a Maximum of 5 times

Each data model defined in Litmus Production Record Database can have up to five Identifiers.

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

The configurator will check if a selected Event Name has not be selected more than five times.

If the configurator does detect, that a specific event name has been used five times, the user is prompted.

Document image


The duplicate row will have the column Event Name marked in red.

Document image


This allows the user to find the entry and correct it.

Define the DeviceHub Tag Name used to initiate the update for the Identifier

The name of a DeviceHub Tag Name which will be used to update an Identifiers is configured in the column labeled DeviceHub Tag Name used to initiate Identifier update.

Document image


Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.

Note: To allow that the tag can be used for identifier update, the tag will have to be configured on Litmus Edge at least once. If multiple devices have the same tag configured, all can be potentially monitored for the event.

The tag defined in this column, is used to update/set the value of an identifier, when ever the tag changes its value.

This does not have to be the value which is set for the Identifier necessarily but can simply be the signal to read the value from a different source like a variable or a constant value.

Define the Source of the Identifier Value

The column labeled Source of Identifier allows the user to define where the value for the Identifier originates from. Note: This does not have to be the same tag as used in the previous column labeled DeviceHub Tag Name used to initiate Identifier update. But it can be.

The Litmus solution Litmus Production Record Event Processing Flow supports seven different sources for the value.

Source of Identifier

What is recorded

Example

CurrentTime

The value for the Identifier is the current system time of the Litmus Edge Device in UNIX format.

1684422311317

ConstantValue

The value for the Identifier is the a fixed value.

Plant1

FromFlowVariable

The value for the Identifier is the read from a Node-Red flow variable.

Identifier1

FromGlobalVariable

The value for the Identifier is the read from a Node-Red global variable.

Identifier1

FromTag

The value for the Identifier is the read from a defined key of the DeviceHub message object.

Value

FromTagMetaData

The value for the Identifier is the read from a defined key of the metadata key of the DeviceHub message object.

Site

FromEvent

The value for the Identifier is read from a different event.

Start_Production

The user sets the source by selecting it from the drop-down menu in the column labeled Source of Identifier.

Document image


This will add the selected string into the cell.

Document image


Note: Only values available through the drop-down menu can be selected.

Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.

Select the event if the Identifier is taken from a different event

The column labeled If Source is Event, which Event? allows the user to define which event is the source for the Identifier if the value in the column labeled Source of Identifier has been set to the value FromEvent.

Note: This column does not need to be filled in, if the cell itself is greyed out.

Document image


The user selects the event name from the drop-down menu in the column labeled If Source is Event, which Event?.

Document image


This will add the selected string into the cell.

Document image


Note: Only values available through the drop-down menu can be selected.

Check that the event name is not the same event name selected in the column Event Name

The event to provide the Identifier values needs to be a different event as the one select in the column labeled Event Name.

If the configurator does detect, that a the same event name was selected as in the column labeled Event Name, the user is prompted.

Document image


The duplicate value is removed from the cell.

Define the DeviceHub Device Name if the Identifier is taken from a different event (Optional)

The column labeled If Source is Event, which DeviceHub Device provides the value? allows the user to define a specific DeviceHub Device Name which will provide the Identifier value if the value in the column labeled Source of Identifier has been set to the value FromEvent.

If no value is provided, the flow Litmus Production Record Event Processing Flow will use retrieve the Identifier value from the event for the same DeviceHub Device as the one for the DeviceHub Tag defined in the column labeled DeviceHub Tag Name used to initiate Identifier update.

Note: This column does not need to be filled in, if the cell itself is greyed out.

Document image


The user defines the value in the column labeled If Source is Event, which DeviceHub Device provides the value?.

Example: The cell is left empty.

Document image




Example: The user defined a DeviceHub Device Name. This can be used, if the production event spans over multiple assets which have dedicated DeviceHub devices.

Document image


Define the Value for the Identifier

The column labeled Identifier Value allows the user to define the value used for the Identifier.

Note: This column does not need to be filled in, if the cell itself is greyed out.

Document image


The value to enter will change depending on the choice made in the column labeled Source of Identifier.

  • Source of Identifier = CurrentTime
    • The cell will be greyed out and the user does not have to insert a value
Document image

  • Source of Identifier = ConstantValue
    • The user enters the fixed constant value which is used for the Identifier
Document image

  • Source of Identifier = FromFlowVariable / FromGlobalVariable
    • The user enters the name of the Node-Red Flow / Global variable which holds the Identifier Value.
Document image

  • Source of Identifier = FromTag
    • The user selects one of four values from a drop-down menu, which are supported keys of the DeviceHub JSON message object.
Document image


Identifier Value

What is used

Example

Value

The "value" key is used to read the value for the Identifier.



Example:

"{"deviceName": "PLC_RC1_CCS_07", "tagName": "P_MPU_SC_Max_SP", "deviceID": "A39604DC-3FD0-4D01-AEE2-EF86695EE8F6", "success": true, "datatype": "int", "timestamp": 1684760245201, "value": 32767, "metadata": {"Country": "DE", "Plant": "Urethanes", "Site": "LEI"}, "registerId": "0B55047E-3CF6-4690-B183-38F398E2B663", "description": "Pump_Max_Scale_SP"}"

32767



Timestamp

The "timestamp" key is used to read the value for the Identifier.



Example:

"{"deviceName": "PLC_RC1_CCS_07", "tagName": "P_MPU_SC_Max_SP", "deviceID": "A39604DC-3FD0-4D01-AEE2-EF86695EE8F6", "success": true, "datatype": "int", "timestamp": 1684760245201, "value": 32767, "metadata": {"Country": "DE", "Plant": "Urethanes", "Site": "LEI"}, "registerId": "0B55047E-3CF6-4690-B183-38F398E2B663", "description": "Pump_Max_Scale_SP"}"

1684760245201



DeviceName

The "deviceName" key is used to read the value for the Identifier.



Example:

"{"deviceName": "PLC_RC1_CCS_07", "tagName": "P_MPU_SC_Max_SP", "deviceID": "A39604DC-3FD0-4D01-AEE2-EF86695EE8F6", "success": true, "datatype": "int", "timestamp": 1684760245201, "value": 32767, "metadata": {"Country": "DE", "Plant": "Urethanes", "Site": "LEI"}, "registerId": "0B55047E-3CF6-4690-B183-38F398E2B663", "description": "Pump_Max_Scale_SP"}"

PLC_RC1_CCS_07

Description

The "description" key is used to read the value for the Identifier.



Example:

"{"deviceName": "PLC_RC1_CCS_07", "tagName": "P_MPU_SC_Max_SP", "deviceID": "A39604DC-3FD0-4D01-AEE2-EF86695EE8F6", "success": true, "datatype": "int", "timestamp": 1684760245201, "value": 32767, "metadata": {"Country": "DE", "Plant": "Urethanes", "Site": "LEI"}, "registerId": "0B55047E-3CF6-4690-B183-38F398E2B663", "description": "Pump_Max_Scale_SP"}"

Pump_Max_Scale_SP



Based on the source for the Identifier, the user selects the which JSON key to use from the drop-down menu.

Document image


Note: Only values available through the drop-down menu can be selected.

  • Source of Identifier = FromTagMetaData
    • The user enters the name of the meta data key which holds the Identifier Value.
Document image


The value entered is one of the keys set as meta data keys in Litmus Edge DeviceHub.

Example:

"{"deviceName": "PLC_RC1_CCS_07", "tagName": "P_MPU_SC_Max_SP", "deviceID": "A39604DC-3FD0-4D01-AEE2-EF86695EE8F6", "success": true, "datatype": "int", "timestamp": 1684760245201, "value": 32767, "metadata": {"Country": "DE", "Plant": "Urethanes", "Site": "LEI"}, "registerId": "0B55047E-3CF6-4690-B183-38F398E2B663", "description": "Pump_Max_Scale_SP"}"

Note: The meta data key needs to have been defined for the tag either on the device or tag level in Litmus Edge DeviceHub.

  • Source of Identifier = FromEvent
    • The user selects one of two values from a drop-down menu.
Document image


Identifier Value

What is used

CurrentValue

For the Identifier of this event, the value used currently from the source event is used

PreviousValue

For the Identifier of this event, the value used previously from the source event is used



Based on the source for the Identifier, the user selects the which JSON key to use from the drop-down menu.

Document image


Note: Only values available through the drop-down menu can be selected.

Define the Item name of the Identifier

The column labeled Item Name of Identifier if Source is Tag allows the user to define the data model item name of the identifier.

Note: This column does not need to be filled in, if the cell itself is greyed out.

Document image


The value to enter will change depending on the choice made in the column labeled Source of Identifier.

  • Source of Identifier = FromEvent
    • The cell will be greyed out and the user does not have to insert a value
Document image

  • Source of Identifier = CurrentTime / ConstantValue / FromFlowVariable / FromGlobalVariable / FromTag / FromTagMetaData
    • The user enters the data model item name of the Identifier Value.
Document image


Important: Do not leave blank rows between entries or at the start. A blank row will be seen as the end of the configuration and the configurator will not process any entry past the blank row.

The configurator will verify the Item Name for invalid ASCII characters. To learn more about which ASCII characters are allowed, review the section Restrictions on ASCII characters allowed to be used. The configurator also validates the length of the string.

Invalid ASCII characters

If an invalid character is found, a prompt is shown to the user.

Document image


Invalid characters are marked in red.

Document image


As spaces are not a visible character, they can't be marked in red, so the user can make use of the comment added to the cell as well.

Document image


Invalid string length

To allow for the most efficient storage of the configuration as well as practicality when using an Item Name in a query, the maximum length of an Item Name can not exceed 50 characters.

If an Item Name is longer 50 characters, the user will be prompted.

Document image


Note: Item Names which exceed the 50 character limit, will by default be trimmed to 50 characters if no action is taken by the user.