Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...
Adding or Modifying an Event definition
7min
use cases 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 method execute stored procedure prorec event processeventconfiguration note do learn more about the event monitoring concept and how to define it, please read the document input variables 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 equalto onchange greaterthan smallerthan greaterequalthan smallerequalthan 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 timeoftrigger isconstant valuefromtag iscalculation 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 average maximum minimum standarddeviation median sum mode 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 how to use 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 execute \[le productionrecord] \[dbo] \[prorec event processeventconfiguration] @eventnodename = n'downtime', @eventname = n'downtimel1m2', @eventdescription = n'down time recording for asset l1m2', @triggerconditionname = n'startdowntimel1m2', @triggertag = n'l1 machine2 1 mb|isrunning|process value', @condition = n'equalto', @conditionvalue = n'1', @eventprorecitem = n'downtime|main classification|sub classification|faultcode', @isidentifier = 1, @atstart = 1, @itemvaluesource = n'isconstant', @itemvalue = n'unclassified', @calculationtype = null, @timeframestartitem = null, @timeframeenditem = null; result 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 select top (100) \[logid] ,\[logtype] ,\[logprocedure] ,\[logentry] ,\[logtime] from \[le productionrecord] \[dbo] \[prorec misc log] where \[logprocedure] = 'prorec event processeventconfiguration' order by logid desc with the result returned