Writing to memory tag from a custom property with a binding

Hi,

I am trying to write to a Memory tag from a custom property that is updated by its binding when its updated my script looks like this

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
tagPath = "[default]Path/To/Your/MemoryTag"
value = "self.custom.Value"
system.tag.writeAsync([tagPath], [value])

I know I’ve done something wrong but I can’t find it

Is this supposed to have quotes around it? If you’re writing the new value of the custom property to the tag (I can’t tell if this is what you are doing), you’ll want to use currentValue.value. If you’re still stuck, what isn’t working – is it writing the wrong value to the tag, or not writing at all? Have you confirmed the script is firing in the first place?

Tip: Wiki - how to post code on this forum.

1 Like