Tag event script is not triggring

but the event is not triggering in the tag event value change script

Since that is a screen shot, something looks amiss. That writeBlocking line shouldn't be formatted that way. It appears as if it's been commented out.

As a side note, I would recommend not doing anything with sockets or queries in a tag value change script.

What indicates to you that this script isn't triggering?

As an aside, you should use the system.date functions, instead of the datetime module.

I would recommend doing this in a Gateway Tag Changed Script.

3 Likes

This maybe missing the project name from the named query params as well if its in the gateway scope?

Are you seeing any errors in your logs when this tries to execute. That would be most helpful.

1 Like

It's in a Tag Value Changed script, so it is in Gateway Scope.

1 Like

Right that needs the project name doesn't it? Since it's the gateway scope and project agnostic

Would expect it to be system.db.runNamedQuery("Some Project", "ParameterSetPoint Change", params)

3 Likes

I just commented that coz I don't need it.

If this is in a tag, it resides in the gateway, so I also suspect you wouldn't get the hostname or username.

3 Likes

Please post code rather than picutres of code so we don't have to type it all out again to test or modify it.
See here:

1 Like

It is triggering, but it's also crashing. You need to go and check the logs, I'm willing to bet you'll find an AttributeError.
Why ?
Because system.security.getUserName() can't run there. The script executes on the gateway, because it's on a tag's value change event, and the gateway doesn't have this kind of information. You'll need a different approach.
What are you trying to do ?

I believe he cropped the # out:
image

There are so many things going wrong with this post !
You shouldn't post screenshots of code, but if you do... at least include the whole thing, and the line numbers if you have line numbers.

2 Likes

They did, because they "don't need it"

1 Like