PLC Coder:Interface

Interface Overview

The PLC Code Generation > Interface category includes parameters for configuring the interface of the generated code.

See Also

Generate Structured Text from the Model Window

Generate Logging Code

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 > Interface pane in the Configuration Parameters dialog box.

Settings

Default: off

On

Generate Function block logging code for supported targets.

Off

No logging instrumentation is included in the generated code.

Command-Line Information

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

See Also

Generate Structured Text from the Model Window

Keep Top-Level ssmethod Name the Same as the Non-Top Level Name

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 > Interface pane in the Configuration Parameters dialog box.

Settings

Default: off

On

Generated code for top-level block does not contain the SS_STEP type in generated code.

Off

Generated code contains SS_STEP AND SS_OUTPUT type function blocks.

Command-Line Information

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

See Also

Remove Top-level Subsystem Ssmethod Type

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 > Interface pane in the Configuration Parameters dialog box.

Settings

Default: off

On

Remove top level function block ssmethod type in generated code.

Off

Generated code contains ssmethod type Function block and switch case statements.

Command-Line Information

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

See Also

Generate Structured Text from the Model Window

Remove Initialization Statements for Externally Defined State Variables

Use this option to remove initialization assignment statements for variables that have storage class ImportedExtern and ExportedGlobal from the generated code.

Mark ExportedGlobal variables as externally defined. For more information, see Externally Defined Identifiers

Settings

Default: off

On

Remove from the generated code initialization assignment statements for variables that have storage class ImportedExtern and ExportedGlobal.

Off

Generated code contains initialization assignment statements for variables that have storage class ImportedExtern and ExportedGlobal.

Command-Line Information

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

See Also

Absolute-Time Temporal Logic

Use this option to specify if the generated code uses the target timer or a target-independent counter for Stateflow® absolute-time temporal logic semantics implementation.

Settings

Default: Target Timer

Target Timer

Generated code uses the target timer to implement Stateflow absolute-time temporal logic semantics.

Target-independent Counter

Generated code contains a target-independent integer counter to implement Stateflow absolute-time temporal logic semantics.

Command-Line Information

Parameter: PLC_AbsTimeTemporalLogic
Type: character vector
Value: 'timer' | 'counter'
Default: 'timer'

Limitations

  • Absolute-time temporal logic does not support stateflow chart using global clocks.

  • Testbench code verification can fail for absolute-time temporal logic using floating-point comparison operations.