The CATIA Embedded Code Generator allows you to generate and build code from a SysML model. You can generate code from the SysML State Machine or SysML Internal Block Definition diagrams. The code generation and building are executed via the 3DEXPERIENCE platform.
You can switch projects (or even shut down your computer saving your work first) while waiting for the generation result as it is running on the cloud and as the widget keeps the ids of the cloud assets in the project options (you have access to it if you need it for debugging purpose for example). When you will come back, another dialog will tell you that operations were running while you were away and will propose you inspect the result and download it.
A workspace is automatically created on our cloud servers for each of your projects using the widget. This workspace gathers the assets needed for the generation. A cloud workspace is automatically deleted after 30 days of inactivity. You can also delete it manually in the Environment Options dialog. If you delete the workspace, all the components will have to be regenerated on the cloud on your next session because you will not be able to push any files to a workspace through the plugin. |
The 3DEXPERIENCE platform is on the cloud.
You have the Software Production Engineer Role. It will give you permission to use the service.
Before starting to work on code generation, first, you have to connect to 3DEXPERIENCE by entering the URL of the Software Producer cloud server. After that, you will be able to log in with your regular identifiers.
For the information about how to authenticate with the 3DEXPERIENCE platform, see Authentication with 3DEXPERIENCE platform. |
To generate the code in the SysML State Machine diagram
In the open SysML State Machine diagram, select the element you want to generate.
If you do not select any particular element in the diagram, the entire diagram view is selected as the generation input. |
To generate the code in the SysML Internal Block Definition diagram
In the Software Producer Log panel, you can see the messages of the running SPO.
This information is saved in the log file next to your project files. To open the log file location quickly, in the Software Producer Logs window, click the Show Log File button. Each project has its own log file.
A log file for general Software Producer messages not related to a specific project is stored next to the modeling tool log file.
At the right bottom corner of the modeling tool, in the progress bar, you can see whether the SPO is running. After the SPO is completed, the notification is displayed showing the status of the generation.
You can also view the results stored in your file system. To quickly open the location of the results, in the diagram toolbar, click the Show in File Explorer button.
The full set of code you need to generate to cover your project is composed at least of a component and a target-specific part. Component part is relative to the behavior of your application (such as State Machine) whereas the target-specific part is relative to the architecture of your application (such as IBD). In other words, target specific is the binder and the link between the component and the target. As one does not go without the other, this is why at the end of the IBD generation, a dialog will ask you if you want the applicative code to be automatically generated if you have not yet done it (or if it has changed).
A dialog asking to save your project might appear sometime because our generators use for the moment the .mdzip file as input and if you have made any changes in your model, it needs to be saved to be reachable from this file.
Once the full set of code has been generated, you can launch a build SPO by clicking on the Build button.
When you click a Build button, a dialog opens, wherein you need to specify the target and the available parameters (if there are any).
The code is downloaded to your file system following a specific folder hierarchy:
The target name is present only if the related folder is the result of target-specific generation or build. |
The roundtrip action is a beta feature that enables you to put back in a State Machine Diagram any modification you would have written in the associated generated usr.c code and to synchronize the file on the cloud.
Button | Description |
---|---|
Code Generation | Generates the code for the selected elements in the State Machine or Internal Block Definition diagrams. If the entire diagram is selected, the code is generated for the whole content. The generation result is downloaded to your machine. |
Build | After the code is generated, launch the SPO build. |
Show in File Explorer | Open a location in your file system wherein the Software Production Operation results file is stored. |
Roundtrip | The changes made in the generated code are applied in the State Machine diagram. |