User guide

18
VTB USER GUIDE
5.2 Task Time
TASK TIME, like TASK PLC, works at fixed time. It deffers from that for two features:
a) it has a lower priprity and it can be INTERRUPTED by TASK PLC;
b) it hasn't limit to managing of the IFS functions of VTB.
The scan time of this task is programmable at multiple of the sampling time of TASK PLC. TASK TIME is useful for the
managing of timed cycles and with medium response time, furthermore the possibility of calling all IFS functions makes
it of great utility, ensuring constant time to software. Typical sample time can be about 5 or 10 milliseconds, with witch
it's possible to manage a complex PLC cycle with a lot of I/O channels. If the elapsed time of this task overcomes its
sample time the system will continue to work stopping the cooperative tasks but task plc will continue to run.
TASK TIME HAS A SECTION TO INSERT THE OBJECT, therefore all the object inserted inside will run in this task at the
programmed SAMPLING TIME.
5.3 Task Main
TASK MAIN is called continuously by VTB cycle running in COOPERATIVE mode with PAGE TASK. Therefore a static cycle
on TASK MAIN will stop the PAGE TASK and vice versa. Its scanning time depends by the code contained in all the other
TASKS. Usually this TASK manages repetitive cycles as control of emergency or alarm states, graphic control etc. where
there isn't the need for constant time. However its scanning time can be very fast, also in the order of few microseconds,
when the code inside the task is very short.
TASK MAIN HAS A SECTION TO INSERT THE OBJECTS, therefore all the object inserted inside will run in COOPERATIVE
mode and regardless of which page is displayed.
TASK MAIN provides three sections to insert the CODE:
INIT PAGE
MASTER CYCLE
PAGE FUNCTIONS
Also there is a section MASTER EVENT but it has been left only for compatibility with older versions and therefore it
must not be used.
INIT PAGE
The code in this section runs only one time at the start of the program and usually it handles the initialization of the
global variables in the application. In this section we can write any type of code as long as it isn't STATIC CODE which
can block the program.
MASTER CYCLE
This is the cyclic section called by system in cooperative mode with PAGE TASK.
PAGE FUNCTIONS
This section is the container for all the functions used by the application. They will be visible GLOBALLY from all TASKS
5.4 Page Task
PAGE TASK works like TASK MAIN, with which shares the scanning time in COOPERATIVE mode. The peculiarity of this
task is its code will be loaded only when the page is running. The IFS function pagina(n) allows to run the page, written
before with VTB environment, destroying the previous one. PAGES have to be seen as a set of code-graphics managed
at convenience. Commonly PAGE TASKS are useful in systems equipped with HMI pages where they are both graphics
part and associated code. In systems without HMI, pages are only part of code which runs when commended by
pagina(n) function. As for TASK MAIN the scan time depends by the length of code inside all the other tasks. Usually the
PAGE TASK manages cycles of setting, preparing and display of data application, with control of the graphics and data
input.
PAGE TASK HAS A SECTION TO INSERT THE OBJECTS, therefore all the object inserted inside will run in COOPERATIVE
mode and regardless of which page is displayed.
PAGE TASK provides three sections to insert the CODE:
INIT PAGE
MASTER CYCLE
PAGE FUNCTIONS