Coder Limitations

Current Limitations

The Simulink® PLC Coder™ software does not support the following Simulink semantics:

  • Complex data types

  • Model reference

  • Absolute time temporal logic in Stateflow® charts. Absolute time temporal logic is supported for only the Rockwell Automation® RSLogix™ 5000 IDE. For more information see Integrate Absolute Time Temporal Logic Code.

  • Stateflow machine-parented data and events

  • Limited support for math functions. The coder does not support the following functions: tanh, cosh, sinh, rand.

  • Merge block

  • Signal and state storage classes

  • Virtual buses at the input ports of the top-level Atomic Subsystem block.

  • For Each Subsystem block

  • Variable-size signals

  • Nonfinite data, for example NaN or Inf.

Fixed-Point Data Type Limitations

Simulink PLC Coder software supports the fixed-point data type. To generate code for fixed-point data types, configure block and model parameters as described in this topic.

    Note:   If you do not configure the blocks and models as directed, the generated Structured Text might:

    • Not compile.

    • Compile, but return results that differ from the simulation results.

Block Parameters

Properly configure block parameters:

  1. If the block in the subsystem has a Signal Attributes tab, navigate to that tab.

  2. For the Integer rounding mode parameter, select Round.

  3. Clear the Saturate on integer overflow check box.

  4. For the Output data type parameter, select a fixed-point data type.

  5. Click the Data Type Assistant button.

  6. For the Word length parameter, enter 8, 16, or 32.

  7. For the Mode parameter, select Fixed point.

  8. For the Scaling parameter, select Binary point.

  9. Click OK.

Be sure to edit the model configuration parameters (see Model Configuration Parameters).

Model Configuration Parameters

Properly configure model configuration parameters:

  1. In model Configuration Parameters dialog box, click the Hardware Implementation node.

  2. For the Device vendor parameter, select Generic.

  3. For the Device type, select Custom.

  4. For the Signed integer division rounds to, select Zero.

  5. For the Number of bits, set char to 16.

Permanent Limitations

The Structured Text language has inherent restrictions. As a result, the Simulink PLC Coder software has the following restrictions:

  • The Simulink PLC Coder software supports code generation only for atomic subsystems.

  • The Simulink PLC Coder software supports automatic, inline, or reusable function packaging for code generation. Nonreusable function packaging is not supported.

  • No blocks that require continuous time semantics. This restriction includes continuous integrators, zero-crossing blocks, physical modeling blocks, and so on.

  • No pointer data types.

  • No recursion (including recursive events).

Was this topic helpful?