Multistate indicator not binding correctly

The issue with templates is I'm trying to modify the windows programmatically, which means at some level, as I understand it, I need to actually modify/interface with the XML.

I've already built reliable mechanisms for several pieces, tanks are proving a larger challenge though.

This is a really bad idea. This part of Ignition has a load of technical debt that will crucify you. If you want to generate template instances programmatically, use the Template Canvas with explicit positioning, using a scripted dataset to drive it.

1 Like

How would I go about making this work from script?

I.e. say I generate templates for a number of common components (which would honestly just be some standard ignition objects with everything parametrizable), then I want to have an external program induce the placement of those objects onto a project window --
is there some way to have maybe a webapp route or similar that gets called to place those templates?

Templates don't quite do what I want, at least naively --
e.g. the params of templates don't allow for one of the parameters to be a tag path, etc

Probably easier to have the given window run a local executable (this is Vision) to retrieve the data with which to populate the template. (CSV, perhaps.)

Why do you think this? Template parameters are often tag paths. They are just strings.

For the template repeater, you'd just make one of the column names of the driving dataset match your parameter names. For the template canvas, you will have to JSONencode parameters, but still relatively straightforward.

How would I actually set up a template such that one of its params is a string tag path, and an element inside the template uses the tag corresponding to that path? I have 'tagpath' as a template param, but attempting to link to template.tagpath doesn't work, and putting it as the expression value just gives me the actual string, not its eval.

That's what indirect tag binding is for.

1 Like

Edit: Wow simultaneous post.

1 Like

Consider putting your entire dynamic code generation effort on hold. You should not be creating new windows at runtime. Ignition is really not set up to support that.

Use the dynamic layout components that Ignition provides. (Template canvas in Vision, View Canvas in Perspective.)

1 Like

Thanks! Can I use this to produce the entire tagpath?
Something like the below:

Yes. Try it.

It doesn't quite seem to be working --
deviceconnupdate_2025-02-24_1500.zip (10.2 KB)
I can't find any configuration of tagpath and link to slider that gets this slider to actually connect (I have the tags set up properly, other sliders can link to them)

Can you send an example of fully indirect tagpathing that works? e.g. with the ignition example tags