I am trying to migrate a DeltaV operate event type scheduler. But I am stuck on OnWrite function, which I think i can't go further anymore after research and GSC call (GSC suggested to use timer which worked but I don't like).
I first created a variable Number1, animation of this variable DLSYS.Read("CM/COLOR.CV")
then I entered the script of onWrite as below, which gave me the error message : "A function whose declared type is neiter 'void' nor 'any' must return a value"
// let newValue=DLSYS.CondReadAsync("CM/COLOR.CV").Value
let newValue=DLSYS.Read("CM/COLOR.CV").Value
if (newValue==1)
{ENV.RunAsync(GL.Library.X_GREEN_S, "green.txt")}
else if (newValue==2)
{ENV.RunAsync(GL.Library.X_RED_B, "red.txt")}
How to solve this problem? Any suggest is appreciated.
In reply to Matt Stoner:
In reply to shen:
Andre Dicaire
In reply to Andre Dicaire:
Can you please tell me what's the script to return the new value from the CM/COLOR.CV?
apparently, my script is not correct : let newValue=DLSYS.Read("CM/COLOR.CV").Value
I thought that "set number1 variable equal to the parameter" is achieved by using animation script of variable Number1: DLSYS.Read("CM/COLOR.CV").
I also though the script in OnWrite is the script like deltav operate event schedule action script. Any example?