Adding or Modifying a Tag Item(s) via JSON
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
Execute Stored Procedure PROREC_Tag_ProcessTagConfiguration using a JSON object as Input.
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 |
---|---|---|---|
@JSONInput | VARCHAR(8000) | A single JSON object which has include the keys: Mandatory:
Optional:
Users can also provide an Array of JSON objects for multiple inserts. | [{"TagName":"L3_Machine3_1_S7_Power","DeviceName":"P2_Electrical_Panel","Item":"Value","isDecimal":true,"isInteger":false,"isString":false,"isBoolean":false,"isMeta":false,"initValue":"43.39283446097687","initTime":1694688509846,"initSuccess":true},{"TagName":"L3_Machine3_1_S7_Power","DeviceName":"P2_Electrical_Panel","Item":"Value","isDecimal":true,"isInteger":false,"isString":false,"isBoolean":false,"isMeta":false,"initValue":"52.524841352846764","initTime":1694688519848,"initSuccess":true}] |
For a more detailed explanation of the content to be provided by each key, please read the document Adding or Modifying a Tag Item.
To insert a tag item(s) using JSON, 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