%% Airport Conveyer Belt Control System
% 
%   Copyright 2007-2016 The MathWorks, Inc.
%
% This model shows the code generated for a Airport Conveyer Belt
% Controller subsystem. Simulate the model. Observe the animation of the conveyer belt. 

mdl = 'plcdemo_airport_conveyer';
evalc('open_system(mdl)');
evalc('sim(mdl)');

%%
% Open up the "Controller" subsystem. Open the Stateflow(R) chart named
% "Control" chart inside it. This chart implements the control logic
% for starting and stopping the conveyer belt motor depending on sensor
% inputs.
open_system('plcdemo_airport_conveyer/Controller/Control');

%%
% You can generate PLC Structured Text code for this subsystem by 
% right-clicking on the subsystem block and select 
% PLC Code -> Generate Code for Subsystem
% Alternatively, you can use the following command
% generatedFiles = plcgeneratecode('plcdemo_cruise_control/Controller');

%%
% After the code generation, the Diagnostic Viewer window 
% is displayed with hyperlinks to the generated code files.
% You can open the generated files by clicking on the links.
