Step 1: How to Build a Real-Time Application for a SCALEXIO System

Objective

You can use a real‑time application to transmit and receive Ethernet raw frames via Real‑Time Testing on a SCALEXIO system. In this step, you will learn how to build a real-time application with ConfigurationDesk.


Basics

Real-time application

Real-Time Testing provides no ready-to-use real-time application for Ethernet communication. Instead, you can use a ConfigurationDesk project from the RTT demos to build your own real-time application.

In ConfigurationDesk, you can add the Ethernet functionality and start the build process to get a real-time application that you can use for Ethernet communication on a SCALEXIO system with the rttlib.dsethernetapilib module.

Parts

This step is divided into the following parts:

  1. To open the provided ConfigurationDesk project, refer to Part 1.

  2. To implement access to the SCALEXIO system, refer to Part 2.

  3. To build a real-time application, refer to Part 3.

  4. To prepare the provided ControlDesk project, refer to Part 4.


Preconditions

  • ConfigurationDesk is installed on your host PC.

  • A SCALEXIO system is required as registered platform.


Part 1: To open the provided ConfigurationDesk project

  1. Start ConfigurationDesk. On the Start menu, select dSPACE ConfigurationDesk <product version> – dSPACE ConfigurationDesk <product version>.

    ConfigurationDesk opens.

  2. On the File ribbon, click Open – Project + Application from Backup.

    The Select a project backup file dialog opens.

  3. Navigate to your RTT Documents folder and select the file: ...\SampleExperiments\TurnSignal_SCALEXIO\TurnSignal_SCALEXIO_Cfg.ZIP.

  4. Click Open.

    ConfigurationDesk opens the TurnSignal_<your platform>_Cfg project and the turnlamp application.


Interim result

You have opened the provided ConfigurationDesk project. Continue with the next part to replace the standard hardware.


Part 2: To implement access to the SCALEXIO system

  1. Switch to the Signal Chain view set.

  2. In the Hardware Resources Browser, open the context menu of the SCALEXIO Rack (1).

  3. Select Delete Completely.

  4. On the Home ribbon, click Hardware – Import Hardware – Replace.

    The Import Hardware Topology dialog opens.

  5. Click Add hardware.

    The Hardware list opens.

  6. Select Registered Hardware – SCALEXIO.

  7. Click OK.

    ConfigurationDesk adds your SCALEXIO system to the Hardware Resources Browser.

  8. In the hardware topology, navigate to your Ethernet board and drag an Ethernet controller to the Global working view.

    A dialog opens.

  9. Select Ethernet Setup.

    ConfigurationDesk adds a Ethernet function block to the working view and automatically assigns the Ethernet controller to it.

  10. In the properties of the Ethernet Setup block, enter a valid local IP address, for example, 192.168.2.42 and make sure that the IP address is unique.

  11. Add a second Ethernet function block to the working view. To do this, repeat steps 8 to 9.

  12. In the properties of the second Ethernet Setup block, enter a valid local IP address, for example, 192.168.2.43 and make sure that the IP address is unique.

    Note

    A physical connection between the Ethernet controllers of your dSPACE real-time hardware is required to transmit and receive Ethernet frames between them. View the following table to select a appropriate method for establishing a physical connection depending on the channel type of your Ethernet adapter:

    Channel Type

    Establishing a Physical Connection

    Ethernet Adapter 1

    Connect the ports of your Ethernet board with a patch cable.

    Ethernet Adapter 2

    Use the integrated Ethernet switch to switch all Ethernet ports and controllers to each other.

    For an overview of all possible channel types in a SCALEXIO system, refer to Overview of SCALEXIO Channel Types.


Interim result

You have implemented access to the SCALEXIO system. Continue with the next part to build a real-time application.


Part 3: To build the real-time application

  1. Switch to the Build view set.

  2. In the Build Configuration table, select Global Build Settings.

  3. In the Properties Browser, clear the checkbox next to the Download real-time application after build property.

  4. Select the Conflicts Viewer.

  5. Click the expand arrow of the context set filter and make sure that at least the Application and Task Modeling, Function, Model, and Hardware Topology context sets are selected.

  6. Make sure that the Errors and Warnings filters are selected.

  7. Expand the No runnable function assigned warning and open the context menu of the Periodic Task 2.

  8. Select Delete from Application.

    If the Conflicts Viewer does not display any further conflicts, there are no remaining conflicts in the ConfigurationDesk application that affect the build process.

  9. On the Home ribbon, click Build – Start.

    The build process starts. The Build Log Viewer displays the progress of the build process in chronological order. Messages regarding model code generation are displayed in the MATLAB Command Window.

  10. Wait until the message Build process finished is displayed in the Build Log Viewer.

  11. On the File ribbon, click Save Project.


Interim result

You have built a real-time application with ConfigurationDesk to use Ethernet communication via Real‑Time Testing on a SCALEXIO system. Continue with the next part to prepare the provided ControlDesk project.


Part 4: To prepare the provided ControlDesk project

  1. Open ControlDesk.

  2. On the File ribbon, click Open – Project + Experiment from Backup.

  3. In the Open dialog, navigate to the RTT Documents folder and select the file: ...\SampleExperiments\TurnSignal_SCALEXIO\TurnSignal_SCALEXIO.ZIP.

  4. Click Open.

    ControlDesk opens the TurnSignal_SCALEXIO project.

  5. In the Project pane, open the context menu of turnlamp.sdf and select Replace.

  6. In the Replace Variable Description dialog, click Yes.

  7. Navigate to the ConfigurationDesk Documents folder and select the file: ...\TurnSignal_SCALEXIO_Cfg\turnlamp\BuildResults\turnlamp.sdf.

  8. Click Open.

    ControlDesk replaces the system description file with your build results from ConfigurationDesk.

  9. In ControlDesk, click Save Project on the File ribbon.


Result

You have built a real-time application with ConfigurationDesk. You can use this real-time application to implement Ethernet communication via Real‑Time Testing on a SCALEXIO system. You have also prepared a ControlDesk project.

In the next step, you will write an RTT sequence to transmit and receive Ethernet raw frames with the rttlib.dsethernetapilib module.


Redaction