Multitasking Emergency Stop Computer Integrated Manufacturing © 2013 Project Lead The Way, Inc.
Multitasks Multitasking Creating Multiple Tasks Presentation Name Course Name Unit # – Lesson #.# – Lesson Name Multitasks Multitasking Allows multiple operations to occur during the same time window Task main coordinates all tasks Creating Multiple Tasks Example: An emergency stop switch ends all operations within a system Task name (code within task) e.g., task e_stop Task main (code within task main) The operations for each program tasks with multitasks are executed during the same time window but not simultaneously. Each task is performed for a small amount of time in quick succession, resulting in near simultaneous execution.
Sample Task “task e_stop()”
Task Definition Task Definition declares that a task exists, indicates its name, and specifies its operation Task Definition is entered above task main and follows the same structure as task main
Task Call and Control Call and run code from task main startTask(taskname); stopTask(taskname); stopAllTasks(); //ends all tasks, including task main
References Carnegie Mellon Robotics Academy. (2011). ROBOTC. Retrieved from http://www.robotc.net Carnegie Mellon Robotics Academy. (2011). ROBOTC. Retrieved from http://www.robotc.net/forums/viewtopic.php?f=11&t=3341&sid=c0b638e4eb5ce566e39814809ccbdcda