Time Series Tag Fetch

In this article we will look at how to ask a source system for its list of time series tags, and import those into P2 Server.

Note: Tag Discovery will not remove tags that have been deleted from the historian. It only updates existing tags and adds new tags.

Server Management

In P2 Server Management, you can fetch tags from the Datasource screen.

Read more: Creating a Tag Datasource

1. Open P2 Server Management, and click the Configuration icon.

2. Click Datasources.

3. Click the datasource containing the tags you want to fetch.

4. On the Datasource page, scroll to the Tags heading and then click the 'Discover Tags' button.

A new Tag Discovery page appears. On this page, complete the following fields as required:

  • Tag Name Filter: Apply a filter to only import tags matching the filter criteria.
  • Batch Size: For adaptors that support batching, specify a batch size.
  • Discovery Options: Override existing tag metadata for description, display range, unit, digital states, and the tag property collection with the metadata from the source system.

Once you have specified all your options, click the 'Discover Tags' button.

Once you start the Tag Discovery process, a summary appears below the 'Discover Tags' button, displaying the progress of the import. When the import is finished, a log view displays all errors and warnings.

You can also click the 'Export CSV' button to make it easier to work through any issues.

 


Tag Discovery Console App

The Tag Discovery console application allows you to fetch tags from historians.

You should run this app whenever you want to fetch tags. Typically, this would be during first-time configuration of P2 Server, and whenever new tags are added to the historian.

Tip: You should consider creating a scheduled task in Windows to do a tag fetch on a regular basis.

The app is normally located at:

C:\Program Files\P2 Energy Solutions\P2 Server\Data Broker\P2.Server.TagDiscovery.Console.exe

Figure 1. Location of the .exe file

Location of the .exe file

To run the application:

1. On the P2 Server machine, open a command prompt (exe).

2. Type the following: P2.Server.TagDiscovery.Console.exe

You can add the following arguments:

datasource="<datasourcename>" The name of the datasource you are using to retrieve the data. This must exactly match the name that was used to configure the datasource in P2 Server Management. This is required.
filter="<filterstring>" Specify a string if you only want to retrieve a subset of the available tags. You can specify an exact match, or you can use a wildcard (if supported by the adaptor and historian). For example, the PI adaptor supports the use of * as a wildcard, so you could specify filter=”zi*” to retrieve any tag beginning with “zi” from PI. The string is not case sensitive. Usage is optional. Default: empty filter string
batchSize=<batchsize> If the Adaptor supports batch tag discovery, specify the size of the batch. Usage is optional. Default: 500.
updateDescription=<true/false> If set to true, this will overwrite the description of the tags in P2 Server with the descriptions of the tags in the external system. Usage is optional. Default: False
updateDataType=<true/false> If set to true, this will overwrite the data type of the tags in P2 Server with the data type of the tags in the external system. Usage is optional. Default: False
/silent Specifying this argument disables user interactivity when running the application. This is useful if you choose to run the application as a scheduled task. This flag must be specified as the last argument otherwise it will be ignored. Usage is optional. Default: False
/winAuth Specifying this argument automatically passes through the Windows user running the console app. Usage is optional. Default: False
updateRanges=<true/false> If set to true, this will overwrite the min/max range of the tags in P2 Server with the min/max range of the tags in the external system. Usage is optional. Default: False
updateProperties=<true/false> If set to true, this will overwrite the custom properties of the tags in P2 Server with the custom properties of the tags in the external system. Usage is optional. Default: False
updateunits=<true/false> If set to true, this will overwrite the units of the tags in P2 Server with the units of the tags in the external system. Usage is optional. Default: False
updateDigitalStateSetTagAssignment=<true/false> If set to true, this will overwrite the digital state set assignment of the tags in P2 Server with the digital state set assignment of the tags in the external system. Usage is optional. Default: False
updateDigitalStateSets=<true/false> If set to true, this will overwrite the digital state set data of the tags in P2 Server with the digital state set data of the tags in the external system Usage is optional. Default: False

The minimum command arguments that need to be supplied are:

P2.Server.TagDiscovery.Console.exe datasource="Pi Server" updateDescription=true

The output will indicate the number of tags retrieved and the time taken.

3. As soon as the application has all of the names back, you will see progress in the command window again. Note: If the historian does not support batch checking for tags (e.g. PI) you will need to wait for the historian to send all of the tags back.

PERFORMANCE NOTE: The time taken to retrieve the tags is highly dependent on network speed and the number of tags. For example, if a historian server is local and has a small number of tags (5000) then this delay will only be 20-30 seconds. If P2 Server is in the USA and the historian is in Australia, then this may take 10-30 minutes for the same 5000 tags.
If you are a long way from the historian server or if it has a large number of tags, as soon as you run the app it may seem to stall – during this time it is calling the historian and the historian is sending back all the names and other information, which may take a while to transfer (around 30 minutes or more).

2 Comments:

  1. Here are some additional arguments for the Tag Discovery Console App:

    filter – optional, defaults to ‘*’
    batchSize – optional, only applies if the Adaptor supports batch tag discovery, defaults to 500
    updateDescription=true/false ; optional, defaults to false
    updateRanges=true/false ; optional, updates range min/max, defaults to false
    updateProperties=true/false ; optional, updates custom properties, defaults to false
    updateunits=true/false ; optional, updates tag units, defaults to false
    updateDigitalStateSetTagAssignment=true/false ; optional, updates tags with their digital state set assignment, defaults to false
    updateDigitalStateSets=true/false ; optional, updates digital state set data, defaults to false

  2. Hi Mike,

    Thank you for your comment. I’m sorry for the delay in getting back to you.
    I have verified the new arguments, and have updated the article; five new arguments added to the table in the Tag Delivery Console App section.

Comments are closed