On this page:
The CATIA Software Producer allows you to generate and build code from a UML or SysML model. You can generate code, for example, from the UML Class structure, UML State Machine, or SysML Blocks. The code generation and building are executed via the 3DEXPERIENCE platform.
CATIA Software Producer offers the following generation capabilities:
For more information about the Software Production Engineering application, see Software Production Engineering. |
CATIA Software Producer uses the concept of target configuration to guide the user in configuring the code generation process.
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 information about how to authenticate with the 3DEXPERIENCE platform, see Authentication with 3DEXPERIENCE platform. |
If you start working with CATIA Software Producer for the first time in your project, a dialog will open to configure the local workspace path which will host generated resources.
The generated code is composed of a behavior part and a middleware part. It is identified as a target. The behavior part is relative to the behavior of your application (such as State Machine) whereas the middleware part is target-specific and is generated from the architecture of your application (such as IBD).
As the code is composed of multiple entities, multiple configurations are required. You will be guided in the configuration through multiple dialogs to create the target configuration.
To configure the code generator
In the open Generator Details dialog, configure the target of your generation:
Select the operation in charge of the target you expect. For example, the target can be C code, C++ code or an FMU.
If the operation you selected (for example FMU Target Build) requires additional operations to be executed, additional dialogs open to configure them.
Once the end of the configuration process is reached, i.e. you have fully configured your target, under the Configuration package you will find:
1You can change the default name of those packages in the Environment Options > CATIA Software Producer Client General Properties > Configuration section
The configurations are saved in the model via the “CATIA – Embedded Software Profile” (EmbeddedSoftwareProfile.mdzip) profile. |
To execute the code generator
The target will be generated based on your configuration:
To edit generator configuration properties
If you have configured multiple targets for the same input, you might want to change the default one (which was created last).
To change the default target configuration
Under the local workspace, you can find the generated files, if you have selected the download option and left the default location (as seen above) in the configurations. You can also find some other files under an “etc” folder:
1You can change the root of the local workspace path in the project options.
2By default, a backup of your downloaded files is saved in this folder so that in case something wrong happens with the download of new files, you can still reach your previous files. You can disable this option in the Project Options
3SPO Report files are rotated by size and date so that you might see multiple report files here.
4Log files are rotated by size and date so that you might see multiple log files here.
The roundtrip action is a feature available for State Machines and Opaque Behaviors. Using the roundtrip action, you can add the modification you made in the code in between BEG_USER_CODE / END_USER_CODE tags (in files commonly named <ComponentName>_usr.c), back into the model and synchronize the file on the workspace on the cloud.
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 bottom right corner of the modeling tool, in the progress bar, you can see whether the generation is running. After the generation is completed, the notification is displayed in case of failure or always if the verbose mode is activated (Environment Options > CATIA Software Producer Client General Properties > Notifications section).
When an operation produces a report, the plugin reads it and opens it in a Validation Result window if any element has a diagnostic associated.
A diagnostic is associated with a rule consisting of a severity, message, and source.
You can navigate to the source in the Containment tree. If you need to show more details concerning the rule or open the full report, right-click the appropriate lines of the table.
You can turn off the Validation Results window's opening after the operation produces a report.
To turn the validation report off
The following commands are available from the diagrams toolbar or from the shortcut menu of the supported elements in the Containment tree:
Button | Description |
---|---|
Configure Target | Configure the code generators according to the first operation you selected (this first operation will be your final target). You can manage the parameters of the generators here, as well as the download options. |
Change Default Target | You can change the target selected for the current element. |
Code Generation | Generates the code for the selected elements in, for example, 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 if you select the download option. By default, the classic generation is triggered, but you can select the full generation to generate code in all circumstances. |
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 or Opaque Behavior. |
You can deactivate the Software Production Operation you do not need.
To deactivate the Software Production Operation
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 record files located in <local workspace path>\etc\operations\spoRecordFile.json (you will have access to it if you need it, for example, for the debugging purpose). When you 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.