New Feature - Tag Report Tool

I think for now you will have to live with the Tag Hierarchy stuff that is being added for 8.1.23. The Tool will have a right click option for View Tag Hierarchy that will bring up this type of information in a separate dialog that would give you this type of insight/editing capabilities.

Garth

1 Like

I think I can live with 10x better than my idea :smile:
Looks awesome!

I have a script already which can read relative tags/properties from a tag path which I can use to read these typeIds, e.g.

TagPath ../TypeId ../../TypeId ../../../TypeId
Pump A/PID/SP Devices/PID Devices/Motors/VSD-Danfoss_ENet_2Dir

Where:
../TypeId = type id of Pump A/PID
../../TypeId = type id of Pump A
../../../TypeId = type id of nothing...

I can run a report and it will return numeric values, but I can't seem to get it to work for strings. I tried using =, Like, wrapping in quotes, using a wildcard, etc. Nothing seems to return a tag with a specific string value. Is this a bug, or am I missing something?

It isn't clear to me if this is expected or not, or if it is a bug at this point. I have an open question with the developer about if Value only works with numeric value because we have to be able to do comparisons and know it is a number (kind of like Alarm triggers).

As a work around, if you search for Qualified Value like *<string>* you will be able to find the tags you are looking for. Make sure to use the asterisks as a wild card as the qualified value has more information than just the value.

I will follow up when I have more of a definitive answer on if this is intentional.

Garth

1 Like

Thanks @ggross that is a simple enough workaround and solution if the current method(s) stands.

I have another question, is it possible to use the tag report tool to return tags with a custom property, or even further, tags with a specific custom property?

We have added a bug to fix string values not returning in comparison searches and it will be prioritized by our product owners.

Custom fields should be searchable. While they will not be populated in the list of selectable properties, you can manually type in the property you are looking for on the left hand side of the search area:
Example 1: Search would return any tags that have CustomTest as a set property.


Example 2: Search would return any tags that have a CustomTest property set to abc:

If you search for the column, it should also pop up as a field in the export options as well, or you can manually add it there as well.

Garth

2 Likes

Is there a way to do a tag export with the results from the tag report tool? Or is that a feature that could be added?

I have had scenarios where the report properly returns the tags I am querying for. However, I noticed there is a change that needs to be made to the parameters of the tags. Unfortunately, the multi-tag edit tool doesn't work on parameters. I was hoping to export the tags from the report tool, make the correction, and then reimport the tags. I know this is just one example, but I could see where this could be useful for various reasons.

@ggross sorry for the repeated questions. Is it possible to have two properties and return results if either are "true"?

For example, in a UDT I have a member MyName and the same may exist in a tag as a custom property.

image

When I export the script I noticed an option under for properties for and. I assumed changing to or would allow this, but doesn't work. Are there any ways to create multiple properties and then determine and/or?

"properties": {
      "and": [
        [
          "name",
          "Equal",
          "MyName"
        ]
      ],
      "defined": [
        "MyName"
      ]
    }
  },

There is not currently a way in the UI or scripting to do OR searches. The API is built in a way where it could be added in the future, but there were issues that prevented it from being available for the initial release and we don't currently have it hooked up behind the scenes. This is functionality that we hope to add in the future.

The only workaround for this would be to use scripting to run two separate queries and combine the results.

Garth

2 Likes

@ggross, following up with this post:

While it isn’t currently possible to export tags from the tag report tool, it is something that I found myself asking for a couple weeks back when attempting to troubleshoot an issue with support. We have a ticket open to add that feature, but we don’t have a set timeframe of when it will get worked on.

Garth

Managed to get pretty close to what i need for identifying any tags that have alarms overriden, using the following tag report:

{
  "query": {
    "options": {
      "includeUdtMembers": true,
      "includeUdtDefinitions": false
    },
    "condition": {
      "attributes": {
        "values": [
          "alarm",
          "override"
        ],
        "requireAll": true
      },
      "properties": {
        "and": [
          [
            "alarmEvalEnabled",
            "Equal",
            "true"
          ]
        ],
        "overridden": [
          "alarms"
        ]
      }
    },
    "returnProperties": [
      "tagQueryOverrides"
    ]
  },
  "columns": [
    {
      "alias": "",
      "key": "path",
      "type": "property",
      "visible": true,
      "width": 492
    },
    {
      "alias": "",
      "key": "tagQueryOverrides",
      "type": "property",
      "visible": true,
      "width": 465
    },
    {
      "alias": "",
      "key": "override",
      "type": "trait",
      "visible": false,
      "width": 76
    }
  ]
}

One thing i'm struggling with at the moment is searching for a custom alarm property, such as one i've defined as "AlarmClass" shown below in a JSON copy of the tag. Is this possible?
image

This didn't return any results when adding it to the existing report:
image

The tag report tool doesn't have access to the individual properties within a tag's alarm, it only knows that and alarm exists on the tag. Because of how things are modeled, adding the ability to search these properties takes a significant amount of additional work to make work. It is something we hope to add one day. The one thing that probably should work that I will open a bug for is:

Alarms like *AlarmClass*

When Alarms is shown in the table or exported into a CSV, we include the String representation of the Alarm properties. I will discuss it with one of the developers tomorrow.

Until any change is made, the best we could do is modify a scripting function to return the results. If the goal is to modify the results, I know that isn't helpful, but adding something like the following to the query you produced would provide information about the tags you are looking for:

new_results = []

for result in results:
	if 'alarms' in result:
		for alarm in result['alarms']: 
			if alarm.has_key('AlarmClass'):
				new_results.append(result)
			
print new_results

Garth

2 Likes

Awesome thank you. This should do what we need for now. Just trying to identify overridden alarms so we can make sure changes to our parent UDTs get manually updated on these too.

Overrides are a tricky thing.. perhaps we'll need to review how we use them with UDTs.

Tool is amazing though, thank you so much for all the work being put into it.

Potential bug:
If you sort the results of the report tool, then double click to edit, it seems to open the wrong tag.

Right click, edit seems to work fine.

I think I reported this before but it might not have been picked up. But it appears to open the unsorted row's tag :frowning:

1 Like

It's a bug...We fixed it once before release, not sure how it got back in but it will get fixed.

Garth

Is there a .getDataset() equivalent planned for the returned "results" object?
Scripting reference page of manual doesn't seem to contain a section for this yet.
Trying to export the results to Excel via the scripting method, same as it would when exporting directly from Tag Report Tool GUI.

Greetings to all! We appreciate you taking the time to share your thoughts and valuable feedback on this feature post/thread! As the feature has been out for a while now, we've been collecting a multitude of responses and reviewing them. We would like to conduct another round of survey to help us identify further areas of improvement and prioritize which issues need the most attention first. The survey will take no more than 5 minutes of your time, and your input would be greatly appreciated! Thank you.

Take Survey on Tag Report Tool

3 Likes

On 8.1.28.
I have been battling something for a while and I have narrowed it down:

I want to search for a name and a value, this is the script:

provider = 'default'
limit = 100

query = {
  "options": {
    "includeUdtMembers": True,
    "includeUdtDefinitions": False
  },
  "condition": {
    "attributes": {
      "values": [],
      "requireAll": True
    },
    "properties": {
      "op": "Or",
      "conditions": [
        {
          "op": "And",
          "conditions": [
            {
              "prop": "name",
              "comp": "Equal",
              "value": "MyTagName"
            },
            {
              "prop": "value",
              "comp": "Equal",
              "value": "[1, Good, Sun Jul 16 09:47:08 EDT 2023 (1689515228005)]"
            }
          ]
        }
      ]
    }
  },
  "returnProperties": [
    "tagType",
    "quality"
  ]
}

results = system.tag.query(provider, query, limit)

Screenshot for the tag report tool:
image

I have noticed sometimes it works, other times it doesn't. Currently I am using Top Server in simulation mode. If I read the qualified value it comes back as:

[true, Good, Sun Jul 16 09:46:04 EDT 2023 (1689515164393)]

But, no results from the tag report tool. If I change the tag to memory the qualified value looks no different (except for the timestamp), but the tag report tool returns what it should.

I see nothing in the tag diagnostics that suggest something is wrong. Any ideas on why this is happening? @ggross