📄 busdemo.mdl
字号:
Block {
BlockType Sin
SineType "Time based"
TimeSource "Use simulation time"
Amplitude "1"
Bias "0"
Frequency "1"
Phase "0"
Samples "10"
Offset "0"
SampleTime "-1"
VectorParams1D on
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType Trigonometry
Operator "sin"
OutputSignalType "auto"
SampleTime "-1"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "busdemo"
Location [125, 160, 691, 688]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType BusCreator
Name "Bus\nCreator"
Ports [2, 1]
Position [235, 201, 240, 239]
DialogController "Simulink.DDGSource_Bus"
FontName "Arial"
FontSize 12
Inputs "2"
DisplayOption "bar"
Port {
PortNumber 1
Name "main_bus"
PropagatedSignals "bus1, bus2"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType BusCreator
Name "Bus\nCreator2"
Ports [3, 1]
Position [180, 286, 185, 324]
DialogController "Simulink.DDGSource_Bus"
FontName "Arial"
FontSize 12
Inputs "3"
DisplayOption "bar"
Port {
PortNumber 1
Name "bus2"
PropagatedSignals "Clock, Pulse, Sine"
ShowPropagatedSignals "on"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType BusSelector
Name "Bus\nSelector"
Ports [1, 2]
Position [410, 64, 415, 126]
DialogController "Simulink.DDGSource_Bus"
FontName "Arial"
FontSize 12
OutputSignals "bus2.Pulse,bus1.Chirp"
Port {
PortNumber 1
Name "<Pulse>"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
Port {
PortNumber 2
Name "<Chirp>"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType Scope
Name "Bus Output"
Ports [2]
Position [490, 64, 535, 126]
StartFcn "open_system(gcbh)"
FontName "Arial"
FontSize 12
Location [626, 54, 992, 480]
Open off
NumInputPorts "2"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
axes2 "%<SignalLabel>"
}
TimeRange "10"
YMin "-3~-5"
YMax "3~5"
DataFormat "Structure"
}
Block {
BlockType Reference
Name "Chirp Signal"
Ports [0, 1]
Position [30, 84, 50, 106]
FontName "Arial"
FontSize 12
SourceBlock "simulink/Sources/Chirp Signal"
SourceType "chirp"
ShowPortLabels on
f1 "0.1"
T "10"
f2 "5"
VectorParams1D on
Port {
PortNumber 1
Name "Chirp"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType Clock
Name "Clock"
Position [30, 230, 50, 250]
FontName "Arial"
FontSize 12
Decimation "10"
Port {
PortNumber 1
Name "Clock"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType Constant
Name "Constant"
Position [30, 165, 50, 185]
FontName "Arial"
FontSize 12
Port {
PortNumber 1
Name "Constant"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType Goto
Name "Goto"
Position [95, 80, 135, 110]
DialogController "Simulink.DDGSource"
GotoTag "A"
TagVisibility "global"
}
Block {
BlockType SubSystem
Name "More Info"
Ports []
Position [220, 436, 378, 514]
DropShadow on
ShowName off
OpenFcn "busdemoscript"
FontName "Arial"
FontSize 12
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
PropExecContextAcrossSSBoundary on
RTWSystemCode "Auto"
MaskDisplay "disp('Double click here \\nfor a step-by-step\\"
"ntutorial on this model.')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "More Info"
Location [84, 139, 647, 350]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Annotation {
Name "This demonstration shows how signals may be"
" grouped and ungrouped while\nretaining their names. In this demonstration, "
"5 signals are created and labelled\nappropriately. These signals are then mu"
"x'd together to create a bus of signals.\nThis bus of signals is then fed int"
"o the Bus Selector block. Inside of the Bus \nSelector block, the Pulse and "
"Chirp signals are chosen to be output from the \noriginal signal bus.\n\nIt i"
"s possible to place a nest signal buses and then still retrieve the original "
"signal\nwith its label."
Position [20, 40]
HorizontalAlignment "left"
VerticalAlignment "top"
FontName "Arial"
FontSize 12
}
Annotation {
Name "Bus Block Demonstration"
Position [233, 22]
FontName "Arial"
FontSize 14
FontWeight "bold"
}
}
}
Block {
BlockType SubSystem
Name "More Info1"
Ports []
Position [20, 436, 184, 515]
DropShadow on
ShowName off
OpenFcn "simcad(bdroot);"
FontName "Arial"
FontSize 12
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
PropExecContextAcrossSSBoundary on
RTWSystemCode "Auto"
MaskDisplay "disp('Double click\\nhere for general\\nSimulin"
"k Help')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name "More Info1"
Location [128, 280, 487, 453]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
}
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator"
Ports [0, 1]
Position [30, 294, 50, 316]
FontName "Arial"
FontSize 12
Port {
PortNumber 1
Name "Pulse"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType Sin
Name "Sine Wave"
Ports [0, 1]
Position [30, 360, 50, 380]
FontName "Arial"
FontSize 12
SineType "Time based"
SampleTime "0"
Port {
PortNumber 1
Name "Sine"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType SubSystem
Name "Subsystem"
Ports [1, 1]
Position [150, 104, 200, 166]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
PropExecContextAcrossSSBoundary on
RTWSystemCode "Auto"
Port {
PortNumber 1
PropagatedSignals "bus1"
ShowPropagatedSignals "on"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
System {
Name "Subsystem"
Location [658, 90, 1002, 277]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
ZoomFactor "100"
Block {
BlockType Inport
Name "In2"
Position [20, 123, 50, 137]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType BusCreator
Name "Bus\nCreator1"
Ports [2, 1]
Position [105, 66, 110, 104]
NamePlacement "alternate"
DialogController "Simulink.DDGSource_Bus"
Inputs "2"
DisplayOption "bar"
Port {
PortNumber 1
Name "bus1"
PropagatedSignals "Chirp, Constant"
ShowPropagatedSignals "on"
RTWStorageClass "Auto"
DataLoggingNameMode "SignalName"
ShowSigGenPortName on
}
}
Block {
BlockType From
Name "From"
Position [15, 31, 55, 59]
DialogController "Simulink.DDGSource"
GotoTag "A"
}
Block {
BlockType Outport
Name "Out1"
Position [235, 78, 265, 92]
IconDisplay "Port number"
}
Line {
SrcBlock "From"
SrcPort 1
Points [15, 0; 0, 30]
DstBlock "Bus\nCreator1"
DstPort 1
}
Line {
Name "bus1"
Labels [0, 0]
SrcBlock "Bus\nCreator1"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "In2"
SrcPort 1
Points [20, 0; 0, -35]
DstBlock "Bus\nCreator1"
DstPort 2
}
}
}
Line {
Name "Clock"
FontName "Arial"
FontSize 12
Labels [1, 0]
SrcBlock "Clock"
SrcPort 1
Points [95, 0; 0, 55]
DstBlock "Bus\nCreator2"
DstPort 1
}
Line {
Name "Pulse"
FontName "Arial"
FontSize 12
Labels [1, 0]
SrcBlock "Pulse\nGenerator"
SrcPort 1
DstBlock "Bus\nCreator2"
DstPort 2
}
Line {
Name "Sine"
FontName "Arial"
FontSize 12
Labels [1, 0]
SrcBlock "Sine Wave"
SrcPort 1
Points [95, 0; 0, -55]
DstBlock "Bus\nCreator2"
DstPort 3
}
Line {
Name "Constant"
FontName "Arial"
FontSize 12
Labels [1, 0]
SrcBlock "Constant"
SrcPort 1
Points [80, 0]
DstBlock "Subsystem"
DstPort 1
}
Line {
Name "main_bus"
Labels [0, 0]
SrcBlock "Bus\nCreator"
SrcPort 1
Points [80, 0; 0, -125]
DstBlock "Bus\nSelector"
DstPort 1
}
Line {
Name "<Pulse>"
Labels [0, 0]
SrcBlock "Bus\nSelector"
SrcPort 1
DstBlock "Bus Output"
DstPort 1
}
Line {
Name "<Chirp>"
Labels [0, 0]
SrcBlock "Bus\nSelector"
SrcPort 2
DstBlock "Bus Output"
DstPort 2
}
Line {
Labels [0, 0]
SrcBlock "Subsystem"
SrcPort 1
Points [5, 0; 0, 75]
DstBlock "Bus\nCreator"
DstPort 1
}
Line {
Name "bus2"
Labels [0, 0]
SrcBlock "Bus\nCreator2"
SrcPort 1
Points [20, 0; 0, -75]
DstBlock "Bus\nCreator"
DstPort 2
}
Line {
Name "Chirp"
FontName "Arial"
FontSize 12
Labels [1, 0]
SrcBlock "Chirp Signal"
SrcPort 1
DstBlock "Goto"
DstPort 1
}
Annotation {
Name "Bus Signal Demonstration"
Position [301, 28]
FontName "Arial Black"
FontSize 18
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -