Main Content

Fold temporary variable using function block instance output variable

Optimize output variables by using expression folding

Since R2022b

Model Configuration Pane: PLC Code Generation / Optimization

Description

The Fold temporary variable using Function Block instance output variable parameter optimizes the code for the output variables of function blocks generated from reusable Simulink® subsystems, Stateflow® charts, or MATLAB® Function blocks by removing temporary variable assignments that are not required.

Settings

off (default) | on

Default: off

On

Generates optimized code for output variables of function blocks by folding temporary variables into a single expression.

Off

The generated code for function block instance output variables uses temporary variable assignments.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOn
Safety precautionNo impact

Programmatic Use

Parameter:PLC_FoldFBCallOutputVar
Type: string
Value: 'on' | 'off'
Default: 'off'

Limitations

This option is not supported for the Rockwell Automation® Studio 5000 and OMRON Sysmac® Studio target IDEs.

Version History

Introduced in R2022b