Main Content

Specify Custom Names for Generated Files

The Simulink® PLC Coder™ software generates Structured Text code and stores it according to the target IDE platform. These platform-specific paths are default locations for the generated code. For more information, see Files Generated by Simulink PLC Coder.

To specify a different name for the generated files, set the Function name options parameter in the Subsystem block:

  1. Right-click the Subsystem block for which you want to generate code and select Subsystem Parameters.

  2. In the Main tab, select the Treat as atomic unit check box.

  3. Click the Code Generation tab.

  4. From the Function Packaging parameter list, select Reusable Function.

    These options enable the Function name options and File name options parameters.

  5. Select the option that you want to use for generating the file name.

    Function name optionsGenerated File Name
    AutoDefault. Uses the model name, as listed in Prepare Model for Structured Text Generation, for example, plcdemo_simple_subsystem.
    Use subsystem nameUses the subsystem name, for example, SimpleSubsystem.
    User specifiedUses the custom name that you specify in the Function name parameter, for example, SimpleSubsystem.