Error:Subsystem Extraction Failed. Changing property 'MaxIdLength' is not allowed

6 views (last 30 days)
Hello
With PLC coder, I want to convert the simulik to the code usable in PLC but I face this error when I want to generate the code.
Error:Subsystem Extraction Failed. Changing property 'MaxIdLength' is not allowed
Please let me know how can I solve this.

Answers (1)

Mahaveer Satra
Mahaveer Satra on 10 Apr 2024
Hi Hamed,
The name length limit is a bit complex due to the target IDEs variations and different limits by each IDE. This may cause the generated code names to shorten.
This workflow can be used to overcome this:
  1. enable the "Override target default maximum identifier length" option to edit the "Maximum identifier length" text box
  2. if the length is set to <31, it throws the following error:Error using plc_builder (line 49)Invalid length specified for PLC Coder identifiers (see the 'PLC Code Generation -> Identifiers' pane of theConfiguration Parameters dialog). Identifier length must be greater than or equal to 31.Error in plcgeneratecode (line 20) codegenFiles = plc_builder('generate_plc_code',subsystemH, true, true);
  3. if the length >=31, including 255, it can generate code OK. Ideally you would want to match this value to the limitation of the IDE code limit, which you can check from the code generation identifier default max length.

Categories

Find more on Simulink PLC Coder in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!