cja7928
1
Im trying to figure out how to use runScript in an expression tag, starting with a simple exercise:
I created the script app.equipment.CalcCurStat:
def CalcCurStat(cond1):
import system
if cond1 == 1: return 2
then in my tags expression:
runScript(“app.equipment.CalcCurStat(‘1’)”,5000)
but my tag is null. any ideas where im going wrong?
Right, so this is a bit unfortunate, but you can’t access script modules from the runScript() expression function on a tag.
Tags are globally scoped (belong to the gateway, basically), whereas a script module belongs to a specific project, so there’s no access.
This is one of the problems that the introduction of a globally-scoped script module area will solve in Ignition 7.7.
cja7928
3
when does 7.7 come out? is there a beta?
Next year, nothing even approximating a beta yet.
cja7928
5
OK, looking forward to the update - the global script module will be a huge help. thank you!