What is the correct way to use runScript in UDT Expression Tag?

Hi There,

I have a script in Project library with Gateway Scope, which I am trying to use in UDT Expression tag. As a parameter to script, I am passing a tag address from MQTT Engine. I read the manual but its still not working.

here is the script.
runScript('myscript.myfunction',0,"[MQTT Engine]/Test/filler")

Is there anything wrong with this script? what is the correct way?

thanks

You're passing the tag path as a string. It may be the correct way, if your script does expect a path and uses system.tag.readBlocking, but if it expects the tag value, you need to use {[MQTT Engine]/Test/filler}

1 Like

You may also need to configure the project containing myscript as the Gateway Scripting Project. (Only one project can be the gateway scripting project, so if set to something else, you'll have to consolidate those projects.)

yes the script uses system.tag.readBlocking and path I am providing as a string.

Should this be an inheritable project?

No it doesn't have to be.

2 Likes