Referencing properties from a script

Hello, I am trying to use a tag event script (value changed) to update a database value if it is above a certain session property

if currentValue > session.windgust:

Like this, although this doesnt work. But I do not have the dropdown to select any properties and I cant seem to find a way of referencing them from googling either,
Is it actually possible to do this?

Gateway events happen… well, on the gateway, outside of any project’s scope. As far as I know, they don’t have access to session properties.

You might need to create a windgust tag instead, which can then be referenced from gateway scripts.


Okay thanks for the response that’s unfortunately not a preferable option for me though but might do the job.

How is session.windgust defined? You say you are doing it on a tag event script - on which tag? Is it a tag that is measuring windgust?

1 Like

The tag is the actual wind speed, I’m trying to get a max value over the last hour which I am achieving using transaction group but as far as i can tell there is no function to log the max value as it occurs (I just have it executing every 30 seconds which is already a lot and still leaves the possibility for missed max values)
so my idea was to monitor this actual wind speed tag change separately and then say if any of these change values are higher than the logged max it would replace it to give me a more accurate maximum gusting value.

So the windgust property would be that max speed ?
This really should be a tag, not a session prop.

1 Like

Use tag historian to log the value, then wherever you need the maximum you can use an aggregate to pull the max over whatever time frame.

You could also pull it using a query tag if wanted.

There are several ways to accomplish this, use a custom tag property, do it at the device level.

What is your preference?

1 Like

Thank you for the help guys i made a query tag to store the information like i was doing with the session prop and I think it does the job