Main Content

SignalTable

Create signal table for instrument panel UI

Since R2021b

Description

hSigTable = slrealtime.ui.control.SignalTable(hFigure) creates an editable signal table display for an instrument panel uifigure figure. Only the Enabled column is editable to enable or disable a signal from streaming its value to the table. The display shows the signals that you have selected for streaming in the real-time application. When the instrument panel app is running, the SignalTable component provides a right-click menu that lets you select signals to add to or remove from the display.

For information about control properties, see slrealtime.ui Properties. It is important to set the TargetSource property for this control if you plan on using your app with target computers other than the default target computer.

example

Examples

collapse all

Create a signal table and adjust the position of the table.

% Create figure 
hFig = uifigure(); 
% Create signal table component 
hSTable = slrealtime.ui.control.SignalTable(hFig); 
hSTable.Signals = struct( ... 
  'BlockPath', {'testmodel/Constant1', 'testmodel/Constant2', ...
                'testmodel/Sine Wave', 'testmodel/str2', ...
				'testmodel/Switch1'}, ... 
  'PortIndex', {1, 1, 1, 1, 1}, . . .
  'Decimation', {1, 2, 5, 1, 1}, . . .
  'ArrayIndex', {[], [], 2, [2 2], 3}, . . .
  'BusElement', {'', 'b', '', 'z', 'a'}, . . .
  'Callback', {[], cb, [], [], []}); 
% Change position of the component 
hSTable.Position = [0 0 200 200]; 
% Customize 
hSTable.FontWeight = 'bold'; 
hSTable.FontAngle = 'italic';

Create a signal table and adjust the position of the table. When using signal names in the Signals property, the BlockPath selects the signal name and the PortIndex value is -1.

% Create figure 
hFig = uifigure(); 
% Create signal table component 
hSTable = slrealtime.ui.control.SignalTable(hFig); 
hSTable.Signals = struct( ... 
  'BlockPath', {'testmodel/Constant1', 'testmodel/Constant2', ...
                'Sine', 'String', 'testmodel/Switch1'}, ... 
  'PortIndex', {1, 1, -1, -1, 1}); 
  'Decimation', {1, 2, 5, 1, 1}, . . .
  'ArrayIndex', {[], [], 2, [2 2], 3}, . . .
  'BusElement', {'', 'b', '', 'z', 'a'}, . . .
  'Callback', {[], cb, [], [], []}); 
% Change position of the component 
hSTable.Position = [0 0 200 200]; 
% Customize 
hSTable.FontWeight = 'bold'; 
hSTable.FontAngle = 'italic';

Input Arguments

collapse all

The hFigure argument identifies the uifigure to which you are adding the UI component.

Example: hFig = uifigure()

Data Types: function_handle

Output Arguments

collapse all

The hSignTable argument is the handle to the signal table component that you create.

Version History

Introduced in R2021b

expand all