connectScalar

Adds signal for streaming to scalar display

Description

example

hScalar = connectScalar(instrument_object,hDisplay,blockPath,portIndex,Name,Value) connects a signal by using the block path and port index for streaming to a scalar display as a scalar object.

example

hScalar = connectScalar(instrument_object,hDisplay,signalName,Name,Value) connects a signal by using a signal name for streaming to a scalar display as a scalar object.

example

hScalar = connectScalar(instrument_object,hDisplay,signalList,Name,Value) adds a signal by using a signal list for streaming to a scalar display as a scalar object.

Examples

collapse all

Connect a signal for streaming to the real-time instrumentation object and display 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'
myScalar = connectScalar(hInst,myDisplay,'my_xpctank/ControlValue',1);

Connect a signal for streaming to the real-time instrumentation object and display 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'
myScalar = connectScalar(hInst,myDisplay,'ControlValueOut');

Connect signals for streaming to the real-time instrumentation object and display 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'
myScalar = connectScalar(hInst,myDisplay,mySignals);

Connect signals for streaming to the real-time instrumentation object and display object by using a signal list object. The connectScalar function in this example sets a property value for the scalar object myScalar.

% 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'
myScalar = connectScalar(hInst,myDisplay,mySignals,'Limits',[0 100]);

Input Arguments

collapse all

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

Example: hInst

The scalar display object displays the streaming data from the instrumentation object.

Example: myGauge

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 argument selects properties of the scalar object hScalar and sets values for the properties.

Example: 'Limits',[0 100]

Output Arguments

collapse all

The variable object hScalar that is created for the hDisplay object. This variable displays the streaming data from the instrumentation object.

Example: myScalar

Introduced in R2019b