Adding or Modifying an Event definition
Litmus Production Record Database is capable of monitoring tag data for production events and then record these events.
This does require to setup an event definition which includes what trigger to monitor and what to collect first.
User can do this either by using applications such as:
- Microsoft SQL Server Management Studio
- MSSQL CLI
This can also be used for building custom solutions based on applications which allow for an ODBC connection such as:
- Excel
- C#
- .Net
- Python
Litmus does provide such as custom solution which can be downloaded from our Central Portal.
Execute Stored Procedure PROREC_Event_ProcessEventConfiguration
Do learn more about the event monitoring concept and how to define it, please read the document
Variable name | Datatype | Description | Example |
---|---|---|---|
@EventNodeName | VARCHAR(50) | The name of the root Node of a data model. Mandatory! Can not be NULL or Empty | DownTime |
@EventName | VARCHAR(50) | The unique name of the Event. Mandatory! Can not be NULL or Empty | DownTimeL1M2 |
@EventDescription | VARCHAR(256) | An optional short description of the event. Can be used to share some information about the event with other users, Can be set to NULL. | Down time recording for asset L1M2 |
@TriggerConditionName | VARCHAR(50) | The name of the trigger condition. Trigger Condition names have to be unique per event. Mandatory! Can not be NULL or Empty | StartDownTimeL1M2 |
@TriggerTag | VARCHAR(256) | Pipe symbol "|" separated definition of the device, tag and item which is the trigger to be monitored. Mandatory! Can not be NULL or Empty | L1_Machine2_1_MB|isFaulted|Value |
@Condition | VARCHAR(50) | The condition for which the trigger tag is to be monitored for. Possible Values:
Mandatory! Can not be NULL or Empty | equalTo |
@ConditionValue | VARCHAR(256) | The value to monitor the tag for, if the condition is not 'onChange'. Mandatory for all Conditions except 'onChange' ! | 1 |
@EventProRecItem | VARCHAR(512) | Pipe symbol "|" separated definition of the data model item. This includes the node name. If the item is defined under a specific hierarchy level, then all the level names. And the item name. Mandatory! Can not be NULL or Empty | DownTime|Asset |
@isIdentifier | BIT | Is this Item an Identifier? Possible Values: 1 = Yes 0 = No To learn more about Identifiers, please read this document. | 1 |
@atStart | BIT | If the trigger does execute, is the item written to a new event (creates a new Production Record ID) or is it written to the previous event. Possible Values: 1 = Yes 0 = No | 1 |
@ItemValueSource | VARCHAR(50) | Defines the source for the item once a trigger does fire. Possible Values:
Mandatory! Can not be NULL or Empty | isConstant |
@ItemValue | VARCHAR(256) | The value for the item corresponding with the value source. Options are: @ItemValueSource = TimeOfTrigger -> @ItemValue = NULL @ItemValueSource = isConstant -> @ItemValue = a constant value @ItemValueSource = ValueFromTag -> @ItemValue = Pipe symbol "|" separated definition of the device, tag and item which is the trigger to be monitored. @ItemValueSource = isCalculation -> @ItemValue = Pipe symbol "|" separated definition of the device, tag and item which is the trigger to be monitored. | L1_Machine2_1_MB |
@CalculationType | VARCHAR(52) | If the @ItemValueSource is 'isCalculation', define the type of calculation. Possible Values:
Can be set to NULL if ItemValueSource is not 'isCalculation'. | NULL |
@TimeFrameStartItem | VARCHAR(512) | If the @ItemValueSource is 'isCalculation', define which data model item will provide the start time for the required time period. This is defined as a Pipe symbol "|" separated definition of the data model item. This includes the node name. If the item is defined under a specific hierarchy level, then all the level names. And the item name. Can be set to NULL if ItemValueSource is not 'isCalculation'. | NULL |
@TimeFrameEndItem | VARCHAR(512) | If the @ItemValueSource is 'isCalculation', define which data model item will provide the end time for the required time period. This is defined as a Pipe symbol "|" separated definition of the data model item. This includes the node name. If the item is defined under a specific hierarchy level, then all the level names. And the item name. Can be set to NULL if ItemValueSource is not 'isCalculation'. | NULL |
To insert an event, call the stored procedure PROREC_Event_ProcessEventConfiguration using the T-SQL EXEC or EXECUTE keyword and provide the Input variables. Below is an example using T-SQL in SQL Server Management Studio:
The stored procedure will verify that the provided values are correctly formatted and then create any new node, levels and items or modify existing items.
The result can be read back from the log table PROREC_Misc_Log.
Below is an example using T-SQL in SQL Server Management Studio:
With the result returned