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

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Group

Model Interaction, MATLAB Variables
Description

Provides the details of each variable defined as MATLAB variables under the model trees. The details for each variable include:

  • Variable Id
  • Variable name (as defined in MATLAB)
  • Variable value
  • Tuple of paths of all parameters in blocks using the variable

The API call only works only when the <model_name>.param file has these MATLAB variables defined. MATLAB variables get added to these variables if they are assigned inside the MATLAB command before opening model box of the Simulation Tool tab (in the model explorer window).

Usage

((id1, name1, val1, (path1.1, path1.2,...)), (id2, val2, name2, (path2.1, path2.2, ...)), ...) = RtlabApi.SetVariables( )

Input

None

Output

Returns a tuple containing tuples for each variable. Tuple for each variable contains

  • Variable Id (id1)
  • Variable name as defined in MATLAB (name1)
  • Variable value (val1)
  • Tuple of paths of all parameters in blocks using the variable ( (path1.2, path2.2, ...) )
Exception
  • EOK: Success.
  • EINVAL: One of the variables doesn’t exist..
  • EIO: Error sending the request or receiving the reply.
  • EBADF: Model not specified by previous Connect or SetCurrentModel.
  • OP_API_MODEL_IO_TIMEOUT: Timed out waiting for reply from model.
  • OP_API_MODEL_IO_ERROR: Model is missing some or all processes or subsystems.
  • No labels