Solutions
...
Litmus Production Record Datab...
Interacting with Litmus Produc...

Creating a backup of a tag definition

6min

Use Cases

User can create backups of individual tag definitions, which will include all the ID's. This can be used to for example create backups of tags which are to be kept in case of a factory reset is done. Or if the database is to be moved to a different server.

After a tag definition has been restored, it is also possible to play back corresponding tag data.

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_Misc_Tag_Hierarchy_Backup

Input Variables

Variable name

Datatype

Description

Example

@Tag

VARCHAR(50)

The name of the Tag. Mandatory!

Can not be NULL or Empty

FaultCode_L2









@Device

VARCHAR(50)

The name of a specific device.



Devices in Litmus Production Record Database are acting the same way as they do in Litmus Edge in grouping tags logically together.



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

How to use

To create a backup of a specific tag definition, call the stored procedure PROREC_Misc_Tag_Hierarchy_Backup 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_Misc_Tag_Hierarchy_Backup] @Tag = N'FaultCode_L2', @Device = N'L1_Machine2_1_MB';

If an output window does exist, the progress can be observed.

tag definition backup
tag definition backup


Result

The stored procedure will verify that the provided values are correct and then create the backup.

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_Misc_Tag_Hierarchy_Backup' Order by LogID Desc;

With the result returned

log entry for tag definition backup
log entry for tag definition backup