Main Content

Block Parameters in Generated Code

To control how the block parameters appear in the generated code, you can either define the parameters as Simulink.Parameter objects in the MATLAB® workspace or use the Model Parameter Configuration dialog box. For more information, see Control Appearance of Block Parameters in Generated Code.

Simulink® PLC Coder™ exports tunable parameters as exported symbols and preserves the names of these parameters in the generated code. It does not mangle these names. As a result, if you use a reserved IDE keyword as a tunable parameter name, the code generation can cause compilation errors in the IDE. As a best practice, do not use IDE keywords as tunable parameter names.

The coder maps tunable parameters in the generated code as listed in the following table:

Target IDEParameter Storage Class
Model defaultExportedGlobalImportedExternImportedExternPointer
CODESYS 2.3 Local function block variablesGlobal variableVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.
CODESYS 3.5 Local function block variablesGlobal variableVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.
B&R Automation Studio® 3.0Local function block variableLocal function block variableLocal function block variable.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.
B&R Automation Studio 4.0Local function block variableLocal function block variableLocal function block variable.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern

Beckhoff® TwinCAT® 2.11

Local function block variableGlobal variableVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.
KW-Software MULTIPROG® 5.0Local function block variableLocal function block variableLocal function block variable.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.

Phoenix Contact® PC WORX™ 6.0

Local function block variableGlobal variableVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.
RSLogix™ 5000 17, 18: AOIAOI local tagsAOI input tagsAOI input tags.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.
RSLogix 5000 17, 18: RoutineInstance fields of program UDT tagsProgram tagsVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.

Siemens® SIMATIC® STEP® 7

Local function block variableGlobal variableVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.

Siemens TIA Portal

Local function block variableGlobal variableVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern
GenericLocal function block variableGlobal variableVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.
PLCopenLocal function block variableGlobal variableVariable is not defined in generated code and expected to be defined externally.Ignored. If you set the parameter to this value, the software treats it the same as ImportedExtern.