# Indirect binding for the multiple screens and trends without using UDT and template repeater

**URL:** <https://forum.inductiveautomation.com/t/indirect-binding-for-the-multiple-screens-and-trends-without-using-udt-and-template-repeater/95524>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [September 4, 2024, 12:46pm UTC](https://forum.inductiveautomation.com/t/indirect-binding-for-the-multiple-screens-and-trends-without-using-udt-and-template-repeater/95524 "2024-09-04T12:46:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Govind\_Suthar1](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@Govind\_Suthar1](https://forum.inductiveautomation.com/u/Govind_Suthar1)\
**Post date:** [September 4, 2024, 12:46pm UTC](https://forum.inductiveautomation.com/t/indirect-binding-for-the-multiple-screens-and-trends-without-using-udt-and-template-repeater/95524/1 "2024-09-04T12:46:37Z")

</div>

Hello everyone,

The production line consists of a batch-processing machine connected to an ignition platform. A batch processing machine has multiple lines, such as line = A, line = B, line = C, and line = D. All lines have identical graphics for monitor and control purposes.

So, how can you configure only one graphic and bind the data using indirect tag binding instead of creating multiple graphics for multiple lines without using template repeaters and UDTs?

How to configure only one main trend instead of creating multiple trends line-wise?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 4, 2024, 1:02pm UTC](https://forum.inductiveautomation.com/t/indirect-binding-for-the-multiple-screens-and-trends-without-using-udt-and-template-repeater/95524/2 "2024-09-04T13:02:36Z")

</div>

> [@Govind\_Suthar1](#):
>
> without using template repeaters and UDTs?

Why? They are very powerful tools that make design simpler.

> [@Govind\_Suthar1](#):
>
> So, how can you configure only one graphic and bind the data using indirect tag binding instead

All that is important here is that the tag paths have a similar structure.

So for instance, something like: `'Plant\Line_A\Status'` would be easy to indirectly bind, you just add a custom property to the window/component and use that to hold the value of the Line you want to be shown.

> [@Govind\_Suthar1](#):
>
> How to configure only one main trend instead of creating multiple trends line-wise?

This is a little more difficult, but still doable, and the method is still basically the same. Exactly how you do it depends on how your system is set up.

What have you tried doing and what result did you get and how was that result different from your desired outcome?

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 4, 2024, 9:11pm UTC](https://forum.inductiveautomation.com/t/indirect-binding-for-the-multiple-screens-and-trends-without-using-udt-and-template-repeater/95524/3 "2024-09-04T21:11:50Z")

</div>

I think what you mean to ask is how to use indirect binding without passing an instance of the UDT to the template?

All of my templates generally have one parameter, the path to the UDT instance (string).  
Then, internal properties with indirect bindings to the relevant UDT members using the path parameter replacement for the first portion of the member tag path.

You want to use a UDT, trust me. Then if you need to add a metric to every line you update the UDT and your one template and everything else populates.

If you want to have a trend on the template that doesn't use indirect binding you can just directly reference tags. You don't have to only use indirect bindings. The trend would be identical no matter the selected line, but the rest of the information would be filled in for the selected line using the indirection - I've done this alot.

---

<div class="post-metadata">

**Author:** ![Govind\_Suthar1](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@Govind\_Suthar1](https://forum.inductiveautomation.com/u/Govind_Suthar1)\
**Post date:** [September 5, 2024, 12:59pm UTC](https://forum.inductiveautomation.com/t/indirect-binding-for-the-multiple-screens-and-trends-without-using-udt-and-template-repeater/95524/4 "2024-09-05T12:59:33Z")

</div>

I know template repeaters and UDTs are very useful for creating multi-instance objects or screens and tags.

Yes, all line tag path is the same like a `[Sample_Tags]Batching_machine/Line_A/Inlet_valve' `is the same as for other lines, only line name changes like` ``[Sample_Tags]Batching_machine/Line_B/Inlet_valve'`.

I create a line-wise object in the main overview and add a screen swap function to move to another screen. All line-wise items are passed parameters such as tagpath, screen header name, and table name.

When I click on the object, it goes to the specific line graphics and displays the parameter of the line.

main overview

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/9/d9be3c081290d3d120a63905020c59b7c5904ec1.png)

Pass the parameter in line wise object.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/2/f2050e3870b8fcbca81968e2d28c1fd63b04f156.png)

Created a master screen for the line and added custom properties such as tagpath, screen header name, and table name. This custom property is reflected in the data when selecting a specific line object from the main overview.

Add a custom property in the Main master line graphics.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/0/4096ef07f6e639096b57fbd2039f8cb666f0f4c3.png)

Defined the all object tag path and Screen\_header name using indirect tag binding.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/5/a5cc6943ed5ba697534ea5002a377d723a0d7719.png)

My question is how to defined in the trends as per above function using?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 5, 2024, 1:03pm UTC](https://forum.inductiveautomation.com/t/indirect-binding-for-the-multiple-screens-and-trends-without-using-udt-and-template-repeater/95524/5 "2024-09-05T13:03:27Z")

</div>

You have to dynamically (script) construct the `tagPens` dataset of an EasyChart, inserting the dynamic part of the tag path where appropriate.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [September 5, 2024, 1:11pm UTC](https://forum.inductiveautomation.com/t/indirect-binding-for-the-multiple-screens-and-trends-without-using-udt-and-template-repeater/95524/6 "2024-09-05T13:11:42Z")

</div>

I still don't understand the question.

I don't see a trend on your page.

What tags would be included for Line\_A and Line\_B? That might clear things up.

I'm thinking you want the same trends for each line using the same indirect binding for the historical tag path?

If that assumption is correct, I made this script assuming that you have a template on a window. If you're just using a window you can remove the `propertyName` check and just use the `visionWindowOpened` script instead.

```python
'''
toggle the template's updatePaths (BOOL) parameter from the vision window opened
script for the window that contains this template.
'''
if event.propertyName == 'updatePaths':
	defaultLine = 'Line_A'
	
	#get the "default" tagPens - configured with the default line indirect tag substring that is to be replaced
	tagPens = event.source.getComponent('Easy Chart').tagPens
	
	#at least one tagPen is configured
	if tagPens.rowCount > 0:
		tagPathIndex = tagPens.getColumnIndex('TAG_PATH')
		
		#create headers list, blank data list, and get the line parameter
		headers = list(tagPens.getColumnNames())
		newTagPens = []
		line = event.source.Line
		
		for pen in tagPens:
			newPen = list(pen)
			
			#replace default line substring with line parameter
			newPen[tagPathIndex] = pen[tagPathIndex].replace(defaultLine,line)
			
			newTagPens.append(newPen)
			
		#create and update dataset on the trend
		data = system.dataset.toDataSet(headers, newTagPens)
		if data is not None:
			self.tagPens = data

```

It grabs the existsing `tagPens` from the `Easy Chart` this is configured with the paths for the `defaultLine` (Line\_A, or whichever one you choose).
