Main Content

Generate enum Cast Function

Generate typecast function to convert enumeration type

Since R2020a

Model Configuration Pane: PLC Code Generation / Identifiers


The Generate enum cast function generates the enum type conversion code. The target PLC IDE must support enum data types.


off (default) | on

Simulink® PLC Coder™ autogenerates the enum type conversion code.


Manually create a MATLAB function to convert the enum type value to an integer or to convert an integer to an enum type value.

Recommended Settings

DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

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

Version History

Introduced in R2020a