7 thoughts on “Scheduling basics: Video

  1. Hi, Mr Burke

    @2.46s ” you can partition task t2″ Is there a way to do that partitioning in Simulink code generation scheduler?

    @6.33s ” you can use local data store for task t1″ Is there a way to create a task local data store in Simulink code generation scheduler?


    1. Hi Ahmed,

      Good questions:
      1.) To partition the tasks you can create atomic subsystems, this allows you to generate a separate function for any part of the model. (Note: the atomic subsystem can be Function called subsystem, a standard subsystem with the the “atomic” option turned on or a Model Reference block)
      2.) Depending on how you configure your model you have a couple of options
      a.) Use a rate transition block with the data protection enabled (maximum delay)
      b.) Use a rate transition block at the head of the “task”
      c.) Enable data latching on the inports.

      Thank you for the questions!

  2. Hi, Mr. Burke

    Thank you for your answer

    Indeed, I have used atomic subsystem in Simulink before to do functional partitioning for critical code sections and memory allocation. However, I liked your discussion about execution time partitioning. This helps in preventing slow rate tasks from being interrupted before finishing

    Assume that base rate is 0.1s and task t2 rate is 0.2s, we partitioned task t2 using atomic consecutive subsystems, how in Simulink to run the first atomic subsystem in the first 0.1s and the second subsystem in the second 0.1s so that the whole task t2 runs every 0.2s?

    Thanks for you effort in advance


  3. That is a big help Mr Burke,
    I didn’t know before that it is an option.

    Regarding rate transition block, could you elaborate on:

    1) When processing data transfers between tasks, the code generator makes these assumptions:
    Data transitions occur between a single reading task and a single writing task. What does that mean?

    2) For periodic tasks, how to ensure determinism for data transfers from slow-to-fast or slow-to-fast? What mechanisms?

    3) The rate transition block use for data integrity, for slow-to-fast periodic rate transitions double-buffering data transferred between rates is used, for fast-to-slow periodic rate transitions, a semaphore flag is used. For an asynchronous task, how to know which is faster and what mechanism to use for protection in this case?

    Thanks your a lot for your help


    Ahmed Hisham Abuelnaga

    1. Hi Ahmed,

      For these questions, I would recommend that you create a few simple example models to test out what the code generator does, doing so will enable you to quickly test out different scenarios.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.