Tasks

Tasks are the primary area where the project's data, image and vision tool processing will be created and managed. Tasks control the running and timing of the tools, allowing for serial or parallel processing.

A project can contain one or more Task, and each Task is comprised of one or more Blocks.

A Task can be triggered by an event (see Task Mode) or manually, after setting the Task Mode to Manual, using the following functions:

  • $Tasks.Task.RunAsync() (Recommended): This will run the task on a new thread and will return immediately.

  • $Tasks.Task.Run(): This will run the task synchronously on the current thread and Block until the task completes.
    Note: Do not use this method from the user interface (e.g. button click).
Note:
  • Manual triggers (i.e. $Tasks.<TaskName>.RunAsync()) will be ignored if the Task is already executing.
  • When the Task has been setup for Event triggers (Event, Timer Interval, etc.), the Task will always run on a separate, static thread.
  • Event triggers that are received while a Task is running will be queued.
  • For more information about triggering a Task, see the Task Mode topic.
  • It is not possible to abort or cancel a Task.