Ladder Logic Code Generation Limitations
plcladderlib
Limitations
Simulink®
PLC Coder™
plcladderlib
has these limitations:
Only Rockwell Automation® RSLogix™ 5000 and Studio 5000 IDEs can import ladder logic generated using the
plcladderlib
library.Blocks in the
plcladderlib
library are not supported for use as linked blocks.
Ladder Diagram Import Limitations
When importing an
.L5X
file that contains a continuous task, the imported Simulink model has a sample time of-1
. For periodic tasks, the sample time is the value specified in the.L5X
file. Event tasks are not supported.Simulink PLC Coder may not follow the same initialization order specified in the
Prescan
mode. Do not read variables that are read by thePrescan
mode because this leads to different behavior in simulation of the model when compared to execution in the IDE. The affected Simulink PLC Coderplcladderlib
blocks are: OTE, ONS, OSF, OSR, CTD, CTU, TON, TOF, RTO, JSR, AOI, and FBCIf you Ladder Diagram implementation has multiple AOI or subroutine instances with the same name, the software does not check if these instances refer to the same implementation. It is recommended to use different names if these structures contain different functionality.
Simulink PLC Coder does not support the import of
.L5X
files that contain add on instruction blocks with thePostscan
routine enabled.- Simulink
PLC Coder
does not support the import of Rockwell Automation
Alias
data types.
Ladder Diagram Modeling and Simulation Limitations
Ladder models do not support unsigned integer types. Use signed integer instead.
Ladder models do not support double type. Instead, use single type.
The Rockwell Automation IDEs have limitations on the character length used for names. The length should not be more than 40 characters. For supported name lengths consult the Rockwell documentation.
Label the Port numbers in the Controller Tags uniquely and sequentially, when modeling Ladder Diagrams in Simulink.
Ladder Diagram Code Generation Limitations
Code generation requires a controller, task, program model, AOI runner, or AOI model hierarchy
AOI input argument should be either non-array or 1-D array type. Test bench generation does not support 2-D or 3-D array types. This limitation includes nested 2-D, 3-D array types in structure fields.
The Rockwell Automation IDEs have limitations on the character length used for names. The length should not be more than 40 characters. For supported name lengths consult the Rockwell documentation.
Ladder Diagram Verification Limitations
Ladder test bench generation is supported for only AOI Runner block.
AOI input argument should be either non-array or 1-D array type. Test bench generation does not support 2-D or 3-D array types. This limitation includes nested 2-D, 3-D array types in structure fields.
AOI input argument in the L5X file should not be single-element array type for runner test bench generation.
Test bench generation for Ladder Diagram models containing timer blocks such as
TON
,TOF
andRTO
fails. To generate test-bench code for these models, modify the Ladder Diagram structure while maintaining the logic.If the Simulink model is set as read-only, the model can become corrupted during the test bench generation process. When the code generation process completes, it reverts all code generation changes performed on the model. You can ignore or close the model during this process.