set the value of a process variable in an expression

Certified Associate Developer

Hello community,

is it possible to set/change the value of a process variable in a scripttask/expression for example when a condition is true other than node output is stored as.

I know how to set a value of a processvariable in the node output, but can it be done in like setting the value of a localvariable?
example:
if(pv!fruit="Apple",
pv!color:"green",
""
)

Kind Regars,

Erik

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to erikb0001

    Ah i see.  No, the way you've done it is the correct way.  I've wished at times for the ability to update multiple PVs based on one expression (such as an expression that runs an expensive calculation, and i want to just run it once and save various aspects of the result to different PVs).  The only real alternative here is to run the expensive operation in an input variable (which sucks since input variable expressions STILL collapse the expression code they contain down to one line, upon saving...), then refer to that ACP in the different output expressions.  But even this still does require one output entry added for each PV you want to write into.

Children
No Data