Documentation Home Page HYPERSIM Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Simulink | Using S-Functions

S-functions in Simulink allow the user to implement C code within an external file for his model following a strict syntax. An S-function is called inline when the C is written in a tlc file. This case is fully transparent to the user.
For the other cases where the S-function is non-inline, the user has to follow these actions to succeed in importing his model to HYPERSIM:
If the non-inline S-function is embedded in the SPS library (Simscape Power Systems) as Discrete Transport Delay, it’s transparent for the user and there is nothing to do.


For others:

  • Only .c files are supported for S-function in the HYPERSIM importation.
  • Put the .c external file in the same directory of the model .slx or .mdl.
  • Before running the model which contains the S-function in Simulink, do mex fileSfunction.c.
  • Then proceed with the HYPERSIM importation method described in “Importing a Simulink model in HYPERSIM”.

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323