Embedded Coder

Using the IEC 61508 Modeling Standard Checks

This demonstration uses Model Advisor checks for the IEC 61508 standard to facilitate developing a model and code that comply with that standard.

The IEC 61508 checks quickly identify issues with a model that impede deployment in safety-related applications or limit traceability.

Contents

Understanding the Model to be Checked

According to the functional requirements, a model shall be created that checks whether the 1-norm distance between points (x1,x2) and (y1,y2) is less than or equal to a given threshold thr. For two points (x1,x2) and (y1,y2), the 1-norm distance is given as:

$$ \sum_{i=1}^{2} | x_i -y_i | $$

The rtwdemo_iec61508 model implements the preceding requirement. We will explore the model in this demo.

Applying the IEC 61508 Modeling Standard Checks

To deploy the model in a safety-related software component that must comply with the IEC 61508 safety standard, check the model for issues that might impede deployment in such an environment or limit traceability between the model and generated source code.

To identify possible compliance issues with the model, you can:

  1. Start the Model Advisor by selecting Tools > Model Advisor or by entering modeladvisor('rtwdemo_IEC61508') at the MATLAB command line.
  2. In the Task Hierarchy, expand By Product > Simulink Verification and Validation > Modeling Standards > IEC 61508 Checks or By Task > Modeling Standards for IEC 61508.
  3. Select all checks within the group.
  4. Select Show report after run to generate an HTML report that shows the check results.
  5. Click Run Selected Checks. Model Advisor processes the IEC 61508 checks and displays the results.

To review the check results and make changes, you can:

  1. Review the Summary in the Report section of the right pane.
  2. Select a check that did not pass in the Task Hierarchy. You can review the results that appear in the right pane for that check. You can find more information on the check and on how to resolve reported issues with the check selected by clicking on Help.
  3. Click the Generate Code Using Real Time Workshop Embedded Coder button in the model to inspect the generated code and the traceability report.
  4. Resolve the reported issues and rerun the checks.
  5. Review the generated HTML report of the check results by clicking the link in the Report box.
  6. Print the generated HTML report. You can use the report as evidence in the IEC 61508 compliance demonstration process.

See Also

You can find more information on the following topics:

  • For descriptions of the IEC 61508 checks, see the IEC 61508 Checks section in the Simulink Verification and Validation documentation.