I have a main() VBScript procedure in my Aveva Edge project, which I want to execute when a trigger happens and when starting the project. I don't know where I can define that. Can anyone help me? Thanks.
I have a main() VBScript procedure in my Aveva Edge project, which I want to execute when a trigger happens and when starting the project. I don't know where I can define that. Can anyone help me? Thanks.
More details: I have a tag "Clock5Sec" that changes it value every 5 seconds. It's defined in the Scheduler.
I write "$RunGlobalProcedureOnTrigger("Clock5Sec", "main")" in Main procedures, but it doesn't seem to perform that action. However, if I write "Call main()" it does. "$RunGlobalProcedureOnTrigger("Clock5Sec", "main")" might not be the needed call.
main() and other procedures are in the same file, in Main Procedures, may I have define in separate files?
The built-in function called RunGlobalProcedureOnTrigger() is a client-side (i.e., Viewer) function. It is a no-op when called from a server-side task. You said, you wanted to call your VBScript procedure called main() at startup, then every time the tag called Clock5Sec changes. If you want to call main() when the project starts, then you would do that in the VBScript task Startup Script. If you want to call it again every time the tag called Clock5Sec changes, then I would suggest you do it in the Scheduler like this,
or like this,
Thanks Larry, I finally got the first solution. Great!