Versions Compared

Key

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

Group

Model Interaction,

Alias

Description

Creates

Create a new alias which is used as a reference to an absolute path of a parameter or signal. The alias is appended to the current list of aliases.

The alias’s name is a no case-sensitive string that should be unique. It should not contains the following special character: asterisk (*) and question mark (?). It

consist

consists of partitions and a name, or a name only. A partition is an organizational unit, or container, used to organize aliases into a hierarchical structure. Partitions and name of the alias are separated by slash (/) characters.

The topmost partition in any partition is called the root partition. A partition that is below another partition is called a subpartition.

A partition above a subpartition is called the parent partition. The root partition is a slash (/) characters.

Below are examples of valid alias’name:

  • myAliasName

  • /myPartition/myAliasName

  • /myRootPartition/myChildrenPartition/myAliasName

When using alias’ API functions, many syntax is available to refer to one specific alias.

For example, an alias called “/myPartition/myAlias” can be referenced with the following syntax:

  • /myPartition/myAlias,

  • myPartition/myAlias or

  • myAlias (required a unique name)

Background Colorcolor#D3D3D3
Note

Note: the last syntax is only available if no other partitions contain an alias with the name

“myAlias”

‘myAlias’.

With Matlab/Simulink, the absolute path of a parameter is the concatenation of the path of the block that contains the parameter and the name of the parameter.

Below are examples of parameter’s paths of a SineWave block:

  • Subsystem/SineWave/Amplitude

  • Subsystem/SineWave/Frequency

By analogy, with Matlab/Simulink, the absolute path of a signal is the concatenation of the path of the block that outputs the signal and the signal’s label. If the label is empty in the Simulink model, the port’s name that outputs the signal is used instead of the label.

Below are examples of paths for a signal at the outport 1 of a SineWave block:

  • SubSystem/SineWave/MySignalLabel, or

  • SubSystem/SineWave/Port1

Background Colorcolor#D3D3D3
Note

Note: any of the following kind of signals can be referenced: control signals, acquisition signals

,

and dynamic signals.

Required Control

Configuration control

Usage

RtlabApi.CreateAlias(aliasName, referencePath)

Input

  • aliasName: Name of the alias. It must be unique.

  • referencePath: Absolute path of the parameter or signal referenced by the alias. This path must exist in the model.

Output

None

Exception

  • EOK: Success.

  • EPERM: Configuration control has not been granted to this client.

  • EINVAL: The reference path of the parameter or signal is not found in the model.

  • EACCES: The alias already exists.

  • EBADF: Model not specified by previous Connect or

SetCurrentModel
  • OpenProject.

  • EIO: Error sending the request or receiving the reply.

Examples


Related Items

RemoveAlias, LoadAlias, GetValueByAlias, SetValueByAlias.

Modules

import RtlabApi