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

1. Defining the Event and Trigger condition

26min

The purpose of the sheet Event_and_Trigger_Definition is to define the event as well as the trigger condition to be monitored.

Document image


The entries in this sheet will be used to create the unique event name and EventTrigger 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.

Define the unique event name

Each event defined using the Litmus Production Record External Event Configurator, needs to have a unique name.

The name of an event configured in the column labeled Event Name.

Document image


The user enters 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.

The configurator will verify the Event 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 validate that the event name is unique.

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


Duplicate Event Name check

A specific Event Name has to be unique.

If the configurator does detect, that a specific event name has already be used, 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 duplicate entry and correct it.

Define the DeviceHub Tag Name used as Event Trigger

The name of a DeviceHub Tag Name which will be monitored as trigger is configured in the column labeled DeviceHub Tag Name used as Event Trigger.

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 monitored, 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.

Define the Trigger Condition

To be able to monitor the DeviceHub tag for an event, the flow from the Litmus solution Litmus Production Record Event Processing Flow does require a Trigger Condition.

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

Trigger Condition

What is monitored

OnValueChange

The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value.

ValueEqualTo

The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag if it is equal to the value set.

OnValueChangeButExclude

The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value but will ignore the value set to be excluded.

OnValueChangeNotIncluded

The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value but will ignore if the value contains the substring set to be not included.

OnValueChangeAndSecondValueEqualTo

The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value and that a second trigger is equal to the set value.

OnValueChangeExcludeZeroAndSecondValueEqualTo

The node-red flow Litmus Production Record Event Processing Flow will monitor the DeviceHub tag set as Trigger Tag for any change to the value except for the value 0 and that a second trigger is equal to the set value.

The user sets the Trigger Condition by selecting it from the drop-down menu in the column labeled Trigger Condition.

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.

Define the Source of the Trigger Value or the Source of a second Trigger

The column labeled Source of Trigger Value / Source Second Trigger allows the user to define where either the value to monitor against the trigger tag originates from or define the source of a second trigger.

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 Trigger Condition.

  • Trigger Condition = OnValueChange
    • The cell will be greyed out and the user does not have to insert a value
Document image

  • Trigger Condition = ValueEqualTo / OnValueChangeButExclude / OnValueChangeNotIncluded
    • The user selects one of three values from a drop-down menu
Document image


Source of Trigger Value

What is the source

Example

ConstantValue

The trigger tag is compared (ValueEqualTo) against a fixed value.

The tag value is monitored for any change except if the value of the tag is this fixed value (OnValueChangeButExclude).



The tag value is monitored for any change except if the value of the tag does contain this fixed value (OnValueChangeNotIncluded).

1





Program1







O9

FromFlowVariable

The trigger tag is compared (ValueEqualTo) against the value contained in this Node Red Flow Variable.

The tag value is monitored for any change except if the value of the tag is the value contained in this Node Red Flow Variable (OnValueChangeButExclude).



The tag value is monitored for any change except if the value of the tag does contain the value contained in this Node Red Flow Variable (OnValueChangeNotIncluded).



Note: This allows users, to be able to modify this value programmatically for example based on a recipe value. Important: The code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration.

TriggerTagValue





ExcludeTriggerValue











DoNotInclude







FromGlobalVariable

The trigger tag is compared (ValueEqualTo) against the value contained in this Node Red Global Variable.

The tag value is monitored for any change except if the value of the tag is the value contained in this Node Red Global Variable (OnValueChangeButExclude).



The tag value is monitored for any change except if the value of the tag does contain the value contained in this Node Red Global Variable (OnValueChangeNotIncluded).



Note: This allows users, to be able to modify this value programmatically for example based on a recipe value



Hint: The code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration.

TriggerTagValueEvent1







ExcludeTriggerValueEvent1









DoNotIncludeEvent1



  • Trigger Condition = OnValueChangeAndSecondValueEqualTo / OnValueChangeExcludeZeroAndSecondValueEqualTo
    • The user selects one of two values from a drop-down menu
Document image


Source Second Trigger

What is the source

Example

FromFlowVariable

The tag value is monitored for any change and the value in the Node Red Flow Variable (OnValueChangeAndSecondValueEqualTo) has to be equal to a defined value.



The tag value is monitored for any change except if the value is 0 and the value in the Node Red Flow Variable (OnValueChangeExcludeZeroAndSecondValueEqualTo) has to be equal to a defined value.



Note: This allows users, to programmatically monitor a second condition or a combination of several conditions and make the result available to the event monitoring flow. Important: The code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration.

SecondCondition











SecondCondition







FromGlobalVariable

The tag value is monitored for any change and the value in the Node Red Global Variable (OnValueChangeAndSecondValueEqualTo) has to be equal to a defined value.



The tag value is monitored for any change except if the value is 0 and the value in the Node Red Global Variable (OnValueChangeExcludeZeroAndSecondValueEqualTo) has to be equal to a defined value.



Note: This allows users, to programmatically monitor a second condition or a combination of several conditions and make the result available to the event monitoring flow.



Hint: The code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration.

AssetInTrackingMode









AssetInTrackingMode

Based on the Trigger Condition, the user selects the source from the drop-down menu.

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 Trigger Value or Node Red Variable Name

Th column labeled Trigger Value / Variable Name allows the user to define either the value to monitor the trigger tag against or define the name of a Node-Red flow or global variable.

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 Trigger Value / Source Second Trigger and the column Trigger Condition.

  • Source of Trigger Value / Source Second Trigger = ConstantValue
    • The user defines the fixed constant value against which the trigger tag is compared
Document image

  • Source of Trigger Value / Source Second Trigger = FromFlowVariable / FromGlobalVariable
    • Trigger Condition = ValueEqualTo / OnValueChangeButExclude / OnValueChangeNotIncluded
      • The user defines the name of the Node-Red flow or global variable which will contain the value against which the tag is compared
    • Trigger Condition = OnValueChangeAndSecondValueEqualTo / OnValueChangeExcludeZeroAndSecondValueEqualTo
      • The user defines the name of the Node-Red flow or global variable which will contain the second trigger condition
Document image


Define the Source of the second Trigger Value

The column labeled Second Trigger Value / Second Variable Name allows the user to define where the value to monitor against the second trigger originates from.

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 Trigger Condition.

  • Trigger Condition = OnValueChange / ValueEqualTo / OnValueChangeButExclude / OnValueChangeNotIncluded
    • The cell will be greyed out and the user does not have to insert a value



Document image

  • Trigger Condition = OnValueChangeAndSecondValueEqualTo / OnValueChangeExcludeZeroAndSecondValueEqualTo
    • The user selects one of two values from a drop-down menu
Document image


Source of Trigger Value

What is the source

Example

ConstantValue

The second trigger is compared against a fixed value.

1



FromFlowVariable

The second trigger tag is compared against the value contained in this Node Red Flow Variable.



Note: This allows users, to be able to modify this value programmatically for example based on a recipe value. Important: The code which updates the flow variable has to be in the same flow tab as the flow monitoring the event configuration.

SecondTriggerValue











FromGlobalVariable

The second trigger is compared against the value contained in this Node Red Global Variable.

Note: This allows users, to be able to modify this value programmatically for example based on a recipe value



Hint: The code which updates the global variable can also be in a different flows tab then the flow monitoring the event configuration.

SecondTriggerValueEvent1





Based on the Trigger Condition, the user selects the source from the drop-down menu.

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 second Trigger Value or Node Red Variable Name

Th column labeled Second Trigger Value / Second Variable Name allows the user to define the value to monitor the second trigger against or define the name of a Node-Red flow or global variable.

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 Second Trigger Value.

  • Source of Second Trigger Value = ConstantValue
    • The user defines the fixed constant value against which the second trigger is compared
Document image

  • Source of Second Trigger Value = FromFlowVariable / FromGlobalVariable
    • The user defines the name of the Node-Red flow or global variable which will contain the value against which the second trigger is compared
Document image


Define the Litmus Message Broker prefix used for publishing the event data

The Litmus solution Litmus Production Record Event Processing Flow will publish the event data for the defined data model Items after a trigger condition has been true using the Litmus Message Broker.

This allows a large degree of freedom when it comes to sending the data to Litmus Production Record Database.

While it is recommended to use a Litmus Integration to the send the event data to Litmus Production Record Database, users can also choose other methods like Node-Red or custom docker applications to handle this task.

To be able to publish the event data using Litmus message Broker, the user needs to define the topic prefix (first part of the topic) under which the event data are published. The topic prefix is configured in the column labeled Topic used when publishing to Message broker.

Document image


The user enters the desired topic into the column labeled Topic used when publishing to Message broker.

Document image


The defined prefix is used to build for each data mode litem a distinct Litmus Message Broker Topic using the unique event name, the Litmus Edge DeviceHub Device name for which the event was observed ending on a combination of the DeviceHub Tag name and the number of the Item it was used to populate.

  • Example: LitmusProRec.SerialNo_Tracking_Asset.Data_Asset1.ExecProgNo_name_Item1

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 Topic 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


Tip

To make it easier to subscribe to the all the topics which are published by the flow from the Litmus solution Litmus Production Record Event Processing Flow , the same topic prefix should be used for all events.

This way, it is possible to use a wildcard

  • LitmusProRec.>

on the topic prefix to make sure to not miss any events.