connectLine

Connects signal for streaming to axis

Description

example

[hLine, lineName] = connectLine(instrument_object,hAxis,blockPath,portIndex,Name,Value) connects a signal by using the block path and port index for streaming to an axis.

example

[hLine,lineName] = connectLine(instrument_object,hAxis,signalName,Name,Value) connects a signal by using a signal name for streaming to an axis.

example

[hLine,lineName] = connectLine(instrument_object,hAxis,signalList,Name,Value) connects a signal by using a signal list for streaming to an axis.

Examples

collapse all

Connect a signal for streaming to the real-time instrumentation object and axis object by using the block path and port index.

mldatxfile = 'my_xpctank.mldatx';
hInst  = SimulinkRealTime.prototype.Instrumentation(mldatxfile);
% for technical preview in R2019b, function name includes '.prototype'
[myLine,myLName1] = connectLine(hInst,myAxis,'my_xpctank/ControlValue',1);

Connect a signal for streaming to the real-time instrumentation object and axis object by using a signal name.

% added signal name to model before building mldatxfile
mldatxfile = 'my_xpctank.mldatx';
hInst  = SimulinkRealTime.prototype.Instrumentation(mldatxfile);
% for technical preview in R2019b, function name includes '.prototype'
[myLine,myLName1] = connectLine(hInst,myAxis,'ControlValueOut');

Connect signals for streaming to a real-time instrumentation object and axis object by using a signal list object.

% added signals to signal list object after building mldatxfile
mldatxfile = 'my_xpctank.mldatx';
hInst  = SimulinkRealTime.prototype.Instrumentation(mldatxfile);
% for technical preview in R2019b, function name includes '.prototype'
[myLine,myLName1] = connectLine(hInst,myAxis,mySignals);

Connects signals for streaming to a real-time instrumentation object and axis object by using a signal list object. The connectLine function in this example sets a property value for the line object myLine.

% added signals to signal list object after building mldatxfile
mldatxfile = 'my_xpctank.mldatx';
hInst  = SimulinkRealTime.prototype.Instrumentation(mldatxfile);
% for technical preview in R2019b, function name includes '.prototype'
[myLine,myLName1] = connectLine(hInst,myAxis,mySignals,'MaximumNumPoints', 5000);

Input Arguments

collapse all

To create the instrumentation object, use the SimulinkRealTime.prototype.Instrumentation function.

Example: hInst

To create an axes object, use hAxis = gca or hAxis = axes ().

Example: myAxes

For the selected block, gcb returns the full block path name.

Example: xpctank/ControlValue

For the selected signal, the output port index and signal name are visible in the signal hierarchy viewer or model data editor.

Example: 1

For the selected signal, the port index and signal name are visible in the signal hierarchy viewer or model data editor.

Example: ControlValueOut

To create a signal list object for a model or real-time application, use the SimulinkRealTime.SignalList function.

Example: mySignals

The Name,Value pair argument selects properties and property values of the hLine object that is created when the signal is connected to the instrumentation object instrument_object.

Example: 'MaximumNumPoints', 5000

Output Arguments

collapse all

The animatedline object that is created for the hAxis object. This line displays the streaming data from the instrumentation object.

Example: myLine

The DisplayName attribute that is set for the line of the animatedline object in the hAxis object.

Example: 'ControlValue line'

Introduced in R2019b