%% Multirate Modeling in Multitasking Mode (VxWorks(R) OS)
% This example generates code for a multirate discrete-time model
% configured for a multitasking operating system target (VxWorks(R)).  The 
% model contains two sample times.  Inport block 1 and Inport block 2 specify 
% 1-second and 2-second sample times, respectively, which are enforced by 
% the setting of model configuration parameter *Periodic sample time constraint*.
% The solver is set for multitasking operation, which means a Rate Transition 
% block is required to ensure that data integrity is enforced when the 1-second 
% task preempts the 2-second task.  Simulink(R) and the code generator  
% enforce proper rate transitions.  This model specifies an explicit 
% Rate Transition block.  Alternatively, you can instruct Simulink(R) to 
% insert this block for you by setting model configuration parameter
% *Automatically handle rate transition for data transfer*. 
%
% The model is configured to display color-coded sample times with annotations. 
% To see them, after opening the model, update the diagram by pressing Ctrl+D. 
% To display the legend, press Ctrl+J. Red represents the fastest discrete 
% sample time in the model, green represents the second fastest, and yellow 
% represents mixed sample times.  
%
%   Copyright 2015-2019 The MathWorks, Inc.

%% Example Model
% 
model = 'rtwdemo_mrmtos';
open_system(model);
