Indirect Tag History Binding Expression

I am trying to create an expression for an indirect history tag binding in perspective since there isn't the button option (which should be a feature).
I have successfully created an indirect binding expression for a regular tag


However when I try to connect to the History Tag I get an Expression Eval Error

In the docs they say to use this formatting for the tag path, but then I just get a Configuration Error, do I need an aggregation or an alias if I don't need to use them? What would I put in aggregate if I don't want it to be aggregated. I still get a Configuration Error anyway.

Please provide actual examples not just a link to the docs, I have read the docs and am still having issues

When you hover over Error_Expression what message is displayed?

I think there's two fundamental things that you're missing, one of which is (in my opinion) really, really bad UX on our part.

  1. The 'Expression' mode for a tag history binding expects you to author an expression that returns a well formatted tag history configuration object. Since you currently cannot [1] create arbitrary array and object literals in expressions, your tag history binding expression must point to some other custom property literal. There's literally no other way to use expression mode.

  2. You must specify an aggregation function when working with our historian. The historian always uses some kind of compression when storing literal values [2]. The aggregation mode used in your tag history binding is either the 'Query Mode' you specify in the dropdown at the top, or the aggregation function defined per tag. If you don't want to specify an aggregation mode, just omit the key in the object you're returning via the expression. Fair play - I didn't know that it was possible to do that until I dug into the code just now.


  1. without custom modules, see @pturmel's Integration Toolkit module ↩︎

  2. ↩︎

4 Likes

With just the tag string I get the expression error which I assume is telling me I need to do the full list


I'm getting this configuration error talking about the left bracket. I am also getting it on a different binding too which is just a single property from the view, shown below.

Sorry, I don't know and I can't experiment at the moment.

Go back and read PGriffith's reply again. You simply cannot construct lists of maps in an expression binding using jython syntax. Not supported.

If you install my Integration Toolkit module, you could use the following expression:

asList(
	asMap(
		'aggregate', 'Average',
		'alias', 'Cycle Time',
		'path', '[SQLServer/ignition-srv-mnet:default]oee/modbus/074/35/cycle_time'
	)
)

If you don't use my module, you must construct the correct list of maps in a separate property, and reference that separate property in the binding.

3 Likes

Where should I put this other custom property literal (should it be a custom property?) ? and can you provide an example of what would be in this property (would it be the list and I just have to reference it)?
I tried creating a custom property and referencing it, now I get a Expression Error. The docs just said to copy paste it, but I assume I need to change the array structure

This discussion helped by providing examples in their replies
Sparkline Dynamic Tag History Expression Binding - Ignition - Inductive Automation Forum

2 Likes