HistoryEnabled binding expression

I have a structured UDT, with many tags that needs to be historicized, but I wish to add also a configuration tag to turn on or off the historyEnabled property of those tags all at once. I thought the syntax was simple like “{[.]histEnabled}”, which works fine for an expression tag pointing to the tag “histEnabled”, but setting this as the expression binding on the historyEnabled property doesn’t work. I tried also other expressions, like tag(’’), or {}, but doesn’t work in any way.
Is it even possible to do what I’m trying to do? I’m using v8.1.11

1 Like

One thing to keep in mind is that [.] is a relative path for the folder that the expression tag is located in. Tag Paths - Ignition User Manual 8.1 - Ignition Documentation

If you’re using an expression binding in either Vision or Perspective, then you would need to use the entire tag path in the {}.
https://docs.inductiveautomation.com/display/DOC81/Expression+Bindings+in+Perspective#ExpressionBindingsinPerspective-Example1

Hello and thanks for replying. Sorry I was not much clear: the binding I’m trying to make is within tags inside a UDT, there’s no Vision or Perspective binding involved.

Here’s an example of what I mean: in this UDT there’s a boolean historyEnabled memory tag, and the tag “value” which is another memory. I wish to bind the “History Enabled” property of the tag “value” to the tag “historyEnabled”

To do that I tried this syntax:

tag(stringformat('%s/historyEnabled', {PathToParentFolder}))

which is surely correct, for a normal binding expression. To check this, I added the expression tag “historyEnabledExpr”, and the expression has the same syntax shown above.
This is the result:

As you can see, the historyEnabledExpr tag has value “true”, which means the above expression is correct. Instead, the history enabled property of the tag “value” evaluates to null, which means that the above expression is not correctly evaluated for that binding.

I get the same exact result when using this simpler expression:

{[.]historyEnabled}

The only thing I could be able to bind to, from a tag’s property binding expression, is a UDT parameter. Is it a bug or it’s simply not possible to do what I’m trying to do? I could be wrong, but for what I remember in older 7.9 versions of Ignition it was possible to do that.

The only thing I could be able to bind to, from a tag’s property binding expression, is a UDT parameter. Is it a bug or it’s simply not possible to do what I’m trying to do?

It is not a bug. The type of binding that you are looking at is called a parameter binding. The editor does look a bit similar to Expression's editor, but it does not have access to any of expression language's functions. It is specifically used to create formatted strings with references to UDT parameters.

Oh sorry, I really didn’t noticed that info box :sweat_smile: Thanks you!
So I guess that the only way to set those properties dynamically is through custom script, right?

You can use a derived tag to reference other properties of a tag besides the Value property like History Enabled. You can use a boolean derived tag and for the Source Tag Path you can browse the tag you’d like to reference. Then at the end of the tag path, add “.HistoryEnabled” to reference that property.