# Not Defined - Global Name

**URL:** <https://forum.inductiveautomation.com/t/not-defined-global-name/93801>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [July 26, 2024, 5:09pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801 "2024-07-26T17:09:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [July 26, 2024, 5:09pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/1 "2024-07-26T17:09:02Z")

</div>

I have a Project Script where I keep getting an error when I call it from a component expression. The error states "global name not defined". Do you know what could be causing this issue?

[chill\_example.txt](https://forum.inductiveautomation.com/uploads/short-url/oOdw59BFHiCCX1JzENsHC3DngCe.txt) (1.3 KB)

 ![globalError](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c67220a8d3b77226656c597a5c4a697b6478c44d.png)  
 ![PropertyBindingonChillLabel](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/d/1ddd88a3125cfcf23eab615d59374c0274d00ed5.png)

 ![chillMetric_function](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/4/f4ed1d1308481a772b9edcdaa623f2f241987647.png)

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 26, 2024, 5:13pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/2 "2024-07-26T17:13:16Z")

</div>

In the future, post your code as preformatted text as it will be easier to copy/paste to show you what the problems could be.

Looking at your script, you're referring to `PouringFurnaceCopy_Melting_Summary_HWS_DISA.Chill.ATAS` but that's not defined anywhere in your script or passed as a parameter. If this is a tag, you'll need to use a `readBlocking` function to read this value before you can use it.

Edit: Or, if it's meant to be a string, then it needs to be enclosed in quotes.

---

<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:** [July 26, 2024, 5:26pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/3 "2024-07-26T17:26:20Z")

</div>

Looking at the text file you provided, you will need to pass the location as a parameter.

```python
def chillMetric(location):
    #Create Params
	    thermal_params = {"measure_loc":location}

```

With the runScript expression similar to:

```python
runScript('Melting.Fitting.chillMetric', {self.view.getChild("root").custom.location})

```

Note that you may have to adjust the path to the property.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 26, 2024, 5:54pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/4 "2024-07-26T17:54:45Z")

</div>

> [@JordanCClark](#):
>
> With the runScript expression similar to:

Don't forget the non optional poll rate param on runScript when passing arguments.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 26, 2024, 6:34pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/5 "2024-07-26T18:34:52Z")

</div>

I must have overlooked the text file. See it now, but it doesn't match the screenshot.

Yeah, need to do like you said, plus add the poll rate parameter.

---

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [July 26, 2024, 7:26pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/6 "2024-07-26T19:26:31Z")

</div>

I am using Vision, however I have referenced it this way in the past with Perspective.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 26, 2024, 7:31pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/7 "2024-07-26T19:31:57Z")

</div>

If the script is in a scripting file, you have to pass the parameters (no matter if you're using Vision or Perspective). You tagged the post as Perspective, so you got an answer using perspective.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 26, 2024, 7:33pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/9 "2024-07-26T19:33:40Z")

</div>

I did it for them.

---

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [July 26, 2024, 7:39pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/10 "2024-07-26T19:39:36Z")

</div>

Yep, just realized that. Its actually vision.

---

<div class="post-metadata">

**Author:** ![Aisha\_Shiddat](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@Aisha\_Shiddat](https://forum.inductiveautomation.com/u/Aisha_Shiddat)\
**Post date:** [July 29, 2024, 5:50pm UTC](https://forum.inductiveautomation.com/t/not-defined-global-name/93801/11 "2024-07-29T17:50:40Z")

</div>

This worked. I had to adjust the path property since this was done in vision. -Thanks
