(Has been removed) Change some Stateflow chart properties to enable Ladder Diagram code generation
plcprepareforladder will be removed in a future release. For more information, see Compatibility Considerations.
plcprepareforladder(
changes certain properties of a Stateflow® chart (Stateflow) so that the chart is ready for Ladder Diagram code generation. The following properties are changed:chartPath
)
The data types of inputs and outputs are changed to Boolean.
The action language of the chart is changed to C.
Super step semantics and chart initialization at execution are disabled.
Open the model plcdemo_ladder_three_aspect
.
open_system('plcdemo_ladder_three_aspect')
The model contains a subsystem Subsys
, which contains a Stateflow chart, 3Aspect
. Save the model elsewhere with the name plcdemo_ladder_three_aspect_copy
.
Enable super step semantics for the chart. In the chart properties, select Enable Super Step Semantics.
Check whether the Stateflow chart is ready for Ladder Diagram code generation.
plccheckforladder('plcdemo_ladder_three_aspect_copy/Subsys/3Aspect')
You see the following error message in the Diagnostic Viewer window:
Chart must not have superstep semantics enabled in Objects: 'Subsys/3Aspect'
Prepare the chart for Ladder Diagram code generation.
plcprepareforladder('plcdemo_ladder_three_aspect_copy/Subsys/3Aspect')
Check again whether the chart is ready for Ladder Diagram code generation.
plccheckforladder('plcdemo_ladder_three_aspect_copy/Subsys/3Aspect')
There are no more error messages. The function plcprepareforladder
has disabled super step semantics for the chart.
Before you use this function, make a backup copy of your model because the function changes chart properties.
The function does not change all properties that would allow for Ladder Diagram code generation. You must explicitly change certain properties. For the full list of chart properties that are not allowed, see Restrictions on Stateflow Chart for Ladder Diagram Generation.