You are not logged in. Click here to log in.

Codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Codebeamer - Simulink Integration

This page provides guidance and help for the installation and first steps.

Prerequisites

The necessary versions are the followings:

  • Matlab / Simulink 2022b or newer versions
    • May work with older versions, but not tested.
  • Codebeamer 2.0.0.0 or newer versions

The necessary Matlab toolboxes are the followings:

  • Basic workflow for Simulink Models:
    • MATLAB
    • Simulink
    • Requirements Toolbox
    • Codebeamer Toolbox – PTC product
  • Required to include Simulink Test:
    • Simulink Check
    • Simulink Coverage
    • Simulink Test
    • Stateflow

User Guide

Licensing and Permissions

The usage of the integration will be limited to users with Advanced or Premium licenses. The user shall be part of a Group, in which Rest / Remote API – Access is granted.

Codebeamer Toolbox Installation (Matlab)

To Install the Codebeamer Toolbox,

  1. Open MATLAB.
  2. Navigate to the folder where the CodeBeamer.mltbx file is downloaded.
  3. Double-click on the CodeBeamer.mltbx. The toolbox gets installed, and a pop-up window will inform about successful installation.
  4. Configuration file in the home directory (C:\Users\user) shall be deleted. The file extension is “.mlcbconfig”.
  5. Restart MATLAB to enable the changes.

Codebeamer Toolbox Uninstallation

To uninstall the Codebeamer Toolbox,

  1. Open MATLAB
  2. Click tab Home > Environment section > click down arrow below the Add-Ons button > select Manage Add-Ons.
  3. Find the Codebeamer toolbox name > click the 3 vertical dots > Uninstall

  4. Click Yes to confirm uninstallation.

Codebeamer Project Setup

Mandatory Fields in Simulink Integration Codebeamer Projects

The following custom text fields shall be present in the model and test trackers: MatlabID and BlockModifiedOn.

Reference Structure Setup in Codebeamer

The Simulink Design and Simulink TestCase trackers can be referenced to any requirement tracker in any project. References shall be set up for the Subject field in the tracker configuration. Note, that any refenced type fields can be used, but the integration will work with Subject.

Example:


Codebeamer Project Configuration File

A configuration item is required in Codebeamer, where the following information need to be specified for the Simulink project that contains the proxy-items:

ModelTrackerID ID of the Simulink model tracker.
TestCaseTrackerID ID of the Simulink test tracker.
TestRunTrackerID ID of the Simulink test run results.
ModelRemovedState Target state for removed Simulink blocks.
ModelRecoveredState Target state for recovered Simulink blocks.
TestRemovedState Target state for removed Simulink tests.
TestRecoveredState Target state for recovered Simulink tests.


The ID of the configuration item will be the Config-ItemID value in the settings.


How to link Codebeamer Requirement to Simulink Models and Tests

Codebeamer Toolbox Configuration

  1. Open a Simulink model.
  2. Click Tool menu > Codebeamer > Settings.

  3. Setup window:
  4. Fill in the Server URL, Config-ItemID and User Name fields. These values are saved and need to be added once.
  5. Fill the Password before starting.
  6. Simulink Callback update is optional but recommended for the models. This is enabling the change detection for the models.

Links to Codebeamer Requirements

Make sure the CodeBeamer Toolbox is configured. To create a link to Codebeamer requirement:

  1. Select the requirement in Codebeamer you would like to create a link to.
  2. In Simulink, right click on the model item that needs to get linked to a requirement > select Requirements > Link to Requirement in Codebeamer.

  3. Repeat steps 1 and 2 for other model items.

All created links can be viewed in a list:

  1. Click on the gray Perspective views icon in the right bottom corner of Simulink model.

  2. Select Requirements.

Tutorial: LinksToCodebeamerRequirement.mp4


Create or Update Backlinks in Codebeamer

  1. Click on the Tool menu > Codebeamer > PublishLinks.

  2. New backlinks appear in the description sections of corresponding requirements in Codebeamer. Clicking on the backlink opens Simulink model and highlights corresponding model item.

Tutorial: CreateOrUpdateBacklinks.mp4

Requirement Consistency Check in Simulink Model

The new version of Codebeamer requirements can be detected in Simulink models:

  1. Click on the Tool menu > Codebeamer > Check Requirement Consistency.
  2. If there is a block with requirement updated since connection, it is highlighted in the model.
  3. The highlight and warning can be removed.
  4. Right click on the highlighted block and select Clear Codebeamer inconsistency.

Tutorial: RequirementConsistencyCheckInSimulink.mp4

Handling of Obsolete and Reused Simulink Blocks in Codebeamer

In case a connection is deleted in Simulink, the related proxy item is handled accordingly in Codebeamer:

  1. Delete the unnecessary link in Simulink.
  2. Execute Publishlinks or CIActions command to handle the removed connection.
  3. This triggers a status change on the related proxy item.
  4. If the Simulink model or block covered with requirement again, another status change is triggered.

Tutorial: HandlingOfObsoleteAndReusedProxyItems.mp4

Test Cases Linking to Codebeamer Requirements

Make sure the Codebeamer Toolbox is configured. To create a link from a test case to Codebeamer requirement:

  1. In Codebeamer, select the requirement you would like to create a link to.
  2. Open the model test cases in the Test Manager.
  3. Select a specific test case if exists, or create a new one.
  4. Under Requirements, click on +Add > New.
  5. Select Codebeamer Item in the Document type drop-down menu.
  6. Click Use current. The rest of the requirement information will be passed automatically.

  7. Click Apply > OK. Requirement link will be saved for the test case.
  8. Repeat these steps to add links to other test cases, if needed.
  9. Clicking the link will open corresponding requirement in Codebeamer.

Tutorial: TestCaseLinkingToCodebeamer.mp4

How to Batch Synchronize Simulink Data Back to Codebeamer

There is a script created to synchronize and create backlinks in Codebeamer. The goal is to support automated publishing by a CI/CD pipeline:

  1. Open the script to set the following Inputs:
    • artifact - all the files which contains linked requirements.
    • tracker - config item ID (Config-ItemID from settings).
    • rmi.updateProxyLinks - username, password and server URL.
  2. CIActions command will start adding all the backlinks.

Tutorial: HowToSnychronizeSimulinkData.mp4

Appendix

Example Project

The following Codebeamer project is an example for the integration. In this project, all the required Trackers, References and Mandatory fields are setup according to the plugin.

Simulink_Integration_Project - Release1.0.0.0.zip

Current Limitations

The following limitations are existing in the shared version:

  • Consistency checks between Simulink Test and Codebeamer requirements is missing.
  • Clear Codebeamer inconsistency command does clear Suspected flag in Codebeamer.
  • Reference is suspected when the proxy item first time backlinked to Codebeamer.