Unable to read/write to tags 2 directories up using '[.]/../../tag'

Hello,

I have a script that was failing to read a tag that was in a folder 2 levels up from the triggering tag (change event). I confirmed in documentation that I should be able to do this by using '..' twice:

Additionally, you can use ".. " (two periods) to go back one folder from the current relative position, for example [.]../../tag allows you to reference a Tag that is two folders up.

I made a few test tags: There are 3 layers of folders. The bottom layer has a tag with a change event that attempts to write to a tag in one of the parent folders. When pointed up one level with the path '[.]../writeMe', it writes with no issue. When pointed up to the top level with '[.]../../writeMe', it fails to write.

Is there something that might be causing this to fail that I am missing? Is there a different syntax that can be used here, aside from using the full tag paths?

Thanks,
Andrew

image

I haven't built this folder structure out and tested this, but I'm pretty sure that you're second example is one level further than the path you were using.

[.]../writeMe is at the same level as the Layer 3 folder. [.]../../writeMe would be to a tag which was in the Layer 1 folder, however, looking at your screen shot, the second writeMe tag is actually in the Layers folder. I believe the correct path would be [.]../../../writeMe.

Irose,

Good catch! thank you!

Unfortunately, I'm still unable to reach this tag after correcting the location. Please see below corrected structure and the script attempting the write:

Thanks again,
Andrew

I'm not sure. I set up this structure on a dev gateway and it worked as expected.


image

I will note, however, that the best way to write this script would be to combine the writes into one.

def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
	system.tag.writeBlocking(['[.]../writeMe','[.]../../writeMe'],['Layer 2','Layer 1'])

This server was using V8.1.20, so may not be a one to one with what you have.

If you open the diagnostics view on the Tag Editor, is there any error reported?

Might be worth having support poke around.

Thanks again for your help Irose.

When I loaded the project this morning, this was working exactly as expected. I'm not sure why it was giving me so much trouble previously...