# Tag change script on UDT

**URL:** <https://forum.inductiveautomation.com/t/tag-change-script-on-udt/82761>\
**Category:** General Discussion\
**Tags:** scripting\
**Created:** [December 6, 2023, 4:21am UTC](https://forum.inductiveautomation.com/t/tag-change-script-on-udt/82761 "2023-12-06T04:21:28Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [May 30, 2024, 12:39pm UTC](https://forum.inductiveautomation.com/t/tag-change-script-on-udt/82761/10 "2024-05-30T12:39:34Z")

</div>

Some topics to read (follow nested topics, too):

> [@Best Practice Question. Tag Event Trigger a HTTP Request](https://forum.inductiveautomation.com/t/best-practice-question-tag-event-trigger-a-http-request/89220/2):
>
> No, probably not. The best way is to create a Tag Change Script in the same project you defined that script in, and then call it from the change script. Do not confuse Tag Event Scripts for Tag Change Scripts in this case. Tag Event Scripts are quite sensitive to the speed of execution and would require your project with the library be defined as the Gateway Scripting Project.

> [@Tag events, gateway events, library scripts](https://forum.inductiveautomation.com/t/tag-events-gateway-events-library-scripts/90356/2):
>
> Never do this... there are only 3, iirc, threads for tag event scripts. Tag even scripts must execute sub 10ms so that it doesn't cause issues with other parts of the system. This is the way to do things like this. Write a project library script do the actual data logging, and call it in the Gateway even script as a single line. This isn't like the others. The reason for doing a project library script isn't speed, it's code scoping. I don't fully understand it, but I've learned that sometim…

> [@Delay in script execution on the OnChange feature](https://forum.inductiveautomation.com/t/delay-in-script-execution-on-the-onchange-feature/88865/4):
>
> Absolutely. The thread pool size, by default, is three. That is, once three tag event scripts are running, or sleeping, or waiting on a network reply, all other tag events have to wait. The pool size can be reconfigured to be larger, and that is reasonable for very large systems, but tag events should still be designed to execute as near instantly as possible, with only gateway-local information. Any tag change script that needs to perform anything complex needs to be in a project-based gat…

> [@Value changed script delay](https://forum.inductiveautomation.com/t/value-changed-script-delay/84942/2):
>
> This is a task that takes too long to do directly in a tag event. Use the store and forward engine or use a gateway tag change event (in the project, not on the tag). See this recent topic for why this is true: If you have very dynamic requirements, such that the event must originate on a tag event, this topic of advanced techniques might help you:

> [@Tag Change Scripts stop working](https://forum.inductiveautomation.com/t/tag-change-scripts-stop-working/84819):
>
> Every once in a while, we have a situation where basically all of our tag change scripts stop processing. I finally saw this error in the Console of the designer Diagnostics. It's almost as if the Basic Execution Engine has run out of threads. WARN Common.BasicExecutionEngine - Execution rejected... running in calling thread [AWT-EventQueue-0] immediately. [com.inductiveautomation.ignition.designer.tags.tree.TagTreeModelImpl$BatchOp$$Lambda$949/0x0000016597b1a668@d72dc75] Any ideas where I can…

> [@What is the difference between the tag change configuration at the point and the gateway](https://forum.inductiveautomation.com/t/what-is-the-difference-between-the-tag-change-configuration-at-the-point-and-the-gateway/84631):
>
> What is the difference between the tag change configured in the point and the gateway, what is the maximum number of points configured in the point, what is the upper limit of the number of points configured in the gateway, and what is the maximum number of points configured in each gateway event

---

_[View the full topic](https://forum.inductiveautomation.com/t/tag-change-script-on-udt/82761)._
