Code RealTime Integration

DevOps Code RealTime is just like DevOps Model RealTime a development environment for creating stateful and event-driven realtime applications in C++. The main differences between the products are:

Applications created with Model RealTime and Code RealTime use the same TargetRTS, and it's therefore possible to use the two products together. This article describes how you can use Code RealTime for creating some parts of your application, build them into a library, and then use that library from Model RealTime.

Motivation

There can be several reasons and benefits with developing parts of your application with Code RealTime:

Workflow

Follow the steps below for using a library created with Code RealTime in Model RealTime:

  1. Develop the library in Code RealTime and build it with a library TC that uses the same target configuration as you use for building your Model RealTime application. The picture below shows what you see in Code RealTime for a simple library.

  1. Import the Code RealTime workspace folder into your Model RealTime workspace. Use the command File - Import - General - Projects from Folder or Archive.

  1. Set the imported library TC as a prerequisite of your executable TC.

  1. Make sure your executable TC is active. You should then see the elements defined in the library in the Project Explorer as an imported package:

There will be one imported package for each Art file that is built by the library TC.

  1. Now you can use the library elements in your Model RealTime model in the same way as if they were defined in the model itself. For example, you can show protocols from the library on diagrams, create ports typed by those protocols and create transitions that trigger on events in the protocols. And you can create parts typed by capsules from the library, and connect its ports to ports of other capsules in the model.
  2. When you build your executable TC in Model RealTime, the generated application will automatically link with the Code RealTime library.

Build

When you build a TC that has a Code RealTime TC as a prerequisite the generated make file will automatically invoke the Art Compiler in order to build the prerequisite library. This requires that Model RealTime knows where Code RealTime is installed. Set the ART_COMPILER variable on the Run/Debug - String Substitution preference page to the location of the Art Compiler to use.

It's important that the same TargetRTS version is used both by Code RealTime and Model RealTime, and that all TCs involved in the build use the same target configuration.

Changing Art Files

To change the library Art files it's recommended to use Code RealTime. However, you don't need to build the library from within Code RealTime since it will be automatically built when building the Model RealTime executable TC.

To see the updated library elements in Model RealTime you need to close and reopen the model project. You may of course also need to update your model, depending on what changes you did, and how the changed elements are used.

Current Limitations

The following limitations currently apply: