Introduction to Multi-Tasking

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Categories of I/O Devices
Chapter 4 Threads Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
IT Systems Multiprocessor System EN230-1 Justin Champion C208 –
1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Process management in Minix1 Processes Process is a program in execution. Program is a static entity while process is an active entity. Process Control.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
Chapter 1 and 2 Computer System and Operating System Overview
1 When to Switch Processes 3 triggers –System call, Interrupt and Trap System call –when a user program invokes a system call. e.g., a system call that.
Layers and Views of a Computer System Operating System Services Program creation Program execution Access to I/O devices Controlled access to files System.
I/O Systems ◦ Operating Systems ◦ CS550. Note:  Based on Operating Systems Concepts by Silberschatz, Galvin, and Gagne  Strongly recommended to read.
Processes and Threads.
1 Process States (1) Possible process states –running –blocked –ready Transitions between states shown.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Chapter 5 Operating System Support. Outline Operating system - Objective and function - types of OS Scheduling - Long term scheduling - Medium term scheduling.
Scheduling Basic scheduling policies, for OS schedulers (threads, tasks, processes) or thread library schedulers Review of Context Switching overheads.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
Operating System (Reference : OS[Silberschatz] + Norton 6e book slides)
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
CSCE451/851 Introduction to Operating Systems
SPiiPlus Training Class
SPiiPlus Training Class
Tips for Optimizing your MPiec Application Program
Module 12: I/O Systems I/O hardware Application I/O Interface
Processes and threads.
Diamond Motion Control Emma Shepherd & Matthew Pearson May 2011
Process Management Process Concept Why only the global variables?
TBPM Front-End Software Design Review
Operating System.
Sujata Ray Dey Maheshtala College Computer Science Department
Chapter 9: Virtual Memory
Chapter 1: Introduction
Chapter 8 Operating System Support
Chapter 3 – Process Concepts
William Stallings Computer Organization and Architecture
Lecture 21 Concurrency Introduction
CS 3305 System Calls Lecture 7.
Lecture 2: Introduction to Operating Systems
Processes A process is a running program.
KERNEL ARCHITECTURE.
Chapter 1: Introduction
Threads & multithreading
Chapter 1: Introduction
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
Process & its States Lecture 5.
Process Description and Control
Chapter 1 Introduction to Operating System
Introduction to Operating Systems
Threads and Concurrency
Sujata Ray Dey Maheshtala College Computer Science Department
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
Threads and Concurrency
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
CS149D Elements of Computer Science
Why Threads Are A Bad Idea (for most purposes)
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
Safety Framework and Program Management
Foundations and Definitions
Why Threads Are A Bad Idea (for most purposes)
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Why Threads Are A Bad Idea (for most purposes)
Chapter 13: I/O Systems.
Mr. M. D. Jamadar Assistant Professor
Module 12: I/O Systems I/O hardwared Application I/O Interface
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Introduction to Multi-Tasking

Terminology Program: A BASIC or IEC program Task: IEC61131-3 task containing one or more programs Process: Processing slot that runs a Task or BASIC program Kernel: Processing of the servo and motion firmware

Controller type determines the max number of processes Comparison table Controller type determines the max number of processes Controller # Processes Axes MC403 6 2½ / 3 (16 in s/w) MC405 10 4½ / 5 (16 in s/w) MC664 22 24 / 64 (64 in s/w) MC664-X 22 24 / 128 (128 in s/w) Euro404 10 4 (16 in S/W) Euro408 22 8 (16 in S/W)

Multi-Tasking: Benefits Division of Tasks Smaller, dedicated programs (processes) can be written to handle specific functions of the machine. Concurrency Each process acts like a virtual controller and operates independently of the others. Simplified Error Handling A simple process can be dedicated to error trapping with no overhead in the main tasks. Command Line The command line / Motion Perfect Link is always available, even when programs are running.

Multi-Tasking: Division of tasks STARTUP: Initialise Axis Parameters and User Memory (Generated by MotionPerfect) MAIN: Error Handler and Safety Interlocks MAIN (Error Handler) STARTUP (Axis Params /Variables) Runs Once HOMING: Axis Datuming Continuous Loop MOTION1: Main Motion Loop HOMING MOTION1 LADDER IEC61131-3 MOTION2 MOTION2: Alternative Motion Loop

Multi-Tasking: Servo Period 1 msec Servos & Motion System User User User Processor Interrupts Each interrupt causes a process switch. All data from running program and the line number are stored Data for next process slot is retrieved Programs run from where they left off last time As more programs are run, they appear to slow down.

Multi-Tasking: Servo Period 1 msec Servos & Motion System User User User 500 usec 500 usec Servos & Motion System User Servos & Motion User User 250 usec 250 usec 250 usec 250 usec Servos & Motion Sys Servos & Motion User Servos & Motion User Servos & Motion User

Multi-Tasking: Servo Period 1 msec Servos & Motion System User User User SYSTEM_LOAD (% of processing time) More axes running. Servo and Motion processing takes longer. Less time shared between multi-tasking processes.

Multi-Tasking: Program priority

Multi-Tasking: Program priority

Multi-Tasking: Program priority

Multi-Tasking: Program priority

* Expert tip ! See process % in Terminal #0 >>PROCESS Process Type Status Name Line hhhh:mm:ss.ms [CPU %] ------- ---- -------- -------------------------------- ----- ----------------------- 19 Slow Pause STARTUP 6 0000:00:11.995 [ 0.00%] 20 Fast Run USER_PROGRAM2 2 0000:00:15.671 [30.57%] 21 Fast Run USER_PROGRAM1 2 0000:00:16.526 [33.20%] 22 SYS Run Command Line 0000:00:49.191 [ 0.06%] 23 SYS Run Protocol Scheduler 0000:00:47.478 [ 4.89%] 24 SYS Run MPE 0000:00:49.195 [ 4.89%] 25 SYS Suspend CAN Server 0000:00:49.198 [ 0.00%] 26 SYS Run TCP/IP Server 0000:00:47.483 [ 4.90%] 27 SYS Run ECAT async 0000:00:47.485 [ 4.89%] 28 SYS Sleep[ 0] Data Backup 0000:00:47.487 [ 0.98%] 29 SYS Sleep[ 9] Directory Backup 0000:00:47.488 [ 0.00%] 33 SYS Run Display Manager 0000:00:47.491 [ 1.75%] KERNEL SYS Run Motion/Housekeeping 0000:00:49.207 [13.86%] >>

Kernel: Processing motion 1 msec Kernel System User User User SYSTEM_LOAD (% of processing time) Kernel runs closed loop and motion profile generation. System slot runs communications. User slots run BASIC and IEC programs. ?SYSTEM_LOAD 47.7697 >>

Multi-tasking and Motion Servo loops and velocity profile Move type Next move type Motion Buffers and Alarms

Multi-tasking and Motion BASIC Multi-Tasking Velocity Profile Unit Servo Control Runs BASIC programs SPEED=1200 ACCEL=3400 MOVE(340) WAIT IDLE PMOVE Generates motion profile points. NTYPE … MTYPE DPOS DEMAND_SPEED Calculates Servo control values for all axes. MPOS…ENCODER Servo control algorithm DAC_OUT Task switch 3 times per msec No guaranteed loop times. Processed once per servo period [Deterministic] Processed once per servo period [Deterministic]