# I want to run a script on backend. Where the script will run without any need of execution just on startup

**URL:** <https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451>\
**Category:** Ignition\
**Tags:** ignition79, ignition80, ignition81, scripting, vision\
**Created:** [March 22, 2022, 12:45pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451 "2022-03-22T12:45:24Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikunj.pipariya](https://avatars.discourse-cdn.com/v4/letter/n/cc9497/32.png) [@nikunj.pipariya](https://forum.inductiveautomation.com/u/nikunj.pipariya)\
**Post date:** [March 22, 2022, 12:45pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/1 "2022-03-22T12:45:24Z")

</div>

I want to create a script which can be run on back end of the SCADA without any specific button execution. How can it be done? Can anyone share there ideas on this.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 22, 2022, 12:55pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/2 "2022-03-22T12:55:23Z")

</div>

There are gateway timer events for cases where you want to run the script every X seconds/minutes/hours. There are gateway tag events where you can run them on changes of a gateway tag (normally some PLC tag but can be anything). In new versions there’s also Scheduled Scripts were you can use Crontab to determine when the scripts one which gives you a lot of flexibility - you can make it run the at 1 PM every day or whatever you really want.

Look under Gateway Event in Designer to see all your options. Here’s some documentation [Gateway Event Scripts - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts)

You can also have a client send a message to the gateway that triggers a gateway script though you did say you don’t want it from a button so I assume no client interaction is necessary.

If you have not already I highly recommend taking the Inductive University courses to get a nice overview of everything Ignition has to offer [Browse the Lesson Library at Inductive University](https://inductiveuniversity.com/courses/whats-new-in-ignition-8/8.0)

---

<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:** [March 22, 2022, 1:21pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/3 "2022-03-22T13:21:43Z")

</div>

Your question is quite vague.

@bkarabinchak.psi has done a good job of giving you some options.

What version of Ignition are you using?  
What are you trying to accomplish with this script?  
When does it need to execute?

Give us some specific information and you’ll get more specific answers.

---

<div class="post-metadata">

**Author:** ![nikunj.pipariya](https://avatars.discourse-cdn.com/v4/letter/n/cc9497/32.png) [@nikunj.pipariya](https://forum.inductiveautomation.com/u/nikunj.pipariya)\
**Post date:** [March 22, 2022, 1:48pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/4 "2022-03-22T13:48:43Z")

</div>

V8.1  
Objective : Write tag values  
Period : Every 2 Seconds  
Logic : If System minute is 5 or 10 or 15 or 20 or 25 or 30 … 0r 60 then  
Write Memory tag to true  
End if  
If memory tag = true then  
Modbus Tag to Memory Tag  
Write Memory tag to false  
end if

---

<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:** [March 22, 2022, 2:09pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/5 "2022-03-22T14:09:23Z")

</div>

> [@nikunj.pipariya](#):
>
> Period : Every 2 Seconds  
> Logic : If System minute is 5 or 10 or 15 or 20 or 25 or 30 … 0r 60 then

Why have a period of 2 seconds if you only care about every 5 minutes?

> [@nikunj.pipariya](#):
>
> If memory tag = true then  
> Modbus Tag to Memory Tag  
> Write Memory tag to false  
> end if

Your pseudo code isn't real clear, but why are you writing a Modbus tag to a Memory Tag? Is this the same memory tag that you are setting to True every five minutes (I don't believe it is as that wouldn't make much since)?

---

<div class="post-metadata">

**Author:** ![nikunj.pipariya](https://avatars.discourse-cdn.com/v4/letter/n/cc9497/32.png) [@nikunj.pipariya](https://forum.inductiveautomation.com/u/nikunj.pipariya)\
**Post date:** [March 22, 2022, 2:28pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/6 "2022-03-22T14:28:19Z")

</div>

both memory tag are different…  
Yes 2s timer can be increased that’s not the problem.  
I want to move modbus tag value to a memory tag so that for five minutes I have a stable value which I am using in calculation…

---

<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:** [March 22, 2022, 2:50pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/7 "2022-03-22T14:50:58Z")

</div>

Use a Driven Tag Group for the tag. [Tag Groups - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Tag+Groups)

Configure the Driving Expression with:

```auto
getMinute(now()) % 5

```

Set the Driving Comparison to `=`  
Set the Comparison Value to `0.0`  
Set the One Shot to `True`

The tag group will execute one time every 5 minutes updating the Modbus value.

---

<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:** [March 22, 2022, 3:03pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/8 "2022-03-22T15:03:02Z")

</div>

This seems like a good case for the scheduled scripts introduced in 8.1.6: [Gateway Event Scripts - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts#GatewayEventScripts-GatewayScheduledScripts)

---

<div class="post-metadata">

**Author:** ![nikunj.pipariya](https://avatars.discourse-cdn.com/v4/letter/n/cc9497/32.png) [@nikunj.pipariya](https://forum.inductiveautomation.com/u/nikunj.pipariya)\
**Post date:** [March 25, 2022, 4:54am UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/9 "2022-03-25T04:54:06Z")

</div>

> [@nikunj.pipariya](#):
>
> mov

Objective: I want to transfer my data of few tags to other dummy tags exactly when my trigger tag is enable or its value gets true. I want to use the static value after every 5 minutes to do my calculations.

Problem: I have made a script to trigger a tag on every 5 minutes but I want to know where should I write script to pass the values of tags to dummy tags when the trigger button is activated.

---

<div class="post-metadata">

**Author:** ![SKA](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ska/32/29528_2.png) [@SKA](https://forum.inductiveautomation.com/u/SKA)\
**Post date:** [March 25, 2022, 6:57am UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/10 "2022-03-25T06:57:43Z")

</div>

If the expression is evaluated ever 2 seconds (as i asumed per the Q in the start).  
Wouldnt it trigger atleast 30 times during the minute being like 5?

---

<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:** [March 25, 2022, 12:22pm UTC](https://forum.inductiveautomation.com/t/i-want-to-run-a-script-on-backend-where-the-script-will-run-without-any-need-of-execution-just-on-startup/57451/11 "2022-03-25T12:22:16Z")

</div>

With the one shot property set to true, the tag group would only execute once every 5 minutes. Any tag assigned to the group would only update once every 5 minutes.

There is no need for a timer or for memory tags.
