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

Reading out Tag definitions

8min

Use Cases

Reading out the Tag definition can be used to verify what Tags do exist and what items and Meta Data are defined. This is most useful, when creating a new Tag or wanting to modify an existing Tag.

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.

Method

Run SELECT query with Function PROREC_Tag_GetTags as FROM clause.

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

@TagName

VARCHAR(50)

The name of a tag.



Tag names can occur several times for different devices but have to be unique per device

If no specific TagName is to be queried or to get a list of TagName's, the value can also be DEFAULT which will assume the value %.

isRunning















DEFAULT

@DeviceName

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

If no specific DeviceName is to be queried or to get a list of DeviceName's, the value can also be DEFAULT which will assume the value %.

L1_Machine2_1_MB



























DEFAULT





How to use

To read out all or a specific tag definition, execute a SELECT statement from the function PROREC_ProRec_GetTags providing all the required inputs. Below is an example using T-SQL in SQL Server Management Studio:

SELECT * FROM [LE_ProductionRecord].[dbo].[PROREC_Tag_GetTags ] ( DEFAULT ,DEFAULT);

Result

The function returns a table as result.

Document image


Additional Options

It is possible to reduce the number of columns returned by the SELECT statement. Below is an example using T-SQL in SQL Server Management Studio:

SELECT TagName, DeviceName, TagItemName FROM [LE_ProductionRecord].[dbo].[PROREC_Tag_GetTags] ( DEFAULT ,'L2_Machine1_1_MB');

This will reduce the number of columns returned to only the four selected.

Get reduced tag definition
Get reduced tag definition


It is possible to sort data based on users requirements returned by the SELECT statement. Below is an example using T-SQL in SQL Server Management Studio:

SELECT TagName, DeviceName, TagItemName FROM [LE_ProductionRecord].[dbo].[PROREC_Tag_GetTags] ( DEFAULT ,'L2_Machine1_1_MB') order by TagName asc;

The result will be a table, where all rows are sorted by their Tag Name in ascending order.

Document image