Adding or Modifying a Tag Item
To store Tag data inside Litmus Production Record Database, Tags and their Device association together with the Item's to be stored have to be setup.
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_Tag_ProcessTagConfiguration
Litmus Production Record Database can act similar to an Historian and allows to store data for individual defined tags and their meta data.
Variable name | Datatype | Description | Example |
---|---|---|---|
@TagName | VARCHAR(50) | The name of a tag. Tag names can occur several times for different devices but have to be unique per device Mandatory! Can not be NULL or Empty | isRunning |
@DeviceName | VARCHAR(50) | The name of a specific device. It is recommended to use the same device name as used in Litmus Edge Mandatory! Can not be NULL or Empty | L1_Machine2_1_MB |
@Item | VARCHAR(50) | The name of the Item of a tag. Tags are not limited to their value but can be comprised of a large number of individual items to provide the right context. This can include meta data, data which do not change frequently, such as a description, limits, area or plant. As well as live data such as the process value, setpoint, alarm status or the results of calculations. Mandatory! Can not be NULL or Empty | Process_Value |
@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. | Process value of the tag |
@isDecimal | BIT | Is the value type of the Item a decimal/float/real value? An Item can only have one data type. Therefore only one of these 4 values can be 1, while the others are 0: @isDecimal @isInteger @isString @isBoolean | 1 |
@isInteger | BIT | Is the value type of the Item an integer value? An Item can only have one data type. Therefore only one of these 4 values can be 1, while the others are 0: @isDecimal @isInteger @isString @isBoolean | 0 |
@isString | BIT | Is the value type of the Item a alphanumeric string? An Item can only have one data type. Therefore only one of these 4 values can be 1, while the others are 0: @isDecimal @isInteger @isString @isBoolean | 0 |
@isBoolean | BIT | Is the value type of the Item a boolean value? This includes combinations of:
An Item can only have one data type. Therefore only one of these 4 values can be 1, while the others are 0: @isDecimal @isInteger @isString @isBoolean | 0 |
@isMeta | BIT | Is the Item a meta data value or a live data value? Possible Values: 1 = Yes 0 = No | 0 |
@initValue | VARCHAR(256) | An optional initial value for the item. This is most commonly used for meta data items, as they have often no other source. For live data, this is typically not used, as the data are frequently written into the database from a | |
To insert a tag item, call the stored procedure PROREC_Tag_ProcessTagConfiguration 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