Main Content

Simulink.sdi.markSignalForStreaming

Turn logging on or off for signal

Description

Simulink.sdi.markSignalForStreaming(block,portIndex,log), where log is "on", marks the signal connected to the specified portIndex of the specified block for logging. To stop logging a signal, specify log as "off".

example

Simulink.sdi.markSignalForStreaming(portHandle,log) marks the signal connected to the port specified by portHandle for logging.

example

Simulink.sdi.markSignalForStreaming(lineHandle,log) marks the signal specified by lineHandle for logging.

example

Examples

collapse all

Mark the signal connected to the first output port of the Gain block for logging in the model myModel.

Simulink.sdi.markSignalForStreaming("myModel/Gain",1,"on");

Use the get_param function to get the port handles for the source block of your signal of interest. For example, get the port handle for the output port of the Gain block in the model myModel.

portHandles = get_param("myModel/Gain","PortHandles");
myPortHandle = portHandles.Outport;

Use the port handle to mark the desired signal for logging.

Simulink.sdi.markSignalForStreaming(myPortHandle,"on");

Use the get_param function to get the line handle for your signals of interest. For example, get the handle for the signal line connected to the output port of the Gain block in the model myModel.

lineHandles = get_param("myModel/Gain","LineHandles");
myLineHandle = lineHandles.Outport;

Use the line handle to mark the desired signal for logging.

Simulink.sdi.markSignalForStreaming(myLineHandle,"on");

Input Arguments

collapse all

Source block path or handle for the block with the desired signal connected to one of its output ports, specified as a string or character vector. To get the path or handle of the currently selected block, use the gcb or gcbh function, respectively.

Example: "myModel/Gain"

Output port index of the source block connected to the signal you want to mark for streaming, specified as a positive integer.

Example: 1

Logging state of signal, specified as one of these options:

  • "on" –– Turn logging on for a signal.

  • "off" –– Turn logging off for a signal.

Port handle of the output port of the source block connected to the signal you want to mark for streaming, specified as a handle.

Use the get_param function with the "PortHandles" option to get port handles.

Example: myPortHandles.Outport(1)

Line handle for the signal, specified as a handle.

Use the get_param function with the "LineHandles" option to get line handles.

Example: myLineHandles.Outport(1)

Version History

Introduced in R2015b