# Replacing direct tags with indirect tags

**URL:** <https://forum.inductiveautomation.com/t/replacing-direct-tags-with-indirect-tags/7344>\
**Category:** Ignition\
**Created:** [September 29, 2013, 2:22am UTC](https://forum.inductiveautomation.com/t/replacing-direct-tags-with-indirect-tags/7344 "2013-09-29T02:22:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhortig](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jhortig](https://forum.inductiveautomation.com/u/jhortig)\
**Post date:** [September 29, 2013, 2:22am UTC](https://forum.inductiveautomation.com/t/replacing-direct-tags-with-indirect-tags/7344/1 "2013-09-29T02:22:07Z")

</div>

I have a project that displays about 250 parameters of a production machine in labels and text fields.  
Each label or text field is linked to several properties of a opc tag; like value, limits, units, decimal format etc.  
When my customer ordered the same project for 8 more machines I created data types and data type instances from the existing tags.  
My problem is now that I have to click on every single label and text field and change all properties from tag binding to indirect tag binding.

Is there a faster, better way to do this?

Thanks.

---

<div class="post-metadata">

**Author:** ![fledder](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@fledder](https://forum.inductiveautomation.com/u/fledder)\
**Post date:** [September 30, 2013, 6:46am UTC](https://forum.inductiveautomation.com/t/replacing-direct-tags-with-indirect-tags/7344/2 "2013-09-30T06:46:48Z")

</div>

You can get an XML representation of all the stuff on a screen by doing a select all -\> copy -\> paste into text editor. You’ll prob have to do a test to see what to find and what to replace it with to switch to the indirect binding. Notepad++ has a “replace all in all open files” feature to get a bunch of stuff done at once. Then you’d have to come back here and report the results…

Not sure if quicker, but definitely slicker…

---

<div class="post-metadata">

**Author:** ![jhortig](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jhortig](https://forum.inductiveautomation.com/u/jhortig)\
**Post date:** [October 1, 2013, 8:16pm UTC](https://forum.inductiveautomation.com/t/replacing-direct-tags-with-indirect-tags/7344/3 "2013-10-01T20:16:52Z")

</div>

Thanks for the reply.

I picked one of my numeric text fields with direct tag binding and copy/pasted it into a text file.  
Then I used the designer to change the same field to indirect tag binding and copy/pasted it into another text file.

The differences between the two files are huge. Direct binding is 121 lines of code, indirect binding 331 lines.

I compared the 2 txt files with WinMerge and I can’t see a way to use search and replace to change from direct to indirect binding.

Thanks,  
Juergen

The file comparison is attached.

---

<div class="post-metadata">

**Author:** ![fledder](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@fledder](https://forum.inductiveautomation.com/u/fledder)\
**Post date:** [October 3, 2013, 5:02am UTC](https://forum.inductiveautomation.com/t/replacing-direct-tags-with-indirect-tags/7344/4 "2013-10-03T05:02:41Z")

</div>

Heh… that’s why I wasn’t sure if it would be quicker. You could use regular expressions and some sort of text reference file + sed, but you know what they say about regexes…

“Bob had a problem. He decided to use regular expressions to solve his problem. Now Bob has two problems.”

If this was something that you were going to do repeatedly, I would say some sort of python script or something, but you’re probably best off just doing it the hard way…

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [October 7, 2013, 10:38pm UTC](https://forum.inductiveautomation.com/t/replacing-direct-tags-with-indirect-tags/7344/5 "2013-10-07T22:38:23Z")

</div>

Only do it the hard way once, make indirect tags the first time! Haha seriously though, changing from a direct tag binding to an indirect all over your project would take some work in the Ignition designer. You can’t use our find/replace for that. Good idea using NPP though!
