# Trouble with runScript

**URL:** <https://forum.inductiveautomation.com/t/trouble-with-runscript/7291>\
**Category:** Ignition\
**Created:** [September 19, 2013, 6:26pm UTC](https://forum.inductiveautomation.com/t/trouble-with-runscript/7291 "2013-09-19T18:26:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [September 19, 2013, 6:26pm UTC](https://forum.inductiveautomation.com/t/trouble-with-runscript/7291/1 "2013-09-19T18:26:51Z")

</div>

Im trying to figure out how to use runScript in an expression tag, starting with a simple exercise:

I created the script app.equipment.CalcCurStat:

```auto
def CalcCurStat(cond1):
  import system
  if cond1 == 1: return 2
```

then in my tags expression:

runScript(“app.equipment.CalcCurStat(‘1’)”,5000)

but my tag is null. any ideas where im going wrong?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 19, 2013, 6:33pm UTC](https://forum.inductiveautomation.com/t/trouble-with-runscript/7291/2 "2013-09-19T18:33:27Z")

</div>

Right, so this is a bit unfortunate, but you can’t access script modules from the runScript() expression function on a tag.

Tags are globally scoped (belong to the gateway, basically), whereas a script module belongs to a specific project, so there’s no access.

This is one of the problems that the introduction of a globally-scoped script module area will solve in Ignition 7.7.

---

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [September 19, 2013, 6:44pm UTC](https://forum.inductiveautomation.com/t/trouble-with-runscript/7291/3 "2013-09-19T18:44:41Z")

</div>

when does 7.7 come out? is there a beta?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 19, 2013, 8:06pm UTC](https://forum.inductiveautomation.com/t/trouble-with-runscript/7291/4 "2013-09-19T20:06:29Z")

</div>

Next year, nothing even approximating a beta yet.

---

<div class="post-metadata">

**Author:** ![cja7928](https://avatars.discourse-cdn.com/v4/letter/c/258eb7/32.png) [@cja7928](https://forum.inductiveautomation.com/u/cja7928)\
**Post date:** [September 19, 2013, 11:10pm UTC](https://forum.inductiveautomation.com/t/trouble-with-runscript/7291/5 "2013-09-19T23:10:28Z")

</div>

OK, looking forward to the update - the global script module will be a huge help. thank you!
