Gateway timer script is writing out to a tag that does not exist in my tag browser. Shouldn't there be a fault somewhere for this?

Gateway timer script is running every second.

dayofmonth = system.date.format(system.date.now(), "dd")
hourofday = int(system.date.format(system.date.now(), "H")) + 1
minofday = system.date.format(system.date.now(), "mm")
wdvalues = [dayofmonth,hourofday,minofday]
writepaths = ["[edge]config/day","[edge]Watch Dog/Hour","[edge]config/minute"]
system.tag.writeBlocking(writepaths, wdvalues)

the tag "[edge]Watch Dog/Hour" does not exist in the tag browser.

Shouldn't there be a fault for this?

I don't know if there should be a fault for that but it would show up in the logs if there is one.

But why are you running a script every second for this? Why not create expression tags for each of your variables? e.g.,

dateExtract(now(), "second")

This will have much better performance than the script - unless there is something I don't understand about Edge.

Beware of errors on day, hour, minute and hour rollovers. e.g, If the script runs at 01:59:59.990 then hourofday will return '1' but the minofday runs a fraction of a second later and will return 0. You're now out by an hour. You need to figure out if this is a problem or not.

1 Like

To answer the question (Although you need to really think though what @Transistor is saying) there isn't necessarily an error instead you get a return array of the Quality of the writes.

system.tag.writeBlocking(
	[
	"[default]sometag", ##This tag doesn't exist
	"[default]TestBit"],##This tag does exist
	[0,0]
)

Output:

>>> 
[Bad_NotFound, Good]
>>> 
2 Likes

On the gateway page under Status > Diagnostics > Logs I typed in "Watch Dog" into the filter and this shows up

Starting write, paths=[[edge]config/day, [edge]Watch Dog/Hour, [edge]config/minute], values=[[14, Good, Fri Feb 14 11:58:27 PST 2025 (1739563107742)], [12, Good, Fri Feb 14 11:58:27 PST 2025 (1739563107742)], [58, Good, Fri Feb 14 11:58:27 PST 2025 (1739563107742)]]

As far as why it is being done this way. This was provided to us by the customer as a reference to follow.

Its likely being used as a heartbeat/comms check on the machine the tags are on. I've also seen a bit being written high/low every second.

Personally I prefer just an integer value that is incremented on one side and echoed by the other side.

1 Like

You mentioned Tag Browser, the panel, but haven't mentioned the provider you are looking at in the browser.

What exactly is the problem you are looking to solve with this thread?

Are you sure there is no tag provider in your system called "edge"? The Tag Browser has a dropdown for the tag provider. It typically starts as "default" on a standard install.

If you are just looking for why they used these tag paths in this script, if they provided it as an example it could be code from another system with different provider names/tags.