Main Content

Generate Functions Instead of Function Block

Enable generation of function definitions in place of function block definitions

Since R2021a

Model Configuration Pane: PLC Code Generation

Description

Use this parameter to control whether the generated Structured Text code contains Function instead of Function Block definitions. There are certain cases where you may not be able to generate code with Function instead of Function Block. For example, if your Simulink® subsystem or MATLAB® Function block has internal state or persistent variables. In such cases, the software issues a diagnostic warning.

Dependencies

To enable this parameter, set Target IDE to Phoenix Contact PC WORX 6.0 or KW-Software MULTIPROG 5.0.

Settings

off (default) | on
On

The generated Structured Text code contains Function instead of Function Block where possible.

Off

The generated structured text code utilizes the default behavior of the software.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOn
Safety precautionNo impact

Programmatic Use

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

Version History

Introduced in R2021a