Adding or Modifying a Data Model Item
Litmus Production Record Database makes use of Data models based on ISA-88 to store and publish Event data.
To be able to store event data, such a data model has to be configured 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_ProRec_ProcessConfiguration
Do learn more about the data model concept and how to define it, please read the document Core Concept behind recording production record data via data model
Variable name | Datatype | Description | Example |
---|---|---|---|
@Node | VARCHAR(50) | The name of the root Node and the name of the data model. Mandatory! Can not be NULL or Empty | DownTime |
@NodeDesc | VARCHAR(256) | An optional short description of the model. Can be used to share some information about the model with other users, Can be set to NULL. | Downtime recording for all assets. |
@Level1 | VARCHAR(50) | The name of the first sub level in the ISA-88 based data model hierarchy. This is optional and can be set to NULL if the Item is located under the @Node. | Main_Classification |
@Level1Desc | VARCHAR(256) | An optional short description of Level1. Can be used to share some information about the purpose of set sub level, Can be set to NULL. | 'Holds Information about the main classification of a downtime' |
@Level2 | VARCHAR(50) | The name of the second sub level in the ISA-88 based data model hierarchy. This is optional and can be set to NULL if the Item is located under the @Level1. | Sub_Classification |
@Level2Desc | VARCHAR(256) | An optional short description of Level2. Can be used to share some information about the purpose of set sub level, Can be set to NULL. | Holds Information about the sub classification of a downtime |
@Level3 | VARCHAR(50) | The name of the third sub level in the ISA-88 based data model hierarchy. This is optional and can be set to NULL if the Item is located under the @Level2. | NULL |
@Level3Desc | VARCHAR(256) | An optional short description of Level3. Can be used to share some information about the purpose of set sub level, Can be set to NULL. | NULL |
@Level4 | VARCHAR(50) | The name of the fourth sub level in the ISA-88 based data model hierarchy. This is optional and can be set to NULL if the Item is located under the @Level3. | NULL |
@Level4Desc | VARCHAR(256) | VARCHAR(256) An optional short description of Level4. Can be used to share some information about the purpose of set sub level, Can be set to NULL. | NULL |
@Level5 | VARCHAR(50) | The name of the fifth sub level in the ISA-88 based data model hierarchy. This is optional and can be set to NULL if the Item is located under the @Level4. | NULL |
@Level5Desc | VARCHAR(256) | VARCHAR(256) An optional short description of Level5. Can be used to share some information about the purpose of set sub level, Can be set to NULL. | NULL |
@Item | VARCHAR(50) | The name of the Item which represents the value. Mandatory! Can not be NULL or Empty | FaultCode |
@ItemDesc | VARCHAR(256) | An optional short description of the Item. Can be used to share some information about the Items purpose with other users, Can be set to NULL. | The fault code returned by the asset |
@ItemEng | VARCHAR(20) | An optional engineering unit for items. This can be used to provide some additional context for the value recorded. | NULL |
@isTime | BIT | Is the value type of the Item a time stamp? Mandatory! Can not be NULL or Empty An Item can only have one data type. Therefore only one of these 4 values can be 1, while the others are 0: @isTime @isNumeric @isString @isBoolean | 0 |
@isNumeric | BIT | Is the value type of the Item a numeric value? This includes both Integer and Float values. Mandatory! Can not be NULL or Empty An Item can only have one data type. Therefore only one of these 4 values can be 1, while the others are 0: @isTime @isNumeric @isString @isBoolean | 1 |
@isString | BIT | Is the value type of the Item a alphanumeric string? Mandatory! Can not be NULL or Empty An Item can only have one data type. Therefore only one of these 4 values can be 1, while the others are 0: @isTime @isNumeric @isString @isBoolean | 0 |
@isBoolean | BIT | Is the value type of the Item a boolean value? This includes combinations of:
Mandatory! Can not be NULL or Empty An Item can only have one data type. Therefore only one of these 4 values can be 1, while the others are 0: @isTime @isNumeric @isString @isBoolean | 0 |
@isID | BIT | Is this Item an Identifier? Mandatory! Can not be NULL or Empty Possible Values: 1 = Yes 0 = No To learn more about Identifiers, please read this document. | 0 |
To insert a data model item, call the stored procedure PROREC_ProRec_ProcessConfiguration 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