Main Content

Generated Code Structure for PLC_RemoveSSStep

The example shows you how to enable the PLC_RemoveSSStep option for your model, generate code and display the comparison between code generated with the PLC_RemoveSSStep option enabled and then disabled.

  1. Open the UsePLC_RemoveSSStepforDistributedCode GenerationExample example:

    openExample('plccoder/UseRemoveSSStepForDistributedCodeGenerationExample')
    .

  2. Copy all the model files to a folder of your choice.

  3. Open the mSystemIntegration model.

  4. Open the Simulink PLC Coder app, and then select the Subsystem1 block.

  5. Click Settings. Navigate to PLC Code Generation > Identifiers. Select the Keep top level ssMethod name same as non-top level check box.

  6. Click OK.

  7. Click Generate PLC Code.

  8. Select the Subsystem1 block.

  9. Click Settings. Navigate to PLC Code Generation > Identifiers. Clear the Keep top level ssMethod name same as non-top level check box.

  10. Click Generate PLC Code.

This image shows a comparison between the code generated with PLC_RemoveSSStep enabled, and then disabled. Removing SS_STEP enables easier external code integration of the different subsystems because they all the same ssMethodType.

Code generated with PLC_RemoveSSStep enabled is next to code generated with PLC_RemoveSSStep disabled. Code is highlighted to show SS_STEP is not present in the code when PLC_RemoveSSStep is enabled.

See Also

Related Topics