Task Present

Text Language Definition

function TaskPresent(TaskAddress:pointer):boolean;

Description

If a controller resident task is running this command returns true. If it is not running it returns false. This command is often used to monitor a task to know when it has finished. The parameter is an address most often identified with the TaskAddr function.

Escapes

The Task Present command does not generate any escapes.

Examples

A cleaner way to stop the light from blinking is to have a boolean variable that is set active when the task starts and turned off by the procedure that would like the task to stop. The process then manages its own resources rather than requiring the procedure doing the aborting to manage them:

The following procedure performs a variety of moves:

This procedure starts PerformMotion, does other activities, and then waits for PerformMotion to finish before moving on to other activities:

Related Topics

Yield
Abort Task
Begin Task
Schedule Task