Scheduled Cicode

Hi;

I want a function in Cicode to run continuously for a time period that I set. For example, the code I wrote will run every 20sec in the background . How do I make this application?

I am using Power Scada Operation to develop my project.

The function will be as follows;

/////////////////////////////////////////////////////////////
FUNCTION
Schedule()
INT nIntTagValue;
WHILE 1 DO
nIntTagValue = TagRead("VALUE");
nIntTagValue = (nIntTagValue/2) * 3;
TagWrite("VALUE_CALC", nIntTagValue);
END
END
/////////////////////////////////////////////////////////////

Thank you for your reply.

Parents
  • Firstly; thanks all for replies.

    My function is working every 20 sec now as my expectation. I have changed my project by following Nick's reply. I added an event with period=20 sec, action=myfunc(), name=GLOBAL configuration and also I set [Event]InhibitEvent = 0, [Event]Server =1 at citect.ini.

    Just I didn't understand a point about event name. If I change the event name "GLOBAL", the event is not working.
    Why the name should be "GLOBAL" and not somethingelse?
Reply
  • Firstly; thanks all for replies.

    My function is working every 20 sec now as my expectation. I have changed my project by following Nick's reply. I added an event with period=20 sec, action=myfunc(), name=GLOBAL configuration and also I set [Event]InhibitEvent = 0, [Event]Server =1 at citect.ini.

    Just I didn't understand a point about event name. If I change the event name "GLOBAL", the event is not working.
    Why the name should be "GLOBAL" and not somethingelse?
Children
No Data