If you have hand written code that is not large enough to put it in a separate project, however you would like to integrate it with your Model RealTime models, there is an easy-to-use mechanism which is called File Artifacts. A file artifact is a special model element that can be used for storing your C++ code in the model. When building the model, C++ files containing your code are generated from the file artifacts.
Here are the steps how to create a file artifact:
When generating code for the TC, the file artifact translates to one implementation and one header file similar to e.g. regular classes or capsules. You can as usual edit the files either in the model using the Code view/editor or directly in the generated files and then synchronize back your changes to the model. You can also create dependencies from other model elements to a file artifact. They will be translated to #include directives or forward declarations as usual.
Do you want to hear more about external C++ code integration? Provide us feedback by mailing to model-realtime@hcl-software.com.