Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...
Inserting Tag Items if not using Litmus Edge Integration via JSON
6min
note this feature requires litmus production record database v 1 4 0 0 or higher use cases litmus production record database allows for several ways to insert data into its tables the recommended way when using litmus edge, is to make use of the mssql integrations to insert data directly into the table prorec misc transactions as it allows to make use of the integrated store and forward capability, preventing data loss on a connection interruption but for cases, where this is not an option, a stored procedure can be called by a program or code snippet to insert data data any application which provided the capability to use an odbc connection can be used like python c# net excel go java method execute stored procedure prorec misc writeintotransactiontables using a json object as input input variables variable name datatype description example @jsoninput varchar(8000) a single json object which has to always include the keys deviceid > device name associated with the tag registerid > tag name tagname > item name datatype > timestamp in unix millisecond format enclosed by "##" > this is also used to distinguish between a production record item and a tag value > value for the tag success > quality of the tag (1 = good, 0 = bad) or an array of json objects for multiple inserts \[{"deviceid" "p2 electrical panel","registerid" "l3 machine3 1 s7 power","tagname" "value","datatype" "##1694688509846##","value" "43 39283446097687","success" "1"},{"deviceid" "p2 electrical panel","registerid" "l3 machine3 1 s7 speed","tagname" "value","datatype" "##1694688519848##","value" "52 524841352846764","success" "1"}] how to use to insert a value(s) for production tag item(s) via json, call the stored procedure prorec misc writeintotransactiontables using the t sql exec or execute keyword and provide the input variable below is an example using t sql in sql server management studio exec \[le productionrecord] \[dbo] \[prorec misc writeintotransactiontables] @jsoninput = n' \[{"deviceid" "p2 electrical panel","registerid" "l3 machine3 1 s7 power","tagname" "value","datatype" "##1694688509846##","value" "43 39283446097687","success" "1"},{"deviceid" "p2 electrical panel","registerid" "l3 machine3 1 s7 speed","tagname" "value","datatype" "##1694688519848##","value" "52 524841352846764","success" "1"}] '; result the stored procedure will verify that the provided values are correctly formatted and then write them into the table prorec prorec transactions this will trigger their immediate processing the result can be read back from the log table prorec tag 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 tag log] order by logid desc; with the result returned for more detailed logging, enable the "debug log" option for verbose logging as described in reading out the application configuration of litmus production record database docid\ evlxiglsvxjkjcqsgf2pp and modify application configuration items docid\ nizz5qavwknlczz51008q