# Trigger gateway event on seconds

**URL:** <https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 30, 2026, 7:09am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653 "2026-01-30T07:09:39Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hema\_T](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hema\_T](https://forum.inductiveautomation.com/u/Hema_T)\
**Post date:** [January 30, 2026, 7:09am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/1 "2026-01-30T07:09:39Z")

</div>

Hi Team ,

We need to trigger transaction groups hourly using a tag, with the trigger written via a gateway event script. The requirement is to execute it at the 29th minute and 55th second of every hour, but we’re unable to find a way to schedule it at the second level. Could someone please help?

---

<div class="post-metadata">

**Author:** ![JVDM](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@JVDM](https://forum.inductiveautomation.com/u/JVDM)\
**Post date:** [January 30, 2026, 7:24am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/2 "2026-01-30T07:24:49Z")

</div>

I assume you are currently using the Scheduled Gateway Event Script?

Have you concidered using a Gateway Tag Change script? You could look at the gateway time (now) and toggle a tag whenever the time is equal to xx:29:55.

I’m not sure how sturdy this solution is, but it might be worth a try. Good luck!

---

<div class="post-metadata">

**Author:** ![Hema\_T](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hema\_T](https://forum.inductiveautomation.com/u/Hema_T)\
**Post date:** [January 30, 2026, 8:50am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/3 "2026-01-30T08:50:40Z")

</div>

We are not using a scheduled script. The trigger is handled through an expression tag, and when the condition evaluates to true, a memory tag is set to true to trigger the transaction group.

---

<div class="post-metadata">

**Author:** ![JVDM](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@JVDM](https://forum.inductiveautomation.com/u/JVDM)\
**Post date:** [January 30, 2026, 9:08am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/4 "2026-01-30T09:08:02Z")

</div>

Okay. I’m not sure what exactly your question is. Would you like help with the expression in the expression tag? If so, please share your current solution and the solution you’re looking for.

---

<div class="post-metadata">

**Author:** ![Hema\_T](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hema\_T](https://forum.inductiveautomation.com/u/Hema_T)\
**Post date:** [January 30, 2026, 9:19am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/5 "2026-01-30T09:19:07Z")

</div>

> [@Hema\_T](#):
>
> The trigger is handled through an expression tag, and when the condition evaluates to true, a memory tag is set to true to trigger the transaction group.

This is our current solution - The trigger is handled through an expression tag, and when the condition evaluates to true, a memory tag is set to true to trigger the transaction group.

In order to avoid more threads , we are trying to move the expression to gateway event script .

---

<div class="post-metadata">

**Author:** ![JVDM](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@JVDM](https://forum.inductiveautomation.com/u/JVDM)\
**Post date:** [January 30, 2026, 10:03am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/6 "2026-01-30T10:03:16Z")

</div>

The current Gateway Event Scripts don’t have a more sophisticated way to send this trigger with your wished precision.

If you compromise on precision, and trigger at xx:29:00 instead of xx:29:55, it can be done easily, but I understand if you’re not willing to do that.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [January 30, 2026, 11:16am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/7 "2026-01-30T11:16:15Z")

</div>

> [@JVDM](#):
>
> The current Gateway Event Scripts don’t have a more sophisticated way to send this trigger with your wished precision.

Whilst scheduled scripts don’t have a [Seconds] property (Feature request, IA?), before scheduled scripts were introduced, you would create a timer script and compare if CurTime == Target, with that you can do any custom range, including what the OP wants.

I’m not a big fan of TGs, I generally script my inserts instead, but with the TG triggers it should be possible to have multiple trigger tags that are on a combined condition of each, one for hour, one for minute and the last for seconds. Or create a single tag for trigger, and use my aforementioned gateway timer script to check if it should be set high or not.

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [January 30, 2026, 11:30am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/8 "2026-01-30T11:30:12Z")

</div>

> [@Gateway Script Only at 4pm](https://forum.inductiveautomation.com/t/gateway-script-only-at-4pm/19979/8):
>
> Bad. If the gateway experiences any heavy load at 4pm, this expression can miss the event. Especially if using fixed delay. If using fixed period, and the event that normally falls a 3:59:59 is slightly delayed, this can fire twice in a row. The chance is low, so you wouldn't be likely to see either problem often, but it would happen. I would use something like this in a project script module: from java.util import Date lastTrigPath = '[default]some/path/to/datetime/tag' # Simple functio…

---

<div class="post-metadata">

**Author:** ![JVDM](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@JVDM](https://forum.inductiveautomation.com/u/JVDM)\
**Post date:** [January 30, 2026, 11:31am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/9 "2026-01-30T11:31:03Z")

</div>

If I understand it correctly, you’re suggesting a timer script that checks every second, whether the time is xx:29:55?

I’m not too familiar with efficiency, but wouldn’t an expression tag with the same check, which is their current solution (i assume), be just as _sophisticated_?

---

<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:** [January 30, 2026, 11:32am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/10 "2026-01-30T11:32:15Z")

</div>

Two expression tags:

TriggerVal  
`dateFormat(now(), 'mm:ss')`

Trigger  
`{[.]TriggerVal} = '29:55'`

Then use the trigger tag in a gateway event script _EDIT: This will also work with TGs_

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [January 30, 2026, 11:34am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/11 "2026-01-30T11:34:00Z")

</div>

> [@JVDM](#):
>
> I’m not too familiar with efficiency, but wouldn’t an expression tag with the same check, which is their current solution (i assume), be just as _sophisticated_?

Yes, but TG’s have their limitations, which is why I never generally sell that module to my customers.

So I script both the time check and the DB inserts.

---

<div class="post-metadata">

**Author:** ![Nol](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@Nol](https://forum.inductiveautomation.com/u/Nol)\
**Post date:** [January 30, 2026, 4:35pm UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/12 "2026-01-30T16:35:02Z")

</div>

How accurate of data are you expecting? Specifying 59:55 makes me think this is some kind of accounting before an hourly volume rollover? Either way I would do this all in the PLC instead.

Build a routine that compares system min/secs to 59:55 then when true it moves your live values into holding tags. If your PLC is clearing it at the top of the hour then that's even better. Just add moves into new tags on the same rung. Then run a scheduled event in Ignition shortly after that captures all those values and records them. This ensure that even if some tasks are executing on the gateway it will never be delayed or missed..

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [February 1, 2026, 7:30pm UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/13 "2026-02-01T19:30:45Z")

</div>

Never use real time clocks in PLCs for reporting purposes, they’re always wrong. Gateways are best for this as they become the single source of truth on the timestamps

---

<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:** [February 1, 2026, 10:28pm UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/14 "2026-02-01T22:28:52Z")

</div>

> [@David\_Stone](#):
>
> Never use real time clocks in PLCs for reporting purposes

Unless they are Rockwell, and using PTP time synchronization to a proper grand master. They will be **more** accurate than any general purpose system using NTP.

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [February 1, 2026, 10:47pm UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/15 "2026-02-01T22:47:40Z")

</div>

There's no warnings when the PTP drops and the existence of a properly configured grand master is very rare. This is why I recommend against it. You can also use NTP on most PLCs, but its never set up and you shoudn't rely on it.

---

<div class="post-metadata">

**Author:** ![Hema\_T](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hema\_T](https://forum.inductiveautomation.com/u/Hema_T)\
**Post date:** [February 7, 2026, 6:09am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/16 "2026-02-07T06:09:38Z")

</div>

```python
#Added this script to record the time at 29 min 50 sec to get Target 60
    if not initialChange:
    
        if currentValue.value :
            
            provider = 'MES'
            
            query = {
              "options": {
                "includeUdtMembers": True,
                "includeUdtDefinitions": False
              },
              "condition": {
                "path": "Chennai/*/Hourly Recording/Record",
                "attributes": {
                  "values": [],
                  "requireAll": True
                }
              },
              "returnProperties": [
                "tagType",
                "quality"
              ]
            }
            results = system.tag.query(provider, query)
            for tag in results:
                    system.tag.writeBlocking(str(tag["fullPath"]), True)	

```

I have been using this expression in global tags -

if ( dateExtract({[.]Current Time},"minute")= 29 && (dateExtract({[.]Current Time},"second") \>= 54 && dateExtract({[.]Current Time},"second")\<= 59), 1, 0)

The global tag becomes **true** at the 29th minute and around the 54th second. Based on this, another memory record tag is being set to **true** across nearly 100 instances. However, the record tag write is getting delayed by about **10 seconds** , and this delay occurs **randomly across different machines**.

I have attached the code which is triggering the record tag to true

---

<div class="post-metadata">

**Author:** ![Hema\_T](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@Hema\_T](https://forum.inductiveautomation.com/u/Hema_T)\
**Post date:** [February 7, 2026, 6:51am UTC](https://forum.inductiveautomation.com/t/trigger-gateway-event-on-seconds/113653/17 "2026-02-07T06:51:20Z")

</div>

this expression is written in every 100 instances , we just changed it to global tags instead of every instance
