Tag Path Questions

I am trying to use a tag event script to write to a client tag when the value changes. I believe my problem is in the tag path. I don’t get any errors for the script but it is not working. Any help would be appreciated.

	"""
	Fired whenever the current value changes in value or quality.

	Arguments:
		tag: The source tag object. A read-only wrapper for obtaining tag
		     properties.
		tagPath: The full path to the tag (String)
		previousValue: The previous value. This is a "qualified value", so it
		               has value, quality, and timestamp properties.
		currentValue: The current value. This is a "qualified value", so it has
		              value, quality, and timestamp properties.
		initialChange: A boolean flag indicating whether this event is due to
		               the first execution or initial subscription.
		missedEvents: A flag indicating that some events have been skipped due
		              to event overflow.
	"""
				
	prev = previousValue.value
	cur = currentValue.value
			
	if prev <> cur:
 		system.tag.write("[client]Test", cur) ```

Is the tag the script is defined on also a client tag?

image Top level tag or gateway tag.

To Client

image

Well… you can’t do that. Regular tags exist in the gateway, not part of any project. Vision Client Tags only exist in the client as part of the project they are defined in.

1 Like

I’ll see if I can find another way to do what I need. Thank you for the quick replies.

Consider using a client tag change event. It runs in the client and can write to client tags.

2 Likes