OK, digging around a bit further I see that under "Main Task" and the Program/Phase Schedule that all the other sub-tasks are listed. So they are executed sequentially according to the order listed. Right?
Hi
Correct, but as always.
The routines( or you called them sub-tasks) within the programs are called based on the JSR. Also the tasks may not always be called as they look in the project tree as some are time based and some event based etc.
Donnchadh
I think the answer you got was confusing, with apologies to Donnchadh. I will try to define everything as clearly as I can.
In Logix5000 there are 3 "levels".....
Tasks
--Programs
----Routines
You can have multiple Tasks the number depends on the platform (32 in a ControlLogix, 8 in a CompactLogix)
Tasks can be one of the following...
Continuous (or Cyclic) - you can only have one of these...
Periodic - triggered by time schedule
Event - triggered by something happening
Task execution.
The Continuous (Cyclic) task trundles away all day executing the Programs within it, when it has finished, it starts again, automatically.
If Periodic Tasks are configured, they
will always "interrupt" the Continuous Task, and the programs within the periodic task will be executed, until the task is completed. A periodic task runs once only, until it is triggered again (by time).
If Event Tasks are configured, they
will always "interrupt" the Continuous Task, and the programs within the event task will be executed, until the task is completed. An event task runs once only, until it is triggered again (by event).
Task
priority settings determine which task will run, interrupting whichever task is currently executing. A task with higher priority will interrupt execution of a lower priority task. Tasks with the
same priority are "time-sliced" - this is the only occasion where the controller can be envisaged to be running multiple tasks simultaneously, but in actual fact it is simply switching between the tasks rapidly.
Program execution.
Within each and every task, is a collection of one or more
Programs.
Programs are executed in the order determined by the Program/Phase schedule, in the Task Properties. This is configurable, and the programs are shown in the Controller Organiser list in the order they are scheduled to execute. All programs are executed.
Routine execution.
Within each and every program, is a collection of one or more
Routines.
The controller
only executes the routine that is specified as the "Main Routine" in the Program configuration, and that routine is shown at the head of the list of routines in the organiser, with it's "Page 1" adornment.
The other routines are simply listed alphanumerically below the main routine, because there is no implied "order of execution". The controller does not execute these routines, they are executed by instruction code in the main routine, e.g JSR and FOR will execute these other routines as programmed in code. These other routines are therefore sub-routines, and it is up to the programmer to decide when they should be executed.
Hope this helps your understanding.