Is using the "Enabled" status of a tag for visibility animation possible?

I have a template I've made for scanners on a conveyor system. This takes in a UDT of type "scanner" as a custom property and displays the different info that is contained in the scanner tag. I have a template repeater to display templates for all scanners in the system. The issue is that some of these scanners are used in tandem with one another, so some of the data doesn't necessarily need shown for that particular scanner (read rate, consecutive no-reads, etc...). If I have a tag of the scanner UDT disabled in that particular instance of the UDT (overridden to disable), can I base animation of the data display (visibility/enabled property) on that "enabled" property of my scanner sub-tags?

TL;DR: Can I bind an object's visibility or "enabled" property to the "enabled" property of an ignition tag?

My other option would be to add separate tags to my scanner UDT that indicate what needs shown, but I'd rather keep the UDT clean and not do that.

The answer to you're question is Yes you can bind an objects visibility or "enabled" property to the "enabled" property of a tag.

Have you tried to do this and it didn't work as expected?

1 Like

I just tried what you're probably talking about and did see it is able to work when binding to a specific tag. I'm trying to bind to a custom property, which is a tag being passed into my template. I don't see a place to select the "enabled" property of a tag in the property binding but I did see it in the tag binding.

Use and indirect tag binding. I just threw this onto a power table, because that happens to be what I am working on, but I think it illustrates what is needed.

2 Likes

I did exactly that. Luckily I already had the tag path as the main Template parameter and then the scanner type is an internal parameter which pulls from that tag path. The binding allows he .enabled to be selected, but when I disable the tag in the tag browser to test, I get the diagnostic error that the intValue is Bad_Disabled. And the numeric display doesn't go invisible. It just goes grey with the tag icon (ignore all the red, just look at "No Response Count" label and numeric display).

It seems like disabling the tag makes the reference to one of its properties bad.

Maybe you want a binding using isGood instead?

3 Likes

Because it is disabled. You will probably have to Opt-out of the overlay.

Or perhaps the isGood() expression will negate the need for that.

1 Like

maybe you could try using the isGood() expression function?

Paul, beat me to it :stuck_out_tongue:

1 Like

So first, the weird thing is that the No Response Count label didn't show a diagnostic issue with the visibility based on the "enabled" value when the tag is disabled (the previous screenshot did not include the correct animation on the label). It just doesn't animate on/off properly, but with no indication of why.

I tried the overlay opt-out, which I'd not known about before. Very helpful to know about, but didn't work like I needed here. It took the error overlay away, but still didn't allow the invisibility.

I then tried the isGood() test which does work, but I'm concerned about when there truly is a problem with the data quality of a tag that isn't disabled. I really only want it invisible if it's disabled. If there is a different error value, I'd like it to visibly indicate that via the overlay for diagnostic purposes. I'll try and see if I can just check for the value to equal "Bad_Disabled".

isGood() worked, but I'm concerned it's too broad of an assessment

In an expression, you can use qualityOf to match against a specific code:
https://docs.inductiveautomation.com/display/DOC81/qualityOf

e.g. qualityOf({path/to/tag}) == "Bad_Disabled"

2 Likes

I believe that's exactly what I'm looking for. I'm sure there might be a better approach to this whole thing, but for now that's gonna work for me. Thanks for all of your help!