Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...
Adding or Modifying a Tag Item(s) via JSON
7min
note this requires litmus production record database v 1 4 0 0 or higher use cases 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 method execute stored procedure prorec tag processtagconfiguration using a json object as input note litmus production record database can act similar to an historian and allows to store data for individual defined tags and their meta data input variables variable name datatype description example @jsoninput varchar(8000) a single json object which has include the keys mandatory tagname > the name of a tag devicename > the name of a specific device item > the name of the item of a tag isdecimal > is the value type of the item a decimal/float/real value? isinteger > is the value type of the item an integer value? isstring > is the value type of the item a alphanumeric string? isboolean > is the value type of the item a boolean value? ismeta > is the item a meta data value or a live data value? optional itemdesc > an optional short description of the item initvalue > an optional initial value for the item 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 docid\ qqvgpqkw3ks4zsljys2bj how to use 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 execute \[le productionrecord] \[dbo] \[prorec tag processtagconfiguration] @jsoninput = n' \[{"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}] '; 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 tag processtagconfiguration' order by logid desc; with the result returned