Blocking execution of system.tag.requestGroupExecution()

I have a Gateway Script that reads values from multiple tags, including Query tags, to compute an output every 4 seconds.

The query tags fetch values from a table with columns (timestamp, value), and keep only the value with the nearest timestamp from the current time.
I would like the query tags to be updated at the start of my gateway script so that I always fetch the accurate value, so I have added a group tag that they belong to and trigger their execution with system.tag.requestGroupExecution() at the start of the gateway script.

However, I see that system.tag.requestGroupExecution() only sends a request to the group tag to execute, and does not wait for actual refresh before carrying on with the rest of the script. My script ends up using not up-to-date values.

The answer may be that this is bad design and that we should query from db directly in the script instead of relying on query tags, but I would like to know if it is possible to achieve what I have described above in any case.

Thanks in advance for your help !

Yes.

No.

1 Like