# Link multiple SCADA tags to different plc

**URL:** <https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918>\
**Category:** Ignition\
**Created:** [January 29, 2024, 8:36pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918 "2024-01-29T20:36:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [January 29, 2024, 8:36pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/1 "2024-01-29T20:36:54Z")

</div>

I am working on a project where I have several conditions from other plc's on other tag providers and using these conditions for a separate plc, lets call it plant plc. I have setup the plant plc tags in Ignition. What is the best way to turn those boolean tags on and off from other scada tags? Is it to create a reference tag to access other scada plc tags and then have a tag script which turns on the plant plc tags? Is there another way?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [January 29, 2024, 9:04pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/2 "2024-01-29T21:04:58Z")

</div>

A Gateway Tag Change event script that is monitoring all the tags you want to watch to determine what to turn on in the plant PLC is probably going to be the best way to go.

What is preventing you from getting these PLC's to talk to each other directly instead of through ignition?

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [January 29, 2024, 9:09pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/3 "2024-01-29T21:09:15Z")

</div>

There are several vendors with this project and a few of them are not letting the SCADA side have much access to the plc's.

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [January 30, 2024, 12:30am UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/4 "2024-01-30T00:30:08Z")

</div>

Relying on a gateway script for this type of control is not good practice. This should be integrated as much as possible into the plc programs with peer to peer messaging that utilizes heartbeat monitoring.

You did not specify the plc OEM but if it were say Control Logix I would define a datatype that all your vendors can import and utilize produced consumed tags which update implicitly. Otherwise you would have to setup the explicit messaging and connection monitoring manually.

If you must go the gateway script route I would define a seperate project to run this script(s) in that will be unaffected by project edits and saves.

---

<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:** [January 30, 2024, 1:27am UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/5 "2024-01-30T01:27:12Z")

</div>

Depending on what the tags are doing, and how much latency the application can handle, a few approaches may be better suited.

~~1. **Reference Tags** - If the tags are truly 1 to 1 (as it seems to me from your OP), then Reference tags are probably the best approach. They will have the most clear setup and probably the least amount of latency available from just a standard Ignition install.~~

1. **Gateway Tag Change Event** - If the tags are not 1 to 1, and/or the application will not be sensitive to a longer latency (100s of ms + scan class time ). This is the best script based approach in a standard Ignition install.

~~3. **Expression Tags** - If the tags are not 1 to 1 but can easily be combined into a single boolean value, then this is probably the best approach. Again this will have a clear setup and won't be accompanied by a heavier than scan class latency.~~

1. **Tag Value Change Scripts** - Most likely the worst solution, though technically possible. There are caveats to using this approach that would rule it out for me personally, particularly if there are many of these tags, and the application is mid to large scale.

2. **Another Option** - If you are able and/or the client is willing to, then I believe that you could use Phil's [Automation Professionals' EtherNet/IP Communication Suite V2](https://forum.inductiveautomation.com/t/automation-professionals-ethernet-ip-communication-suite-v2/68190) Module. It has some optimizations that may allow this to be done as nearly to a PLC as possible.

Of course as stated the best option for this is to do some type of peer-to-peer messaging.

If the application is sensitive to more than low latency or has _anything_ to do with safety, then I would be refusing to do it any way but through the PLC's.

EDIT: Turns out I should read the manual a bit closer. Neither Reference Tags, nor Expression tags, actually write values back to a different device.

---

<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:** [January 30, 2024, 2:15am UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/6 "2024-01-30T02:15:05Z")

</div>

> [@lrose](#):
>
> **Gateway Tag Change Event** - If the tags are not 1 to 1, and/or the application will not be sensitive to a longer latency (100s of ms + scan class time ). This is the best script based approach in a standard Ignition install.

Actually, thinking about this, a Gateway Timer Script which utilizes `system.opc.readValues()` and `system.opc.writeValues()` may be able to achieve a lower latency since it wouldn't be dependent upon scan classes.

---

<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:** [January 30, 2024, 1:55pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/7 "2024-01-30T13:55:23Z")

</div>

If I understand your desire correctly, no Ignition tag type will do what you want. Only scripting will transfer data from a tag pointing at one device to a tag pointing somewhere else (to produce a write).

Ignition v7.9 and prior had a feature on Expression tags that would write the result of each execution to a desired OPC server/item path combination. That was deleted for v8, and upgrades replace that function with a "legacy" tag value change event script that performs that operation.

So you could try a bunch of tag change value events that call `system.opc.writeValue()` or `.writeValues()`, but those are synchronous operations that are inappropriate in tag value change events in any non-trivial quantity. Consider a gateway tag change event subscribing to all of the necessary tags. If write traffic is high, you will want to batch by target device, so the OPC drivers have an opportunity to optimize. The use of a `ConcurrentLinkedQueue` and a timer event (to pace the write batches) would be appropriate. See this topic:

> [@Java concurrent queue for tag change scripts](https://forum.inductiveautomation.com/t/java-concurrent-queue-for-tag-change-scripts/82044):
>
> Continuing the discussion from [[SOLVED] Are tag Value Changed scripts running asynchronously?](https://forum.inductiveautomation.com/t/solved-are-tag-value-changed-scripts-running-asynchronously/68704/5): We've got code in our standard library that I need to log a value change on a tag and then associate various data points with that value change. The value is located in a UDT, and because this is part of our "standard" library we use for our customers, the number of tags is variable and quite possibly numerous so having a gateway tag event script isn't feasible for this solution. I was reading up on …

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [January 30, 2024, 2:46pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/8 "2024-01-30T14:46:20Z")

</div>

I see. We are only talking about six to seven tags so its not many at all. Think we may go the gateway tag change event script route.

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [January 30, 2024, 2:46pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/9 "2024-01-30T14:46:57Z")

</div>

Seems like we are running 8.1.26 and the writeValues works for 8.1.27 and higher

---

<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:** [January 30, 2024, 2:59pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/10 "2024-01-30T14:59:07Z")

</div>

Pretty sure that function has been around for some time, as it is in both the 7.9 and 8.0 manuals. You sure you didn't have a typo? It's pretty easy to do "system. **tag**.writeValues()" which isn't correct. I do it all the time.

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [January 30, 2024, 3:08pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/11 "2024-01-30T15:08:30Z")

</div>

I am getting a write fail when I run it on the script console. The quality of the tag value is good so not sure why its not working.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/6/b6e19c9854d1c440eac64509ad30c185bcf93714.png)

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

---

<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:** [January 30, 2024, 3:10pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/12 "2024-01-30T15:10:37Z")

</div>

Because you need a full OPC path

Try:

```auto
server = 'Ignition OPC UA Server'
path = 'ns=1;s=[PlantPLC_PLC01]Cond_Furnace_Door_Open'

returnQuality = system.opc.writeValue(server, path, False)
if returnQuality.good:
    print 'Write success'
else:
   print 'Write failed'

```

---

<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:** [January 30, 2024, 3:23pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/13 "2024-01-30T15:23:51Z")

</div>

Don't use the string `"false"` for a boolean. Just use python's `False` boolean constant.

---

<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:** [January 30, 2024, 3:25pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/14 "2024-01-30T15:25:09Z")

</div>

Yeah, typo, thanks, corrected code.

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [January 30, 2024, 3:27pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/15 "2024-01-30T15:27:48Z")

</div>

Tried and still no good. Used 'False' as per pturmel.

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

---

<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:** [January 30, 2024, 3:33pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/16 "2024-01-30T15:33:36Z")

</div>

Make sure that the server is actually named `Ignition OPC UA Server`, mine is the default and is `Ignition OPC-UA Server`

I tried similar code on my system, and it worked as expected, so there must be some typo somewhere causing it to not work.

---

<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:** [January 30, 2024, 3:34pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/17 "2024-01-30T15:34:55Z")

</div>

Is `[PlantPLC_PLC01]Cond_Furnace_Door_Open` really a PLC device and tag name, or is it an Ignition tag provider and Ignition tag name?

---

<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:** [January 30, 2024, 3:36pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/18 "2024-01-30T15:36:35Z")

</div>

I thought the same thing, the OpcItemPath is shown in the screen shot, so I believe that is the correct path.

---

<div class="post-metadata">

**Author:** ![michael.black](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@michael.black](https://forum.inductiveautomation.com/u/michael.black)\
**Post date:** [January 30, 2024, 4:31pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/19 "2024-01-30T16:31:49Z")

</div>

PlantPLC\_PLC01 is the actual PLC device and Cond\_Furnace\_Door\_Open is the actual tag name within the plc

---

<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:** [January 30, 2024, 4:46pm UTC](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918/20 "2024-01-30T16:46:06Z")

</div>

Is there any chance the PLC has that tag's external access as ReadOnly ?

[Next page](https://forum.inductiveautomation.com/t/link-multiple-scada-tags-to-different-plc/84918.md?page=2)
