# OPC Tag Registration Through Designer

**URL:** <https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729>\
**Category:** Module Development\
**Created:** [March 21, 2021, 10:59pm UTC](https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729 "2021-03-21T22:59:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam1](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@sam1](https://forum.inductiveautomation.com/u/sam1)\
**Post date:** [March 21, 2021, 10:59pm UTC](https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729/1 "2021-03-21T22:59:17Z")

</div>

Hi All,

I’m currently working on a device driver project and I’m having trouble understanding the connection between the designer’s OPC client and the node manager in the module. I understand how OPC nodes are configured and registered from within the module, however, the connection between the designer’s OPC client and the module is not clear to me.

When a new tag is created within the designer is there an event triggered which can be used to register a new node? And in a similar way, how can tag configuration changes in the designer be tracked in the module so that the relevant node can be updated?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 21, 2021, 11:05pm UTC](https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729/2 "2021-03-21T23:05:35Z")

</div>

> [@sam1](#):
>
> When a new tag is created within the designer is there an event triggered which can be used to register a new node?

When this happens it ultimately ends up as a notification to your driver to subscribe to something.

> [@sam1](#):
>
> And in a similar way, how can tag configuration changes in the designer be tracked in the module so that the relevant node can be updated?

These are irrelevant to you unless it's a tag group change or rate change, which you end up seeing as unsubscribe and subscribes.

---

<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:** [March 22, 2021, 1:33am UTC](https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729/3 "2021-03-22T01:33:45Z")

</div>

If you are implementing `com.inductiveautomation.xopc.driver.api.Driver` and related interfaces (instead of the newer `Device`), you must implement a `ModelChangeListener` that will let you know about new subscriptions you must execute. In `ModelChangeListener.itemsAdded()`, `Driver.readItems()`, or `Driver.writeItems()`, it is up to you to immediately instantiate a node for each given nodeId, or reject the item with a bad status. But don’t instantiate it blindly–check if you’ve done so already. (Your own `NodeManager<UaNode>` can handle such lookups.)

---

<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:** [March 22, 2021, 1:36am UTC](https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729/4 "2021-03-22T01:36:48Z")

</div>

Note: Switching to the `Device` model instead of the `Driver` model is on my to-do list some time after 7.9 is EOL. I gather only the very newest IA drivers are on the Device model themselves.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 22, 2021, 2:25am UTC](https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729/5 "2021-03-22T02:25:25Z")

</div>

> [@pturmel](#):
>
> I gather only the very newest IA drivers are on the Device model themselves.

FINS, BACnet, and all new drivers use the Device model. Any rewrites will use Device as well. Legacy AB drivers will likely be implemented against Driver forever.

---

<div class="post-metadata">

**Author:** ![sam1](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@sam1](https://forum.inductiveautomation.com/u/sam1)\
**Post date:** [March 22, 2021, 2:41am UTC](https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729/6 "2021-03-22T02:41:43Z")

</div>

Thanks a lot for the prompt replies.

The driver being implemented is based on the current OPC-UA-Device example (so using the new device model). I can’t see anything in the 8.1 Javadocs on how I can access these notifications being sent from the designer and use them to subscribe. Would either of you be able to point me towards any relevant docs please?

Also, is the current process similar to what @pturmel has described for the Driver interface?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 22, 2021, 2:50am UTC](https://forum.inductiveautomation.com/t/opc-tag-registration-through-designer/44729/7 "2021-03-22T02:50:19Z")

</div>

In the example Device implementation `onDataItemsCreated` and `onDataItemsDeleted` are called when items are being subscribed or unsubscribed. These are the equivalent calls to what the `ModelChangeListener` Phil mentioned would receive.

To be clear, you aren’t “receiving notifications from the designer”. You are providing Nodes in an OPC UA address space that OPC UA clients can read, write, browse, or subscribe to attributes of. Ignition has an OPC UA client connection to its own OPC UA server. Various actions you do in the designer with the OPC browser and creating OPC tags correspond to things like reading, writing, browsing or creating/deleting monitored items against an OPC UA server. And those things are the same whether its our OPC UA server or a third party one like Kepware.
