# Where to use the script in label

**URL:** <https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 21, 2023, 10:18am UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182 "2023-11-21T10:18:19Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![chen\_zhe](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@chen\_zhe](https://forum.inductiveautomation.com/u/chen_zhe)\
**Post date:** [December 7, 2023, 2:54pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/21 "2023-12-07T14:54:46Z")

</div>

how about the class?how could i use it?

---

<div class="post-metadata">

**Author:** ![Estera\_Cioroch](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/estera_cioroch/32/59889_2.png) [@Estera\_Cioroch](https://forum.inductiveautomation.com/u/Estera_Cioroch)\
**Post date:** [December 7, 2023, 2:57pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/22 "2023-12-07T14:57:51Z")

</div>

This is seriously so useful! Didn't know you could do this, thanks for sharing! 🙂

---

<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:** [December 7, 2023, 3:04pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/23 "2023-12-07T15:04:41Z")

</div>

> [@Estera\_Cioroch](#):
>
> This is seriously so useful!

Using a dummy binding then a script transform is awfully convenient but terrible for performance and maintainability. Use an expression binding with `runScript()` that delegates to a project library script function. Avoid (most) script transforms.

---

<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:** [December 7, 2023, 3:08pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/24 "2023-12-07T15:08:29Z")

</div>

> [@chen\_zhe](#):
>
> `import numpy as np`

Any other problems in your script aside, numpy doesn't work in a Jython environment, so this script will always fail on this line anyways.

---

<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:** [December 7, 2023, 3:13pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/25 "2023-12-07T15:13:37Z")

</div>

> [@pturmel](#):
>
> Using a dummy binding then a script transform is awfully convenient but terrible for performance ...

Why is that, Phil? I'm just wondering happens under the hood? (Thank you for your education.)

---

<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:** [December 7, 2023, 3:17pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/26 "2023-12-07T15:17:02Z")

</div>

I don't know precisely why (though I have vague suspicions), but it shows up clearly in the timing tests I did with my Integration Toolkit's debug and timing functions.

---

<div class="post-metadata">

**Author:** ![Estera\_Cioroch](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/estera_cioroch/32/59889_2.png) [@Estera\_Cioroch](https://forum.inductiveautomation.com/u/Estera_Cioroch)\
**Post date:** [December 7, 2023, 3:19pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/27 "2023-12-07T15:19:41Z")

</div>

> [@pturmel](#):
>
> Use an expression binding with `runScript()` that delegates to a project library script function. Avoid (most) script transforms.

Thanks for the tips! I just recently started using more scripts (I had usually just stuck to expression bindings before) so this is all good information! Thank you!!

---

<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:** [December 7, 2023, 3:22pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/28 "2023-12-07T15:22:50Z")

</div>

> [@Estera\_Cioroch](#):
>
> all good information!

You should check out my Integration Toolkit module. Even if you don't end up using it, there are binding optimization discussions there, and linked, that will help you make performant, efficient systems. There are many things in Ignition that **need** jython scripts, but they can also be a crutch in other cases.

> [@Automation Professionals' Integration Toolkit Module](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934):
>
> Automation Professionals is pleased to announce the immediately availability of a major upgrade to its free Simulation Aids Integration Toolkit module. The new feature justifying the "major upgrade" language is the implementation of eleven thirty-one new expression functions which use iteration to accomplish complex transforms of datasets and lists, to or from other datasets and lists, applying filtering, ordering, and computed new columns along the way. While there are certain operations that…

---

<div class="post-metadata">

**Author:** ![Estera\_Cioroch](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/estera_cioroch/32/59889_2.png) [@Estera\_Cioroch](https://forum.inductiveautomation.com/u/Estera_Cioroch)\
**Post date:** [December 7, 2023, 3:49pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/29 "2023-12-07T15:49:04Z")

</div>

> [@pturmel](#):
>
> You should check out my Integration Toolkit module.

I'll do that! I'm currently looking for resources like this, so thank you!!

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [December 7, 2023, 7:14pm UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/30 "2023-12-07T19:14:33Z")

</div>

If your class has only one method (plus the init), there are chances it shouldn't be a class in the first place ;p

What is that class supposed to do, and how do you normally use it ?  
Or, asked in a broader way: What are you trying to achieve with it ?

---

<div class="post-metadata">

**Author:** ![chen\_zhe](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@chen\_zhe](https://forum.inductiveautomation.com/u/chen_zhe)\
**Post date:** [December 8, 2023, 12:00am UTC](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182/31 "2023-12-08T00:00:13Z")

</div>

I want to calculate the cumulative downtime after the Stop signal is connected, and then call the Scirpt to pass in the Stop signal. Clear to zero every morning and evening at 8 o'clock

[Previous page](https://forum.inductiveautomation.com/t/where-to-use-the-script-in-label/82182.md?page=1)
