Real Time Systems - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Real Time Systems

Description:

... design approach used within RT-UML nicely supports the modeling of temporally ... a. initially 3 delivery robots are available, one for each production line ... – PowerPoint PPT presentation

Number of Views:23
Avg rating:3.0/5.0
Slides: 18
Provided by: phil7
Category:

less

Transcript and Presenter's Notes

Title: Real Time Systems


1
Real Time Systems
  • Miscellaneous
  • Topics

2
Review
3
Outline
  • Exception Services
  • More on Timing Services
  • Cardinality and Capsule Structure

4
Exception Services
  • as we will see in upcoming weeks, fault tolerance
    is a critical requirement of almost any real-time
    system exception handling therefore becomes an
    important aspect of system design
  • the Exception Services of RoseRT provide us with
    the concept of Exception (system) ports through
    which capsules will raise and handle exception
    signals (RTExceptionSignal)

5
Exception Services (2)
  • exception ports are of type Exception
  • exception signals are of type RTExceptionSignal
  • RTExceptionSignal methods
  • raise( ) exceptions must be raised by the
    application
  • defined exception signals
  • userError(some user-defined RTTyped value)
  • arithmaticError( ) error()
  • notFoundError( ) notUnderstoodError( )
  • serviceAccessError( ) streamError( )
  • subclassResponsibilityError( )
  • timesliceError( )

6
Exception Services (3)
  • example
  • // on entry to deliver state
  • // raise error if SAP registration fails
  • if ( robotPort.registerSAP(deliveryService)
    ! 1 )
  • errorPort.serviceAccessError(failed to connect
    to delivery service).raise( )
  • // within transition to Error state
  • RTString eMessage (RTString )getMsg()-gtgetData
    ()
  • char eMessage (char )getMsg()-gtgetData()
  • eLog.log(eMessage)

7
More on Timing Services
  • another critical aspect of designing a real-time
    system is the ability to model temporal
    information
  • the event-based, state machine centric design
    approach used within RT-UML nicely supports the
    modeling of temporally ordered events,
  • however, in order to model timed or periodic
    events (commonly found within RTS), we need
    another set of services - Timing Services

8
More on Timing Services (2)
  • the time services provide both relative and
    absolute timer functions
  • built-in type RTTimespec provides a means of
    specifying time variables in seconds (or nsecs)
  • timing ports provide a mechanism for capsules to
    set / cancel timers and access system time
  • methods informIn( ), informEvery( ), informAt(
    ), cancelTimer( RTTimerID), currentTime( )
  • built-in type RTTimerID provides a means of
    identifying specific timing port actions

9
More on Timing Services (3)
  • example
  • // set a periodic timer on entry to Operate
    state
  • // note RTTimerID perTID is defined on the
    capsule
  • RTTimespec updatePeriod(0, 750000000)
  • perTID perTimerPort.informEvery(updatePeriod)
  • // cancel timer on entry to Shutdown state
  • if ( perTimerPort.cancelTimer(perTID) ! 1 )
  • systemErrorPort.userError(cancel timer
  • error).raise( )

10
More on Timing Services (4)
  • another example
  • // note the following yields a common run-time
    error // (bad priority on a timer port)
  • someTimerPort.informIn(3, 500000000)
  • // informIn is an overloaded method
  • //where in the signature below, prio is optional
  • TiminginformIn( RTTimespec, int prio)
  • // and what you likely meant was
  • someTimerPort.informIn(RTTimespec(3,
    500000000))

11
Cardinality and Capsule Structure
  • cardinality on capsule roles
  • fixed defines the number of replicated capsule
    roles to create at containing capsule creation
  • optional / plug-in defines the maximum number
    of capsule roles which can be created dynamically
    by the containing capsule
  • cardinality on ports
  • determines the number of instances of a port
  • required to allow connections with replicated
    capsule roles
  • each replicated port shares a common protocol

12
Cardinality and Capsule Structure - Common
Structural Patterns
  • Star

13
Cardinality and Capsule Structure - Common
Structural Patterns (2)
  • Bus

14
Cardinality and Capsule Structure - Common
Structural Patterns (3)
  • Array

15
Cardinality and Capsule Structure - Common
Structural Patterns (4)
  • Combination

16
Miscellaneous Exercise
  • modify the Production Line structure diagrams to
    support the following new requirements
  • two more production lines have been added
  • each production line is equipped with 5 identical
    workstations capable of producing widgets
  • a. initially 3 delivery robots are available, one
    for each production line
  • b. later a 4th robot becomes available and the
    manager decides it is best that they be viewed as
    belonging to the entire plant and are thus shared
    by all production lines

17
Questions
Write a Comment
User Comments (0)
About PowerShow.com