getsignalname

Signal name from index list

Description

example

signal_name = getsignalname(target_object, signal_index) returns a signal name for the specified signal index.

Note

Signal access by signal index will be removed in a future release. Access signals by signal name instead.

Examples

collapse all

Get the signal name for signal index 29 in model ex_slrt_sf_car.

tg = slrt;
signal_name = getsignalname(tg,29)
signal_name =

    'transmission/Torque Converter/turbine'

Input Arguments

collapse all

Object that represents the target computer. Before calling this function, make sure that you start the target computer with the Simulink® Real-Time™ kernel and apply the required Ethernet link settings.

Example: tg

Index as shown in the Signals property of the real-time application. To be accessible via signal index, you must be able to observe the signal.

Note

Signal access by signal index will be removed in a future release. Access signals by signal name instead.

Output Arguments

collapse all

The signal name refers to the block path of the block whose output is the specified signal. The software constructs the name according to these rules:

  • If the block has more than one output port, '/pn' is appended to the signal name. n is the port number (starting at 1).

  • If the output port is not a scalar, '/sn' is appended to the signal name. The number n is the index of signal signal_index within the vector or matrix. For this purpose, the signals are flattened to one dimension. For example, the signals /s1, /s2, /s3, and /s4 represent a 2 x 2 matrix.

For block subsystem/path/to/block, these rules result in the behavior listed in this table.

Output PortSignal Name
  • One output port.

  • The port is a scalar port.

subsystem/path/to/block

  • One output port.

  • The port is a vector port.

  • signal_index refers to the second element within that vector.

subsystem/path/to/block/s2

  • Three output ports.

  • The second port is a scalar port.

  • signal_index refers to the output from the second port.

subsystem/path/to/block/p2

  • Three output ports.

  • The second output port is a vector port.

  • signal_index refers to the seventh element within that vector.

subsystem/path/to/block/p2/s7

Introduced in R2014a