📄 samplehold.mdl
字号:
DropShadow off
NamePlacement "normal"
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
ShowName on
}
BlockParameterDefaults {
Block {
BlockType Constant
Value "1"
VectorParams1D on
OutDataTypeMode "Inherit from 'Constant value'"
OutDataType "sfix(16)"
ConRadixGroup "Use specified scaling"
OutScaling "2^0"
SampleTime "inf"
}
Block {
BlockType DiscreteIntegrator
IntegratorMethod "Integration: Forward Euler"
gainval "1.0"
ExternalReset "none"
InitialConditionSource "internal"
InitialCondition "0"
InitialConditionMode "State and output"
SampleTime "1"
OutDataTypeMode "Inherit via internal rule"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow off
LimitOutput off
UpperSaturationLimit "inf"
LowerSaturationLimit "-inf"
ShowSaturationPort off
ShowStatePort off
StateMustResolveToSignalObject off
RTWStateStorageClass "Auto"
}
Block {
BlockType DiscretePulseGenerator
PulseType "Sample based"
TimeSource "Use simulation time"
Amplitude "1"
Period "2"
PulseWidth "1"
PhaseDelay "0"
SampleTime "1"
VectorParams1D on
}
Block {
BlockType Inport
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
Interpolate on
}
Block {
BlockType Outport
Port "1"
BusObject "BusObject"
BusOutputAsStruct off
PortDimensions "-1"
SampleTime "-1"
DataType "auto"
OutDataType "sfix(16)"
OutScaling "2^0"
SignalType "auto"
SamplingMode "auto"
OutputWhenDisabled "held"
InitialOutput "[]"
}
Block {
BlockType Product
Inputs "2"
Multiplication "Element-wise(.*)"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Zero"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
Block {
BlockType RelationalOperator
Operator ">="
InputSameDT on
LogicOutDataTypeMode "Logical (see Configuration Parameters: Optimiza"
"tion)"
LogicDataType "uint(8)"
ZeroCross on
SampleTime "-1"
}
Block {
BlockType Scope
Floating off
ModelBased off
TickLabels "OneTimeTick"
ZoomMode "on"
Grid "on"
TimeRange "auto"
YMin "-5"
YMax "5"
SaveToWorkspace off
SaveName "ScopeData"
LimitDataPoints on
MaxDataPoints "5000"
Decimation "1"
SampleInput off
SampleTime "0"
}
Block {
BlockType "S-Function"
FunctionName "system"
PortCounts "[]"
SFunctionModules "''"
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions "ReadWrite"
PermitHierarchicalResolution "All"
SystemSampleTime "-1"
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType TriggerPort
TriggerType "rising"
StatesWhenEnabling "inherit"
ShowOutputPort off
OutputDataType "auto"
SampleTimeType "triggered"
SampleTime "1"
ZeroCross on
}
}
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 "samplehold"
Location [2, 78, 1438, 845]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType Inport
Name "input1"
Position [500, 128, 530, 142]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType SubSystem
Name "intergrate&judge"
Ports [1, 1]
Position [730, 140, 770, 200]
TreatAsAtomicUnit off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
System {
Name "intergrate&judge"
Location [367, 111, 1142, 390]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "input1"
Position [25, 93, 55, 107]
Port "1"
IconDisplay "Port number"
LatchInput off
}
Block {
BlockType Reference
Name "Compare\nTo Constant"
Ports [1, 1]
Position [470, 104, 515, 136]
LinkData {
BlockName "Compare"
DialogParameters {
Operator ">="
LogicOutDataTypeMode "Boolean"
}
}
SourceBlock "simulink/Logic and Bit\nOperations/Compare"
"\nTo Constant"
SourceType "Compare To Constant"
ShowPortLabels on
relop ">="
const "0.17"
LogicOutDataTypeMode "uint8"
}
Block {
BlockType Constant
Name "Constant1"
Position [25, 165, 55, 195]
Value "10"
}
Block {
BlockType DiscreteIntegrator
Name "Discrete-Time\nIntegrator"
Ports [2, 1]
Position [265, 101, 300, 134]
IntegratorMethod "Integration: Forward Euler"
gainval "3.0"
ExternalReset "either"
InitialConditionSource "internal"
SampleTime "0.001"
ICPrevOutput "DiscIntNeverNeededParam"
ICPrevScaledInput "DiscIntNeverNeededParam"
}
Block {
BlockType Product
Name "Product3"
Ports [2, 1]
Position [160, 92, 190, 123]
InputSameDT off
OutDataTypeMode "Inherit via internal rule"
SaturateOnIntegerOverflow off
SampleTime "0.001"
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator1"
Ports [0, 1]
Position [150, 133, 195, 167]
PulseType "Time based"
Period "0.015"
PulseWidth "50"
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator2"
Ports [0, 1]
Position [510, 28, 555, 62]
PulseType "Time based"
Period "0.015"
PulseWidth "50"
}
Block {
BlockType Reference
Name "Sample\nand Hold1"
Ports [1, 1, 0, 1]
Position [570, 99, 620, 141]
FontSize 10
SourceBlock "dspsigops/Sample\nand Hold"
SourceType "Sample and Hold"
ShowPortLabels on
trig "Rising edge"
initCond "0"
}
Block {
BlockType Scope
Name "Scope1"
Ports [2]
Position [720, 220, 750, 255]
Location [6, 54, 1030, 741]
Open off
NumInputPorts "2"
ZoomMode "yonly"
List {
ListType AxesTitles
axes1 "%intergration"
axes2 "%<SignalLabel>"
}
YMin "-5~-5"
YMax "5~5"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
}
Block {
BlockType Outport
Name "Out1"
Position [690, 113, 720, 127]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Pulse\nGenerator1"
SrcPort 1
Points [35, 0; 0, -25]
DstBlock "Discrete-Time\nIntegrator"
DstPort 2
}
Line {
SrcBlock "Constant1"
SrcPort 1
Points [55, 0; 0, -65]
DstBlock "Product3"
DstPort 2
}
Line {
SrcBlock "input1"
SrcPort 1
DstBlock "Product3"
DstPort 1
}
Line {
SrcBlock "Product3"
SrcPort 1
DstBlock "Discrete-Time\nIntegrator"
DstPort 1
}
Line {
SrcBlock "Discrete-Time\nIntegrator"
SrcPort 1
Points [0, 0; 130, 0]
Branch {
Points [20, 0]
DstBlock "Compare\nTo Constant"
DstPort 1
}
Branch {
Points [-110, 0; 0, 110]
DstBlock "Scope1"
DstPort 1
}
}
Line {
SrcBlock "Compare\nTo Constant"
SrcPort 1
DstBlock "Sample\nand Hold1"
DstPort 1
}
Line {
SrcBlock "Pulse\nGenerator2"
SrcPort 1
Points [35, 0]
DstBlock "Sample\nand Hold1"
DstPort trigger
}
Line {
SrcBlock "Sample\nand Hold1"
SrcPort 1
Points [0, 0; 35, 0]
Branch {
Points [0, 125]
DstBlock "Scope1"
DstPort 2
}
Branch {
Points [15, 0]
DstBlock "Out1"
DstPort 1
}
}
}
}
Block {
BlockType Outport
Name "Out1"
Position [960, 143, 990, 157]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "input1"
SrcPort 1
Points [35, 0; 0, 35]
DstBlock "intergrate&judge"
DstPort 1
}
Line {
SrcBlock "intergrate&judge"
SrcPort 1
Points [130, 0; 0, -20]
DstBlock "Out1"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -