%% Generating Structured Text for Stateflow(R) Chart with Absolute Time Temporal Logic

%%
% 
%
% This model shows the code generated for a Stateflow chart which
% uses absolute time temporal logic. 
% Simulate the model. Click on the scope to observe the "pulse" output.


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

%%
% Open up the "Temporal" Stateflow chart. Notice that this chart uses
% absolute time temporal logic operators like 'after' and 'before'. These
% operators are mapped to Structured Text timer operations in the
% generated code.
open_system('plcdemo_sf_abs_time/Temporal');

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

%%
% 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.
%
%   Copyright 2002-2015 The MathWorks, Inc.
