Which diagnostics model settings are most conducive to code generation through PLC Coder?

1 次查看(过去 30 天)
Since code generation for my SImulink model through PLC Coder (onto SIMATIC STEP 7 Target IDE) output an unspecified error claiming there were errors simulating the model, while there were actually only warnings (for my diagnostics model settings), I am asking for servicable diagnostics model settings in this case.
Is there any recommended diagnostics configuration for simulation aiming at PLC code generation (especially for SIMATIC STEP 7 Target IDE)?
Thanks in advance.

采纳的回答

Fabio
Fabio 2023-8-10
In my case PLC code generation failed due to the concerned subsystem's input and output ports not being connected.
However, the issue of unconnected ports was only displayed as "warning" in the diagnostics window making me think specific diagnostics settings are required for PLC coder related debugging.
Yet, since the generation failed exclusively due to the subsystem's external inputs and outputs, changing this diagnostics setting could also cause uncrucial errors to display.
Conclusively, regarding the intention of my question, generally no specific diagnostic settings have to be adjusted in order to debug PLC code generation.

更多回答(1 个)

Atharva
Atharva 2023-8-10
Hi Fabio,
To generate code through PLC Coder in MATLAB, you need to configure the diagnostics model settings appropriately. Here are some settings that facilitate code generation:
1. Set the simulation mode to "Software-in-the-Loop (SIL)" or "Processor-in-the-Loop (PIL)" to ensure that the generated code can be executed and verified in a simulated or real-time environment.
2. Specify the target hardware for which you want to generate code. PLC Coder supports various target platforms such as programmable logic controllers (PLCs) from different manufacturers. Select the appropriate target to generate code compatible with the specific PLC you intend to use.
3. Choose the programming language suitable for your target platform.
4. Define the data types and ranges for your variables to match the requirements of the target PLC. Ensure that the data types used in the model are supported by the PLC and that the ranges are within the limits of the PLC's capabilities.
I hope it helps.
  1 个评论
Fabio
Fabio 2023-8-10
First of all, thank you for your answer.
The problem occurring while code generation was the concerned subsystem's input and output ports not being connected (leading PLC code generation to fail), which was displayed as warning instead of error.
This made me think PLC coder presumes specific diagnostics settings (like setting unconnected ports to error).
However, since the generation failed exclusively due to the subsystem's external inputs and outputs, changing this diagnostics setting could also cause uncrucial errors to display.
In conclusion, regarding the intention of my question, actually NO specific diagnostic settings have to be adjusted in order to debug PLC code generation.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Simulink PLC Coder 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by