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

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.

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

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

1 Like

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.

1 Like

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

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

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)?

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…

Use a Driven Tag Group for the tag. Tag Groups - Ignition User Manual 8.1 - Ignition Documentation

Configure the Driving Expression with:

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.

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

3 Likes

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.

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?

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.