Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Group

Model Interaction, MATLAB Variables

Description

Provides

Provide 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

GetVariablesDescription( )

Input

None

Output

Returns

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

  • id1: Variable Id

(id1)
  • name1: Variable name as defined in MATLAB

(name1)
  • val1: Variable value

(val1)
  • (path1.2, path2.2, ...) : 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
  • OpenProject.

  • 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.

Examples

None

Related Items

SetVariables

Modules

import RtlabApi