Select the automatically generated identifier naming rules.
Specify how you want the software to name the Function block instances it generates for the subsystem. When you select this option, the software uses the subsystem instance name as the name of the Function blocks in the generated code. By default, the software generates index-based instance names.
This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: off
Uses the subsystem instance name as the name of the Function block instances in the generated code.
Uses auto-generated index-based instance names for the Function blocks in the generated code.
Parameter:
PLC_FBUseSubsystemInstanceName |
Type: string |
Value:
'on' | 'off' |
Default:
'off' |
If your custom target IDE version supports long name identifiers, you can use this option along with the Maximum identifier length to specify the maximum number of characters in the generated function, type definition, and variable names. By default, the software complies with the maximum identifier length of standard versions of the target IDE and ignores unsupported values specified in the Maximum identifier length.
This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: off
Override target default maximum identifier length in the generated code.
The generated code uses the default identifier length of the target IDE.
Parameter:
PLC_OverrideDefaultNameLength |
Type: string |
Value:
'on' | 'off' |
Default:
'off' |
Specify the maximum number of characters in generated function, type definition, and variable names. This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: 31
Minimum: 31
Maximum: 256
You can use this parameter to limit the number of characters in function, type definition, and variable names. Many target IDEs have their own restrictions for these names. Simulink® PLC Coder™ complies with target IDE limitations.
Parameter: PLC_RTWMaxIdLength |
Type: int |
Value: 31 to 256 |
Default: 31 |
Use this option to enable enum names to be used as the identifier names instead of enum values. The PLC target IDE must support enum type.
This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: off
Override target default enum behavior and always have enum names instead of enum values.
The generated code uses the enum behavior of the target IDE.
Parameter:
PLC_GenerateEnumSymbolicName |
Type: string |
Value:
'on' | 'off' |
Default:
'off' |
Autogenerate the enum type conversion code. The target PLC IDE must support enum type.
This option is available in the Configuration Parameters dialog box, PLC Code Generation > Identifiers pane .
Default: off
Simulink PLC Coderautogenerates 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.
Parameter:
PLC_GenerateEnumCastFunction |
Type: string |
Value:
'on' | 'off' |
Default:
'off' |
Use this option to remove the ssmethod
type from the top-level
subsystem argument interface. When this option is enabled, the software removes the
ssmethod
type and converts the subsystem initialization code
from switch case statement to conditional if
statement. As a
result, the generated code has the same interface as the model subsystem.
This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: off
Remove top level function block ssmethod
type
in generated code.
Generated code contains ssmethod
type Function
block and switch case statements.
Parameter:
PLC_RemoveTopFBSSMethodType |
Type: string |
Value:
'on' | 'off' |
Default:
'off' |
Prevent renaming the SS_OUTPUT
type to
SS_STEP
type from the top-level subsystem argument interface.
When you select this option, the software emits the same ssMethod
type in the code generation for both top and non-top level blocks.
This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: off
Generated code for top-level block does not contain the
SS_STEP
type in generated code.
Generated code contains SS_STEP
AND
SS_OUTPUT
type function blocks.
Parameter:
PLC_RemoveSSStep |
Type: string |
Value:
'on' | 'off' |
Default:
'off' |
With this option, you can generate code with logging instrumentation to collect
run-time data on supported PLC targets. The PLC target IDEs must have support for
inout
variables. For Rockwell
Automation® targets, you can set up an Open Platform Communications (OPC) server
and use the Simulation Data Inspector (SDI) in Simulink to visualize and monitor the logging data.
This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: off
Generate Function block logging code for supported targets.
No logging instrumentation is included in the generated code.
Parameter:
PLC_GenerateLoggingCode |
Type: string |
Value:
'on' | 'off' |
Default:
'off' |
Specify whether to use the same reserved names as those specified in the Reserved names field of the Simulation Target pane in the Configuration Parameters dialog box. This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: off
Uses the same reserved names as those specified in the Reserved names filed of the Simulation Target pane in the Configuration Parameters dialog box.
Does not use the same reserved names as those specified in the Simulation Target > Identifiers pane pane.
Parameter: PLC_RTWUseSimReservedNames |
Type: string |
Value: 'on' | 'off' |
Default: 'off' |
Enter the names of variables or functions in the generated code that you do not want to be used. This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: ( )
Changes the names of variables or functions in the generated code to avoid name conflicts with identifiers in custom code. Reserved names must be fewer than 256 characters in length.
Start each reserved name with a letter or an underscore.
Each reserved name must contain only letters, numbers, or underscores.
Separate the reserved names by using commas or spaces.
Parameter: PLC_RTWReservedNames |
Type: string |
Value: string |
Default: '' |
Specify the names of identifiers for which you want to suppress definitions. This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Default: ( )
Suppresses the definition of identifiers, such as those for function blocks, variables, constants, and user types in the generated code. This suppression allows the generated code to refer to these identifiers. When you import the generated code into the PLC IDE, you must provide these definitions.
Start each name with a letter or an underscore.
Each name must contain only letters, numbers, or underscores.
Separate the names by using spaces or commas.
Parameter: PLC_ExternalDefinedNames |
Type: string |
Value: string |
Default: '' |
Specify that the generated code must preserve alias data types from your model. This option is available on the PLC Code Generation > Identifiers pane in the Configuration Parameters dialog box.
Using the Simulink.AliasType
class,
you can create an alias for a built-in Simulink data type. If
you assign an alias data type to signals and parameters in your model,
when you use this option, the generated code uses your alias data
type to define variables corresponding to the signals and parameters.
For instance, you can create an alias SAFEBOOL
from the base data type
boolean
. If you assign the type SAFEBOOL
to signals and parameters in your model, the variables in the generated code
corresponding to those signals and parameters also have the type
SAFEBOOL
. Using this alias type SAFEBOOL
,
you can conform to PLCopen safety specifications that suggest using safe
data types for differentiation between
safety-relevant and standard signals.
Default: off
The generated code preserves alias data types from your model.
For your generated code to be successfully imported to your target IDE, the IDE must support your alias names.
The generated code does not preserve alias types from your model. Instead, the base type of
the Simulink.AliasType
class determines the variable data type in generated code.
The alias that you define for a Simulink type must have the same semantic meaning as the base Simulink type. It must not be a data type already supported in Structured
Text and semantically different from the base Simulink type. For instance, WORD
is a data type
supported in Structured Text but is semantically different from an integer type.
If you define an alias WORD
for a Simulink built-in integer type, for instance uint16
, and
preserve the alias name, the type WORD
that appears in your
generated code is used semantically as a WORD
and not as an
INT
. The generated code has a different meaning from the
semantics of the model.
Parameter: PLC_PreserveAliasType |
Type: string |
Value: 'on' | 'off' |
Default: 'off' |