# Forcing a Tag to Rewrite Value 0 Every 10 Seconds

**URL:** <https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345>\
**Category:** Ignition\
**Created:** [February 13, 2025, 11:07pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345 "2025-02-13T23:07:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoseJardelLuciano](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoseJardelLuciano](https://forum.inductiveautomation.com/u/JoseJardelLuciano)\
**Post date:** [February 13, 2025, 11:07pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/1 "2025-02-13T23:07:51Z")

</div>

Hello, community!

I’m trying to ensure that a tag in Ignition continuously receives the value `0` every 10 seconds **if its current value is 0**.

**Scenario:**

- The tag receives values from a PLC.
- When the tag is `0`, I need Ignition to keep rewriting `0` every 10 seconds.
- This is necessary because the value `0` might be interpreted as an "unchanged state," and some external systems may not recognize that it is still valid.

**What I've tried so far:**

- A **Gateway Event Script (Timer)** running every 10 seconds.
- Using `system.tag.writeBlocking()` to rewrite the value.
- Logging for debugging, where I can see that the script is executing correctly.

**Problem:**

- The script runs and logs that the write operation was executed, but in **Tag Diagnostics** , the tag’s value **does not change or show an updated timestamp**.
- It seems like Ignition is not rewriting `0` to the tag if it is already `0`.

In short, I need the tag to be published in MQTT even if the value is zero.

---

<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:** [February 13, 2025, 11:14pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/2 "2025-02-13T23:14:11Z")

</div>

> [@JoseJardelLuciano](#):
>
> the tag’s value **does not change**

Why would you expect it to change if it was zero and you write a zero to it?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [February 13, 2025, 11:15pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/3 "2025-02-13T23:15:17Z")

</div>

> [@JoseJardelLuciano](#):
>
> In short, I need the tag to be published in MQTT even if the value is zero.

Script the write/publish to Mqtt directly instead of using `tag.write*`? I believe the MQTT modules have some scripting methods available.

---

<div class="post-metadata">

**Author:** ![JoseJardelLuciano](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoseJardelLuciano](https://forum.inductiveautomation.com/u/JoseJardelLuciano)\
**Post date:** [February 13, 2025, 11:54pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/4 "2025-02-13T23:54:50Z")

</div>

I just need it to be published even if the value doesn't change.

We use this tag to feed a dashboard into another system. If the value is 0 and it is not published, the other dashboard will not display the value correctly, and it is necessary to always send the data.

---

<div class="post-metadata">

**Author:** ![JoseJardelLuciano](https://avatars.discourse-cdn.com/v4/letter/j/35a633/32.png) [@JoseJardelLuciano](https://forum.inductiveautomation.com/u/JoseJardelLuciano)\
**Post date:** [February 13, 2025, 11:57pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/5 "2025-02-13T23:57:05Z")

</div>

It must be a folder where the tags for this project have been mapped.

From this folder, when the tag is published, it is sent via MQTT Transmission to AWS IoT Core.

---

<div class="post-metadata">

**Author:** ![Gaurav.Shitole](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gaurav.shitole/32/72050_2.png) [@Gaurav.Shitole](https://forum.inductiveautomation.com/u/Gaurav.Shitole)\
**Post date:** [February 14, 2025, 12:33am UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/6 "2025-02-14T00:33:17Z")

</div>

Ok so with system.tag.writeBlocking, can you try adding same tag path twice in list and write -1,0 in it

---

<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 14, 2025, 1:04am UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/7 "2025-02-14T01:04:57Z")

</div>

MQTT and OPC are both designed to very deliberately and explicitly **NOT** do this, and cannot be configured to do it anyways. Your Ignition tag will not show a new timestamp without an **actual** change. Either to value or quality.

Your dashboard is broken.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 14, 2025, 1:41pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/8 "2025-02-14T13:41:03Z")

</div>

> [@JoseJardelLuciano](#):
>
> some external systems may not recognize that it is still valid.

Seems like those systems need to be fixed, not the tag.

Surely you can add a default value into your dashboard of 0.

Cluthering your db/mqtt/stream with empty useless data is inefficient and **costly**.  
aws will charge more money if you send more (or bigger) messages, so don't do this.

You will want to use connectioning pings if your system thinks the connection is broken (check connectivity)

> **[Securely Connect IoT Devices – AWS IoT Core Pricing – Amazon Web Services](https://aws.amazon.com/iot-core/pricing/)**
>
> AWS IoT Core is a platform that enables you to connect devices to AWS Services and other devices, secure data and interactions, process and act upon device data, and enable applications to interact with devices even when they are offline. Explore the...

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/4/04defa49f8a9eae32ad1f218220587b30f8f2ebb.png)

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [February 14, 2025, 2:46pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/9 "2025-02-14T14:46:45Z")

</div>

I agree with @ryan.white that you'll have to script a manual MQTT write. I also agree that the system requiring data every 10 seconds is broken. What if the value sits at a 1 or any other value for more than 10 seconds? Is it also assumed to be broken? Values don't naturally write to 0 in MQTT if a system goes down unless the LWT is configured to do so. In Sparkplug there's no control over the LWT but I haven't used AWS so not sure how it's handled with it.

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [February 14, 2025, 4:11pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/10 "2025-02-14T16:11:31Z")

</div>

If the tag is reading directly from a PLC, I have found that it creates an error if I try to write to it since that puts it in a read only state.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/35c0c1c848d5b1db6d495f31976e11c9f8b641af.png)

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [February 14, 2025, 4:17pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/11 "2025-02-14T16:17:54Z")

</div>

A way I have had to do it in the past is put a tag change script on the PLC tag and write to another memory tag that you can then update if needed.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [February 14, 2025, 4:24pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/12 "2025-02-14T16:24:56Z")

</div>

This is because that tag is set as read-only somewhere. PLC tags in general are not read-only by default.

---

<div class="post-metadata">

**Author:** ![CTrenkamp](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ctrenkamp/32/38440_2.png) [@CTrenkamp](https://forum.inductiveautomation.com/u/CTrenkamp)\
**Post date:** [February 14, 2025, 6:08pm UTC](https://forum.inductiveautomation.com/t/forcing-a-tag-to-rewrite-value-0-every-10-seconds/102345/13 "2025-02-14T18:08:41Z")

</div>

The tag I used for the example isn't set to read only.
