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

3. Defining the Items for an event

29min

The purpose of the sheet Event_Item_Definition is to define which data model items to populate with data for a specific event.

Document image


To learn more about Items, please review the chapter Core Concept behind recording production record data via data model.

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

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 Item which are "tagName" = ItemName, "deviceID" = Datamodel node name and hierarchy Levels, "success" = is identifier (false) or is not Identifier (true), "timestamp" = RecordTime and "value" = item Value.

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

Important: While in the sheet Event_Identifiers_Definition is has been defined how the values for Identifiers are being updated, 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 data model items are populated and which Litmus Edge DeviceHub Tag are used to update the items 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.

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

The name of a DeviceHub Tag Name which will be used to update an Item is configured in the column labeled DeviceHub Tag Name used to initiate Item 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 item 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 item, when ever the tag changes its value.

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

Define the Item name

The column labeled Item Name allows the user to define the data model item name which will be updated by this event.

The user enters the data model item name into the column labeled Item 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.

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.

Define the source where the data model node name is retrieved from

To be able to store the data in Litmus Production Record Database, it is required to provide the name of the data model. If the configuration is used for multiple assets, it is possible to for the user to either use a fixed data model name or retrieve the data model name from a different source.

The Litmus solution Litmus Production Record Event Processing Flow supports five different sources.

Source of Node Name

What is used

Example

ConstantValue

The data model node name is a fixed value

Production_Monitoring

FromFlowVariable

The data model node name is available from a Node-Red flow variable.

NodeNameAsset

FromGlobalVariable

The data model node name is available from a Node-Red global variable.

NodeNameLine

FromTag

The data model node name is available as part of the DeviceHub JSON Message Object.



Available options are:

DeviceName, TagName, Description

DeviceName

FromTagMetaData

The data model node name is available as part of the metadata key of the DeviceHub JSON Message Object.

Plant

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

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.

Define the value for the Node Name

To be able to store the data in Litmus Production Record Database, it is required to provide the name of the data model.

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

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

  • Source of Node Name = ConstantValue
    • The user enters the fixed constant value which is used for the Data Model Node Name.



Document image

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

  • Source of Node Name = FromTag
    • The user selects one of three values from a drop-down menu, which are supported keys of the DeviceHub JSON message object.



Document image


Identifier Value

What is used

Example

DeviceName

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



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 Node Name.



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

TagName

The "tagName" key is used to read the value for the Node Name.



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"}"

P_MPU_SC_Max_SP

Based on the source for the Node Name, the user selects 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 Node Name = FromTagMetaData
    • The user enters the name of the meta data key which holds the Data Model Node Name.
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.

Define the data model hierarchy level of the data model Item (Optional)

To be able to record data for an event, it is required to define which data model items together with their data model hierarchy level are to be used for recording data if an event trigger does fire.

A data model hierarchy level of an item used by an item defined in the column labeled Item Name, has to be defined inside Litmus Production Record Database beforehand, for example using the Litmus Solution Litmus Production Record Data Model Configurator.

The data model hierarchy level of an item item updated by the trigger is configured in the column labeled Hierarchy Level Names (Optional) as "|" separated list.

Document image


If the Item is located directly under the Data Model Node Name (Hierarchy Level 0)

Document image


this column is left blank.

Document image


The Hierarchy Level position is a pipe symbol "|" separated string composed of:

  • Any string added to the column consists of a string has to be read from the left, with the first value always being the name of a hierarchy level 1.
Document image

Document image


Any subsequent pipe symbol "|" separated value correlates to its respective hierarchy level.

  • 2nd value = hierarchy level 2
    • Example: Station_A|Right_Side
  • 3rd value = hierarchy level 3
    • Example: Station_A|Right_Side|Operation_1
  • 4th value = hierarchy level 4
    • Example: Station_A|Right_Side|Operation_1|Step_1
  • 5th value = hierarchy level 5
    • Example: Station_A|Right_Side|Operation_1|Step_1|Function_1

The configurator will verify the trigger tag string for invalid ASCII characters. To learn more about which ASCII characters are allowed, review the section Restrictions on ASCII characters allowed to be used.

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


Define if an Item is collected for a new or previous event

Litmus Production Record Database is based on the concept of recording production events. Each production event has a start and end, which is also what allows to calculate the duration of the event. To learn more about the core concept, please review the chapter Core Concept behind recording production record data via data model.

There are two options how a trigger can operate.

  • Option 1 (Always use NewEvent): An Event Trigger is unique and describes a single action like the start or end of a process. This is for example achieved if each event trigger has a unique tag like for example a tag called RunStart and another tag called RunEnd. In this case, each trigger will always describe one situation like the process has started or stopped. For this type of trigger, the value in the column labelled Is the Item recorded for the NewEvent or the PreviousEvent? should always be set to NewEvent
  • Option 2 (Depends on Item and association to monitored process): An Event Trigger describes two different actions like the start and end of a process at the same time. This is for example achieved if the same trigger when executing finishes a process and starts a new one at the same time. This for example can be if the simple value change of a tag is used for example the change of a bar code reading tag. In this case, if the bar code does change, the previous event has finished and a new event has started at the same time. For this type of trigger, the user has to define which item will be associated with the new Event by using the value NewEvent and which Item has to be associated the previous event by selecting the value PreviousEvent. For example if we want to record the start and end time of the process. Then for the Item called "START_TIME", the value in the column labelled Is the Item recorded for the NewEvent or the PreviousEvent? will be set to NewEvent as we want to associate it with the newly started Event. While the Item called "END_TIME" will have the value in the column labelled Is the Item recorded for the NewEvent or the PreviousEvent? be set to PreviousEvent as it has to be associated to the previous Event.

The user selects if an Item is collected for a new event or previous event by selecting the value from the drop-down menu.

Document image


Define the source where the value for the data model Item is retrieved from

The column labeled Source of Item Value allows the user to define where the value for the Item originates from.

The Litmus solution Litmus Production Record Event Processing Flow supports six different sources.

Source of Node Name

What is used

Example

CurrentTime

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

1684422311317

ConstantValue

The value for the data model item is a fixed value

Asset1

FromFlowVariable

The item value is read from a Node-Red flow variable.

Iem1

FromGlobalVariable

The item value is read from a Node-Red global variable.

Item1

FromTag

The item value is read from a key of the DeviceHub JSON Message Object.



Available options are:

Value, Timestamp, DeviceName, TagName, Description

Value

FromTagMetaData

The item value is available as part of the metadata key of the DeviceHub JSON Message Object.

Plant

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

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.

Define the Value for the Item

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

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 Item Value.

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

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

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

  • Source of Identifier = FromTag
    • The user selects one of five 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 Item.



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 Item.



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 Item.



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 Item.



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

TagName

The "tagName" key is used to read the value for the Item.



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"}"

P_MPU_SC_Max_SP



Based on the source for the Item Value, 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 Item Value = FromTagMetaData
    • The user enters the name of the meta data key which holds the Item 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.