# Am I overthinking dynamic linking PLCs?

**URL:** <https://forum.inductiveautomation.com/t/am-i-overthinking-dynamic-linking-plcs/17080>\
**Category:** Ignition\
**Created:** [February 21, 2018, 8:23pm UTC](https://forum.inductiveautomation.com/t/am-i-overthinking-dynamic-linking-plcs/17080 "2018-02-21T20:23:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe.brodersen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe.brodersen/32/3303_2.png) [@joe.brodersen](https://forum.inductiveautomation.com/u/joe.brodersen)\
**Post date:** [February 21, 2018, 8:23pm UTC](https://forum.inductiveautomation.com/t/am-i-overthinking-dynamic-linking-plcs/17080/1 "2018-02-21T20:23:05Z")

</div>

_Is there an easier way than the following? I think I’m over-complicating this…_

I am trying to link a PLC to a project, where this PLC can change dynamically across the entire project (depending upon user login, location, etc.). I am using a client tag called PLCName (string) that points to the name of the PLC being used in the project, but I am having a hard time trying to use as little scripting as possible. I want to be able to change PLCName and all tags in my project are referencing that PLC.

For buttons and other things I have to use the Script Editor to read the PLCName from the client tag, and write to PLCName+baseTag (especially with pop-ups passing in the tags as strings). For numeric labels it is a little easier to use an expression like `tag({[Client]Settings/PLCName}+"/Path/To/Tag/LaserSPTag")`

Too complex? Easier solution? I’m open to ideas, but my tag paths are fairly rigid at this point.

TL;DR - Same project, different PLCs for different areas/users. If PLC changes, tag references change. Easy or not?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 21, 2018, 8:47pm UTC](https://forum.inductiveautomation.com/t/am-i-overthinking-dynamic-linking-plcs/17080/2 "2018-02-21T20:47:19Z")

</div>

I would be very wary of doing it that way, if something happens and you don’t set the client tag properly you could potentially end up with an operator changing values on a different PLC than he intends to.

---

<div class="post-metadata">

**Author:** ![joe.brodersen](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe.brodersen/32/3303_2.png) [@joe.brodersen](https://forum.inductiveautomation.com/u/joe.brodersen)\
**Post date:** [February 21, 2018, 9:30pm UTC](https://forum.inductiveautomation.com/t/am-i-overthinking-dynamic-linking-plcs/17080/3 "2018-02-21T21:30:17Z")

</div>

Good point. So different Projects (copies) for different PLCs?

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [February 21, 2018, 9:43pm UTC](https://forum.inductiveautomation.com/t/am-i-overthinking-dynamic-linking-plcs/17080/4 "2018-02-21T21:43:30Z")

</div>

That is how I would do it yes.  
That will make it much easier for things like alarms and permissions as well.  
You could structure your tag database based on location.  
CorpName  
-----Location1  
----------Area1  
-----Location2  
----------Area1  
----------Area2

etc, then in each project you could restrict access to the tag structure based on roles, scripting, login names, etc

---

<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:** [February 22, 2018, 12:53am UTC](https://forum.inductiveautomation.com/t/am-i-overthinking-dynamic-linking-plcs/17080/5 "2018-02-22T00:53:28Z")

</div>

Consider making more use of indirect tag binding, where the PLC name in the client tag contributes to the tag path. Indirect bindings can still be bidirectional, making it convenient to direct writeback to the correct PLC when your UI or even a script writes to that component property. Avoid using the tag() expression function. Every such use can be re-arranged (possibly with an intermediate custom property) into an indirect tag binding.
