System.tag.read in client produces "object has no attribute 'tag'"

Ignition 7.9 vision

I’m trying to do a simple tag read in a custom method called “init” defined in the root container of a window. This “init” is called from the visionWindowOpened event of the same window.

visionWindowOpened:

root = system.gui.getParentWindow(event).getRootContainer()
root.init()

init:

root = self
path = 'Line ' + str(root.LineNumber) + '/Saddle Plating Data/' + str(root.SaddleIndex) + '/core_weight'
root.UnplatedWgt = system.tag.read(path).value

The error message that I am getting is:

File "<event:visionWindowOpened>", line 4, in <module>
File "<custom-function init>", line 11, in init
	AttributeError: 'com.inductiveautomation.ignition.common.script.Imm' object has no attribute 'tag'

I don’t understand why ‘tag’ would not be on ‘system’ especially when in a script on the client.

well, apparently there was NOTHING wrong with what I was doing. A simple restart of the Gateway fixed the problem.

This begs the question of how the Gateway could get into a state where it looses track of it’s own libraries.

1 Like

I am running into this too. Did this problem ever happen to you again? I restarted the gateway and it worked for a short time, then did not.

I have only ever seen this happen when a script is written such that it’s inadvertently overwriting the system variable locally.

This ended up being the issue for me.