Hello Svenh,
In Simulink, the Function Element and Element Call blocks are not used for calling functions within subsystems. The Function Element block lets you call a Simulink function from one referenced model using a function caller in another referenced model.
To call a function that resides in a subsystem from outside the subsystem in Simulink, you can follow these steps:
- Inside the subsystem, add Inport and Outport blocks to represent the function inputs and outputs and connect the necessary signals to it.
- Place Inport blocks outside the subsystem for function inputs and connect them to the corresponding Inport blocks inside the subsystem.
- Place Outport blocks outside the subsystem for function outputs and connect them to the corresponding Outport blocks inside the subsystem.
With this, you can call the function defined in the subsystem from outside the subsystem. The Inport blocks represent the function inputs, and the Outport blocks represent the function outputs.
Additionally you can refer to the documentation for a better understanding-
I hope this resolves your query!