Chapter 3 Introduction to MR308
- 18 -
3.2.2 Task Designation in Service call
Each task is identified by the ID number internally in MR308.
For example, the system says, "Start the task having the task ID number 1."
However, if a task number is directly written in a program, the resultant program would be very low in readability.
If, for instance, the following is entered in a program, the programmer is constantly required to know what the
No. 2 task is.
sta_tsk(2,1);
Further, if this program is viewed by another person, he/she does not understand at a glance what the No. 2
task is. To avoid such inconvenience, the MR308 provides means of specifying the task by name (function or
symbol name).
The program named "configurator cfg308 ,"which is supplied with the MR308, then automatically converts the
task name to the task ID number. This task identification system is schematized in Figure 3.11.
ID number
Name
Real-time OSProgram
Configurator
sta_tsk(Task name) Starting the task
having the designated
ID number
Figure 3.11 Task Identification
sta_tsk(ID_task,1);
This example specifies that a task corresponding to "ID_task" be invoked.
It should also be noted that task name-to-ID number conversion is effected at the time of program generation.
Therefore, the processing speed does not decrease due to this conversion feature.