Signal builder simulink как добавить точку
Перейти к содержимому

Signal builder simulink как добавить точку

  • автор:

Signal builder simulink как добавить точку

Working with Signal Groups

The Signal Builder block allows you to create interchangeable groups of signal sources and quickly switch the groups into and out of a model. Signal groups can greatly facilitate testing a model, especially when used in conjunction with Simulink assertion blocks and the optional Model Coverage Tool.

Creating a Signal Group Set

To create an interchangeable set of signal groups:

  1. Drag an instance of the Signal Builder block from the Simulink Sources library and drop it into your model.
  1. By default the block represents a single signal group containing a single signal source that outputs a square wave pulse.
  1. Use the block’s signal editor (see The Signal Builder Dialog Box) to create additional signal groups, add signals to the signal groups, modify existing signals and signal groups, and select the signal group that the block outputs.
  2. Connect the output of the block to your diagram.
  1. The block displays an output port for each signal that the block can output.

You can create as many Signal Builder blocks as you like in a model, each representing a distinct set of interchangeable groups of signal sources. See Simulating with Signal Groups for information on using signal groups in a model.

The Signal Builder Dialog Box

The Signal Builder block’s dialog box allows you to define the waveforms of the signals output by the block. You can specify any waveform that is piecewise linear.

To open the dialog box, double-click the block’s icon. The Signal Builder dialog box appears.

The Signal Builder dialog box allows you to create and modify signal groups represented by a Signal Builder block. The Signal Builder dialog box includes the following controls.

Group Panes

Displays the set of interchangeable signal source groups represented by the block. The pane for each group displays an editable representation of the waveform of each signal that the group contains. The name of the group appears on the pane’s tab. Only one pane is visible at a time. To display a group that is invisible, select the tab that contains its name. The block outputs the group of signals whose pane is currently visible.

Signal Axes

The signals appear on separate axes that share a common time range (see Signal Builder Time Range). This allows you to easily compare the relative timing of changes in each signal. The Signal Builder automatically scales the range of each axis to accommodate the signal that it displays. Use the Signal Builder’s Axes menu to change the time (T) and amplitude (Y) ranges of the selected axis.

Signal List

Displays the names and visibility (see Editing Signals) of the signals that belong to the currently selected signal group. Clicking an entry in the list selects the signal. Double-clicking a signal’s entry in the list hides or displays the signal’s waveform on the group pane.

Selection Status Area

Displays the name of the currently selected signal and the index of the currently selected waveform segment or point.

Waveform Coordinates

Displays the coordinates of the currently selected waveform segment or point. You can change the coordinates by editing the displayed values (see Editing Waveforms).

Name of the currently selected signal. You can change the name of a signal by editing this field (see Renaming a Signal).

Index of the currently selected signal. The index indicates the output port at which the signal appears. An index of 1 indicates the topmost output port, 2 indicates the second port from the top, and so on. You can change the index of a signal by editing this field (see Changing a Signal’s Index).

Displays context-sensitive tips on using Signal Builder dialog box features.

Displaying Signals Represented by Virtual Signals Editing Signal Groups

Signal builder simulink как добавить точку

Create and generate interchangeable groups of signals whose waveforms are piecewise linear.

The Signal Builder allows you to create interchangeable groups of piecewise linear signal sources and use them in a model. See Working with Signal Groups in Using Simulink for more information.

Data Type Support

A Signal Builder block outputs a scalar or array of real signals of type double .

Parameters and Dialog Box

The Signal Builder block has the same dialog box as that of a Subsystem block. To display the dialog box, select Block Parameters from the block’s context menu.

Characteristics

Sign Signal Generator

signalbuilder

[ time , data ] = signalbuilder( block ) returns the time and data of the Signal Builder block, block .

[ time , data , signames ] = signalbuilder( block ) returns signal names, signames , and time and data.

[ time , data , signames , groupnames ] = signalbuilder( block ) returns the signal names, signames , and group names, groupnames , and time and data.

block = signalbuilder( path , ‘create’ , time , data ) creates a new Signal Builder block at path with specified time and data. Signal and group names are default.

block = signalbuilder( path , ‘create’ , time , data , signames , groupnames ) creates a new Signal Builder block at path with specified time and data, signal names, and group names.

block = signalbuilder( path , ‘create’ , time , data , signames , groupnames , vis ) creates a new Signal Builder block and sets the visible signals in each group based on the values of the matrix vis .

block = signalbuilder( path , ‘create’ , time , data , signames , groupnames , vis , pos ) creates a new Signal Builder block and sets the block position to pos .

If you create signals that are smaller than the display range or do not start from 0, the Signal Builder block extrapolates the undefined signal data. It does so by holding the final value.

block = signalbuilder( path , ‘create’ , time , data , signames , groupnames , vis , pos , ) creates a new Signal Builder block and opens or invisibly loads the model and Signal Builder block window.

blk = signalbuilder( blk , ‘appendgroup’ , time , data , signames , groupnames ) appends new groups ( groupnames ) containing signames to the Signal Builder block, block . The time and data arguments must have the same number of signals as the existing block.

signalbuilder( block , ‘appendgroup’ , ds ) appends one dataset.

signalbuilder( block , ‘appendsignal’ , time , data , signames ) appends new signals to all signal groups in the Signal Builder block, block . You can append either the same signals to all groups, or append different signals to different groups. Regardless of which signals you append, append the same number of signals to all the groups. Append signals to all the groups in the block; you cannot append signals to a subset of the groups. Correspondingly, provide time and data arguments for either one group (append the same information to all groups) or different time and data arguments for different groups.

signalbuilder( block , ‘showsignal’ , signal , group ) makes signals that are hidden from the Signal Builder block visible. By default, signals in the current active group are visible when created.

signalbuilder( block , ‘hidesignal’ , signal , group ) makes signals, signal , hidden from the Signal Builder block. By default, all signals are visible when created.

[ time , data ] = signalbuilder( block , ‘get’ , signal , group ) gets the time and data values for the specified signal(s) and group(s).

ds = signalbuilder( block , ‘get’ , group ) gets one or more datasets for one requested Signal Builder group. r gets N datasets for N requested Signal Builder groups.

[ ds, …dsN ] = signalbuilder( block , ‘get’ , group ) gets N datasets for N requested Signal Builder groups.

signalbuilder( block , ‘set’ , signal , group , time , data ) sets the time and data values for the specified signal and group. Use empty values of time and data to remove groups and signals. To remove a signal group, you must also remove all the signals in that group in the same command.

signalbuilder( block , ‘set’ , group , ds ) sets one dataset for the requested Signal Builder group. Specifying an empty dataset deletes the groups specified in group .

signalbuilder( block , ‘set’ , group ,[ ds1 . dsN ]) sets N datasets for N requested groups.

index = signalbuilder( block , ‘activegroup’ ) gets the index of the active group.

[ index , activeGroupLabel ] = signalbuilder( block , ‘activegroup’ ) gets the label value of the active group.

signalbuilder( block , ‘activegroup’ , index ) sets the active group to indexed active group.

signalbuilder( block , ‘annotategroup’ ) controls the display of the current group name on the mask of the Signal Builder block. ‘annotategroup’ takes one of these values:

  • ‘on’ — Shows the current group name
  • ‘off’ — Hides the current group name

signalbuilder( block , ‘print’ , config , printArgs ) prints the currently active signal group or the signal group that config specifies. Use the config to customize the printed appearance of a signal group.

figh = signalbuilder( block , ‘print’ , config , ‘figure’ ) prints the currently active signal group or the signal group that config specifies to a new hidden figure handle, figh .

How to add more data points in Signal Builder?

Hello, I want to create a signal in Simulink manually. I came across the Signal Builder block but I cannot figure out how to add more data points so that I can drag the points to create a signal of different amplitudes. There is not much information about this block in Help nor the manual. Could anybody please show me how to do that? Thanks

0 Comments

Answers (6)

Chinmay Sharma on 20 Jun 2017

Direct link to this answer

Cancel Copy to Clipboard

Direct link to this answer

Cancel Copy to Clipboard
While hovering over the curve, use shift+click to add a data point.

2 Comments

Pedro Martinez on 1 Nov 2019

Direct link to this comment

Cancel Copy to Clipboard

Direct link to this comment

Cancel Copy to Clipboard
Thanks. How did you know?
I wish that information was at least shown on the help.

Ideally, there should be the options of «Add point» and «Delete Point» in the right-click pop-up menu.

Clyde Webster on 17 Sep 2020

Direct link to this comment

Cancel Copy to Clipboard

Direct link to this comment

Cancel Copy to Clipboard
I second this, this is exceptionally unintuitive.
Ali Alemi on 9 Apr 2021

Direct link to this answer

Cancel Copy to Clipboard

Direct link to this answer

Cancel Copy to Clipboard
Hold shift key. Then left-click on the signal where you want to add a point.

0 Comments

ES on 12 May 2017

Direct link to this answer

Cancel Copy to Clipboard

Direct link to this answer

Cancel Copy to Clipboard

You can define the signal in excel and import it into signal builder (using File->import from file). This is by far the easiest way.

3 Comments

b b on 12 May 2017

Direct link to this comment

Cancel Copy to Clipboard

Direct link to this comment

Cancel Copy to Clipboard
Edited: b b on 12 May 2017

Thanks. I saw this feature but I don’t know how to do it. For example, I want 0 in the first 10 msec. Then, an amplitude of 6 at the 10-15 th msec followed by 0 at 15-17msec. Next, -3 during 17-20ms. 0 for the rest until the 50ms. Something like that. Any example? How do we specify the time unit in EXCEL so that the time series data get imported to Simulink correctly?

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *