<< SimpleFMU fmu_wrapper fmiCompletedIntegratorStep >>

fmu_wrapper >> fmu_wrapper > Export FMU from Xcos

Export FMU from Xcos

Export FMUs for Model Exchange and Co-Simulation Version 1.0

Description

Xcos model can be exported as an FMU for Model Exchange or for Co-Simulation. Actually, only generation of FMUs version 1.0 of FMI is supported. Code generation works by translation the Xcos super-block in FMU. Generated model can be imported in Xcos or in an another simulation tool.

Note: Before importing the FMU in another tool, you have to add Scilab DLLs to your PATH environment variable.

Export FMU step by step :

  • Create a Xcos model

    Creation of a simple Xcos model (integration and compute the absolute value of the input).

    Create a super-block

    A FMU generation is done through the Xcos super-block. First of all the user should do «selection to super-block». Note: inputs and outputs of your super-block must be connected (e.g. input is connected with a sinus, output with a scope). A single click on the super-block helps to select the block for further FMU generation.

    Configure an FMU

    Open menu « Tools -> export FMU ». When dialog box appears, the user should set some parameters concerning the FMU generation.

    Check of generated FMU

    If an FMU has been generated successfully, you will see the the following dialog box.

    Otherwise, you will see the following dialog box.

    In this case, see the console of Scilab to find the error message.

    Import generated FMU in Xcos

    Generated model can be imported in Xcos using of current FMU import wrapper. For more information, please, see Import FMU. We connect a sinus to the inputs and the scopes to the outputs.

    Limitations at the current version of Xcos FMU generator

    Only explicit blocks are allowed for FMU generation. It is not always possible to provide an equivalent methodology in FMU generated in Xcos, for example the blocks with output activation ports are not supported yet for code generation. Also, some difference of the simulation results can be incurred for the Xcos blocks with input activation ports (par example: palette "discrete time systems"). Another limitation: only scalar inputs could be used for the FMUs that will be generated in Xcos. Also, one important limitation in the FMU generation is that the blocks with input/output activation ports are not supported for Co-Simulation models. In order to use FMUs for Co-Simulation generated in Xcos in another simulation tool the users must have installed Scilab on their PC.

    There are also some Xcos blocks that can not be used for FMU generation(Model Exchange and Co-Simulation):

    See Also


    Report an issue
    << SimpleFMU fmu_wrapper fmiCompletedIntegratorStep >>