Hi There,
I'm trying to program some simple logic using scripts in Advantech's WebAccess.
The script can be in either Java, VB or Tcl.
I have basic (as in rudamentory) programming skills from back in the day when computer screens where green! -however as the task is pretty basic I think I can manage with a little assistance in the syntax -i have a good grasp of the logic and am happy to build it one brick at a time.
Would really appreciate it if anyone with experience in using webaccess could assist.
I have a logical event and i want to measure the time (in seconds or minutes) since that event occurred.
My script reads as follows:
if {R1_A1} then {SETVAL @timer=[GETVAL %TTMTIME]}
"timer" is my variable i want to use to record the time of the event "R1_A1".
I want my timer to count when R1_A1 goes to false so I can leave my "alarm" activated for 5mins after the event.
i.e. a DELAY_OFF timer.
...but so far the value of my timer only ever reads 0.00.
I was planning to then incorporate something like...
if %TTMTIME-timer >= 5mins... but i think the syntax of the above is incorrect so i can't progress past this stage.
I have tried without the GETVAL & without @.
fyi: my timer is an AccPoint (Accumulation Tag) and I have used %TTMTIME as it's Sorce tag.
I hope someone can help.
Ian.
Good Answers: