Contents

Generating Structured Text for Stateflow® Chart with Absolute Time Temporal Logic

This model shows the code generated for a Stateflow chart which uses absolute time temporal logic. This feature is currently only supported for Rockwell Automation RSLogix 5000 IDE. Simulate the model. Click on the scope to observe the "pulse" output.

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 RSLogix 5000 timers.

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');

NOTE: This feature is currently only supported for Rockwell Automation RSLogix IDE. So you will need to select either 'Rockwell RSLogix 5000: AOI' or 'Rockwell RSLogix 5000: Routine' as the target IDE before generating Structured Text.

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.

Was this topic helpful?