# Probleme with Event script in UDT

**URL:** <https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842>\
**Category:** Ignition\
**Created:** [November 30, 2015, 7:05pm UTC](https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842 "2015-11-30T19:05:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lemeur17](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@lemeur17](https://forum.inductiveautomation.com/u/lemeur17)\
**Post date:** [November 30, 2015, 7:05pm UTC](https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842/1 "2015-11-30T19:05:08Z")

</div>

Hello,

I’m running V7.8 on windows server 2012.  
I created a UDT with the following Data type parameters parameter

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/fa7708fdbd056417c06ae4a471cb7569d464c37e.png)  

I’m indexing the PresentVAlue with a Kepware server to Bacnet/IP devices with an alarm and two events. each event  
increment or decrement an Alarm for each site (Alarme memory tag)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/bf3732217569cabc2b5bb90f00cba6ba783ce97b.png)  

The problem I’ve got is[color=#4040FF] Alarme [/color]memory tag is not update automaticaly, the only way to update this value is to refresh the provider into the tag browser as soon as I refreshed it the good value is displayed  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/be74ab4f297b1a9fd91ac922ab1a659b86f72361.png)  
  
my scan class for this memory tag is the default class.

Do you have any idea what’s going on or i need to check ?

Regards

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 30, 2015, 8:41pm UTC](https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842/2 "2015-11-30T20:41:25Z")

</div>

Not completely sure, but tag scripts are scoped to the gateway, so you will need to specify the full path, including the tag provider.

---

<div class="post-metadata">

**Author:** ![lemeur17](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@lemeur17](https://forum.inductiveautomation.com/u/lemeur17)\
**Post date:** [November 30, 2015, 9:15pm UTC](https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842/3 "2015-11-30T21:15:10Z")

</div>

Thanks Jordan for your answer, but I tested the script with the two following tagpath

tagpath = ‘[.]…/…/Alarme’

tagpath= ‘Sites/02\_/Alarme’

and the result was the same, automatic refresh didn’t work

I’m also tested in the the script console the system.tag.read and system.tag.write with ‘tagpath= ‘Sites/02\_/Alarme’’ and it’s run perfectly  
so I’m wondering if it’s not an asynchronous problem with tag Event script ?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 30, 2015, 9:22pm UTC](https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842/4 "2015-11-30T21:22:04Z")

</div>

You also need to specify the tag provider.

example: [default]Sites/02\_/Alarme

Scripts that are scoped in the gateway (like tag scripts) have no idea what the default tag provider is on your project (because it doesn’t use them) 😉

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 30, 2015, 9:31pm UTC](https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842/5 "2015-11-30T21:31:38Z")

</div>

> [@lemeur17](#):
>
> The problem I've got is[color=#4040FF] Alarme [/color]memory tag is not update automaticaly, the only way to update this value is to refresh the provider into the tag browser as soon as I refreshed it the good value is displayed

Apologies, I went right over this part without noticing. 😊  
If it gives the correct value after refreshing, I think your script is working okay.

Have you tried binding a display component to the memory tag and see what it does?

---

<div class="post-metadata">

**Author:** ![lemeur17](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@lemeur17](https://forum.inductiveautomation.com/u/lemeur17)\
**Post date:** [November 30, 2015, 9:41pm UTC](https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842/6 "2015-11-30T21:41:48Z")

</div>

yes and I,ve got the same problem, to refresh the display I need to open a new window and then the component binds to the memory tag is refreshed properly, I also check to be sure that the tag is reference to the right scan class (direct mode) with a slow rate of 5 sec.

---

<div class="post-metadata">

**Author:** ![lemeur17](https://avatars.discourse-cdn.com/v4/letter/l/4491bb/32.png) [@lemeur17](https://forum.inductiveautomation.com/u/lemeur17)\
**Post date:** [December 2, 2015, 9:03pm UTC](https://forum.inductiveautomation.com/t/probleme-with-event-script-in-udt/10842/7 "2015-12-02T21:03:56Z")

</div>

Ok so to refresh the value we must use the following script

```
QV = system.tag.read("[.]../../Alarme")
[color=#00BF00]QV[/color] = QV.value + 1
system.tag.write("[.]../../Alarme",QV)

```

instead of

```
QV = system.tag.read("[.]../../Alarme")
[color=#FF0000]QV.value[/color] = QV.value + 1
system.tag.write("[.]../../Alarme",QV)

```

my understanding is probably the timestamp is not updated so it could explain why the value is not refreshed automaticaly,

Thank you to Sam from the Ignition support team to help me ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")
