# Subscribe to UDT Parameters property for value changed?

**URL:** <https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540>\
**Category:** Module Development\
**Tags:** ignition80\
**Created:** [September 25, 2019, 9:59am UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540 "2019-09-25T09:59:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 25, 2019, 9:59am UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540/1 "2019-09-25T09:59:05Z")

</div>

@mgross, @paul-griffith  
I try to subscribe to **UDT Parameters property** value changed with:

```auto
public abstract java.util.concurrent.CompletableFuture<Void> subscribeAsync(java.util.List<com.inductiveautomation.ignition.common.tags.model.TagPath> list,
                                                                           java.util.List<com.inductiveautomation.ignition.common.tags.model.event.TagChangeListener> list1)

```

It seem I receive the initial notification, but when the value change and dont’ receive any change notification.

is subscribeAsync the right function to use for UDT Parameters property ???

---

<div class="post-metadata">

**Author:** ![mgross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mgross/32/3311_2.png) [@mgross](https://forum.inductiveautomation.com/u/mgross)\
**Post date:** [September 26, 2019, 3:21pm UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540/2 "2019-09-26T15:21:14Z")

</div>

I was able to get my subscription listener to fire multiple times, but I was using nightly code as of 9/25. Here is what I did:

```auto
TagPath paramPath = TagPathParser.parse("[default]Basic UDT instances/BasicUDT_Instance0/Parameters.MyParam");
SubscriptionListener listener = new SubscriptionListener(paramPath);

tagManager.subscribeAsync(paramPath, listener).get(TIMEOUT, TimeUnit.SECONDS);

QualifiedValue qv = new BasicQualifiedValue("new value");
List<QualityCode> qc = defaultProvider.writeAsync(
            Arrays.asList(paramPath), Arrays.asList(qv), SecurityContext.emptyContext())
            .get(TIMEOUT, TimeUnit.SECONDS);

```

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 26, 2019, 4:15pm UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540/3 "2019-09-26T16:15:27Z")

</div>

> [@mgross](#):
>
> SubscriptionListener

Thanks, I use a **TagChangeListener** instead of **SubscriptionListener** with a build before 9/25.  
I'll try to test again with the last nightly.

---

<div class="post-metadata">

**Author:** ![mgross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mgross/32/3311_2.png) [@mgross](https://forum.inductiveautomation.com/u/mgross)\
**Post date:** [September 26, 2019, 4:16pm UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540/4 "2019-09-26T16:16:57Z")

</div>

Oh sorry, I was using my own implementation of TagChangeListener that I called SubscriptionListener.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 26, 2019, 4:22pm UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540/5 "2019-09-26T16:22:08Z")

</div>

I have not implemented getTagProperty in the TagChangeListener.  
By default, Value is used for the subscribed tags or subscribed udt instance parameters ?

or I need to add something like:

```
    public TagProp getTagProperty(){
        return TagProp.Value;
    }
```

---

<div class="post-metadata">

**Author:** ![mgross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mgross/32/3311_2.png) [@mgross](https://forum.inductiveautomation.com/u/mgross)\
**Post date:** [September 26, 2019, 4:33pm UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540/6 "2019-09-26T16:33:18Z")

</div>

I think you are using the wrong TagChangeListener class. You want to be using this one:

`com.inductiveautomation.ignition.common.tags.model.event.TagChangeListener`

The tagChanged() method passes a TagChangeEvent, where you can get the changed value using getValue().

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 4, 2019, 4:54pm UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540/7 "2019-10-04T16:54:00Z")

</div>

> [@mgross](#):
>
> [default]Basic UDT instances/BasicUDT\_Instance0/Parameters.MyParam

@mgross, I have to do more test, but I subscribe with:  
`[default]Basic UDT instances/BasicUDT_Instance0/Parameters/MyParam`  
instead of:  
`[default]Basic UDT instances/BasicUDT_Instance0/Parameters.MyParam`

read operation is possible with Parameters/MyParam but perhaps subscribe is not possible ?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 7, 2019, 6:58am UTC](https://forum.inductiveautomation.com/t/subscribe-to-udt-parameters-property-for-value-changed/28540/8 "2019-10-07T06:58:55Z")

</div>

@mgross,

It’s **OK** for subscription with:

```auto
[default]Basic UDT instances/BasicUDT_Instance0/Parameters.MyParam

```

instead of:

```auto
[default]Basic UDT instances/BasicUDT_Instance0/Parameters/MyParam

```
