Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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.

Risposta accettata

Fabio
Fabio il 10 Ago 2023
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.

Più risposte (1)

Atharva
Atharva il 10 Ago 2023
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 Commento
Fabio
Fabio il 10 Ago 2023
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.

Accedi per commentare.

Categorie

Scopri di più su Simulink PLC Coder in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by