Reference not found quality

Hi,

I am trying to use a expression I used in another gateway (which worked),and now it isn’t.

The expression tag is a boolean using the “isAlarmActive” expression function written like this:

isAlarmActive("[.]/*")

Basically I want to read all the tags inside the same folder as my expression tag, and return True if at least one of them has an active alarm.

When I run the tag diagnostics, it says “REFERENCE_NOT_FOUND”. I tried to put a static path instead of “[.]/*”, but I still get that error.

I ran some test, I isolated th problem to the expression function in general. In the Script Console, this works:

system.tag.read("PLC/SS03/58/EStop/5810ES01/Tripped").value

but in expression it doesn’t:

runScript("system.tag.read('PLC/SS03/58/EStop/5810ES01/Tripped').value")

I got an answer from the support services:

"So for runScripts, since it is being run in a tag, it is executing in the global scope, so it can only use global resources. Therefore project scripts will not work.

The isAlarmActive function expects an alarm to be present. From what you showed me of your UDT, it looked like there were no alarms specified there. I tried your exact same expression in an expression tag of mine, but there was an alarm in the paths that it would be looking at, and it worked fine. Took the alarm away, and I got reference not found.

That error indicates that whatever the expression is trying to do it can’t find a reference to that particular object. Not that it can’t do the function. So for the runScript, the tag can do runscripts, but it can’t find what you are pointing at. The isAlarmActive is valid, but it can’t find anything at the path you specified."

1 Like