# Problem when Calling Project Library script function from tag value change event

**URL:** <https://forum.inductiveautomation.com/t/problem-when-calling-project-library-script-function-from-tag-value-change-event/84315>\
**Category:** Ignition\
**Created:** [January 16, 2024, 10:46am UTC](https://forum.inductiveautomation.com/t/problem-when-calling-project-library-script-function-from-tag-value-change-event/84315 "2024-01-16T10:46:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Axelsson](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Jonathan\_Axelsson](https://forum.inductiveautomation.com/u/Jonathan_Axelsson)\
**Post date:** [January 16, 2024, 10:46am UTC](https://forum.inductiveautomation.com/t/problem-when-calling-project-library-script-function-from-tag-value-change-event/84315/1 "2024-01-16T10:46:12Z")

</div>

Hi!  
Im trying to call a function from the Project library on a tag value change event defined in a UDT. I have done the exact same thing many times before but this time it generates this error message:  
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 15, in valueChanged NameError: global name 'scpBase' is not defined

I call the function like this:  
event = scpBase.API.prodCalendar.getCurrentEvent(rName)

Im currently only using trial license on our development environment. Could this have anything to do with it or is it something else?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 16, 2024, 10:55am UTC](https://forum.inductiveautomation.com/t/problem-when-calling-project-library-script-function-from-tag-value-change-event/84315/2 "2024-01-16T10:55:03Z")

</div>

Trial licence gives you everything - except time - so it's not that.

Tag value changes occur outside of your project so they know nothing about the project or their scripts. See if the following help:

- [Tag event scripts](https://docs.inductiveautomation.com/display/DOC81/Tag+Event+Scripts#TagEventScripts-UsingtheProjectLibraryinaTagEventScript).
- [Gateway scripting project](https://docs.inductiveautomation.com/display/DOC81/Project+Library#ProjectLibrary-GatewayScriptingProject).

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [October 28, 2024, 9:26pm UTC](https://forum.inductiveautomation.com/t/problem-when-calling-project-library-script-function-from-tag-value-change-event/84315/3 "2024-10-28T21:26:53Z")

</div>

so its a scoping thing and we need to create a gateway scripting project to hold gateway scripts? Thanks
