
3.9 Task management library
===========================
Library outline
Following functions are provided to control execution of the application
programs or to manage execution of multiple tasks.
1. Time management
2. Semaphore control
3. Event flag
1. Time management
The time management functions can suspend execution of tasks for specified
period of time or can make tasks wait for events with limited wait time option
which avoids tasks to become dead-locked. The timer which can be used by the
application program is a local timer dedicated for the task. Time unit of the
timer is "Tick"(1 Tick = 8 msec).
name function
---------------+---------------------------------------------------
os_show_tim read timer
os_set_tim set timer
os_sync_tim suspend execution of task until specified time
of timer
os_wait_tim suspend execution of task for specified time period
* os_set_tim() sets specified value to the timer. This function sets
the timer of it's own task, the timer of another task cannot be set.
* os_show_tim() reads time value from the timer of current task.
* Execution of the current task is suspended by os_sync_tim() until
the timer reaches the specified time. ( Absolute wait)
* os_wait_tim() function suspends execution of the current task for
specified period of time ,like waiting for time-out. ( Relative
wait)
The time referred to in all task management library functions is based on
the software-timer of 8 msec unit. This timer is the basis of the operation of
the task management programs. Note that the contents of this timer does not
always agree with the actual passage of time. This is because the task
management programs are suspended while the CNC task of higher priority is
being executed and the timer is not updated during this period.