Task Configuration
A Task is a time unit in the processing of an IEC program. It is defined by a name, a priority and by a type determining which condition will trigger the start of the task. This condition can be defined by a time only (cyclic).
For each task you can now specify a series of programs that will be started by the task.
The combination of priority and condition will determine in which choronological order the tasks will be executed.
In the Online Mode the task processing can be monitored in a diagram.
The Task Configuration is found as an object in the Ressources register card the Object Organizer. The Task editor is opened in a bipartited window.
In the left part of the window the tasks are represented in a configuration tree. At the topmost position you will always find the entry 'Taskconfiguration'. Below there are the entries for the particular tasks, represented by the task name. Below each task entry the assigned program calls are inserted.
In the right part of the window a dialog will be displayed which belongs to the currently marked entry in the configuration tree. Here you can configure the tasks and program calls.
Notice | |
Data loss Please do not use the same string function in several tasks, because this may cause program faults by overwriting. |
Working with the Task Configuration
The most important commands you find in the context menu (right mouse button).
At the heading of the task configuration are the words "Task Configuration." If a plus sign is located before the words, then the sequence list is closed. By doubleclicking on the list or pressing <Enter>, you can open the list. A minus sign now appears. By doubleclicking once more, you can close the list again.
- For every task, there is a list of program call-ups attached. Likewise, you can open and close this list the same way.
- With the "Insert" "Insert Task" command, you can insert a task.
- With the "Insert" "Append Task" command, you can insert a task at the end of the configuration tree.
- With the "Insert" "Insert Program Call", a program call will be inserted.
Further on for each entry in the configuration tree an appropriate configuration dialog will appear in the right part of the window. There options can be activated/deactivated resp. inputs to editor fields can be made. Depending on which entry is selected in the configuration tree, there will be the dialog for defining the 'Taskattributes' or the dialog for defining a 'Program Call'. The settings made in the dialogs will be taken over to the configuration tree as soon as the focus is set to the tree again.
A task name or program name can also get edited in the configuration tree. For this perform a mouseclick on the name or select the entry and press the <Space> button to open an edit frame.
You can use the arrow keys to select the previous or next entry in the configuration tree.
'Insert' 'Insert Task' or 'Insert' 'Append Task'
With this command you can insert a new task into the task configuration. If a task is selected, then the "Insert Task" command will be at your disposal. The new task will be inserted after the selected one. If the words Task Configuration are selected, then the "Append Task" is available, and the new task will be appended to the end of the existing list. The dialog box will open for you to set the task attributes.
Insert the desired attributes:
- Name: a name for the task; with this name the task is represented in the configuration tree; the name can be edited there after a mouseclick on the entry or after pressing the <Space> key when the entry is selected.
- Priority (0-3): (a number between 0 and 31; 0 is the highest priority, 31 is the lowest),
- Type:
- cyclic: The task will be processed cyclic according to the time definition given in the field 'Interval'.
Freewheeling, triggered by event or triggered by external event: These task types are not supported!
Properties:
- Interval (for type 'cyclic'): the period of time, after which the task should be restarted. If you enter a number, then you can choose the desired unit in the selection box behind the edit field: milliseconds [ms] or microseconds [µs]. Inputs in [ms]-format will be shown in the TIME format (e.g. "t#200ms") as soon as the window gets repainted; but you also can directly enter the value in TIME format. Inputs in [ms] will always be displayed as a pure number (e.g. "300").
'Insert' 'Insert Program Call' or 'Insert' 'Append Program Call'
With these commands you will open the dialog box for entering a program call to a task in the task configuration. With "Insert Program Call", the new program call is inserted in front of the cursor, and with "Append Program Call", the program call is appended to the end of the existing list.
In the field, specify a valid program name for your project, or open the Input Assistant with the button... or with <F2> to select a valid program name. The program name can also get edited in the configuration tree. For this perform a mouseclick on the name or select the entry and press the <Space> button to open an edit frame. If the selected program requires input variables, then enter these in their usual form and of the declared type (for example, prg(invar:=17)).
'Extras' 'Set Debug Task'
With this command a debugging task can be set in Online mode in the task configuration. The text [DEBUG] will appear after the set task.
The debugging capabilities apply, then, only to this task. In other words, the program only stops at a breakpoint if the program is gone through by the set task. The setting of the Debug Task is stored in the project and will be set again automatically at log in / download.
Cancel the Debug Mode
To cancel the "Debug-Mode"
- choose "Task configuration"
- open the Context menu
- choose „Set Debug Task“
'Extras' 'Display Callstack'
If the program is stopped at a breakpoint during debugging, then this command can be used to show the callstack of the corresponding POU. For this purpose the debug task must be selected in the task configuration tree. The window 'Callstack of task <task name>' will open. There you get the name of the POU and the breakpoint position (e.g. "prog_x (2)" for line 2 of POU prog_x) . Below the complete call stack is shown in backward order. If you press button 'Go To', the focus will jump to that position in the POU which is currently marked in the callstack.