⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sfcontrol1.mdl

📁 state flow program in Matlab simulink.
💻 MDL
📖 第 1 页 / 共 3 页
字号:
      Format		      "short"
      Decimation	      "10"
      Floating		      off
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Inport
      Port		      "1"
      UseBusObject	      off
      BusObject		      "BusObject"
      BusOutputAsStruct	      off
      PortDimensions	      "-1"
      SampleTime	      "-1"
      DataType		      "auto"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      SignalType	      "auto"
      SamplingMode	      "auto"
      LatchByDelayingOutsideSignal off
      LatchByCopyingInsideSignal off
      Interpolate	      on
    }
    Block {
      BlockType		      Mux
      Inputs		      "4"
      DisplayOption	      "none"
      UseBusObject	      off
      BusObject		      "BusObject"
      NonVirtualBus	      off
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      UseBusObject	      off
      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		      "S-Function"
      FunctionName	      "system"
      SFunctionModules	      "''"
      PortCounts	      "[]"
    }
    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		      Switch
      Criteria		      "u2 >= Threshold"
      Threshold		      "0"
      InputSameDT	      on
      OutDataTypeMode	      "Inherit via internal rule"
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
      ZeroCross		      on
      SampleTime	      "-1"
    }
    Block {
      BlockType		      Terminator
    }
    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		    "arial"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  LineDefaults {
    FontName		    "arial"
    FontSize		    9
    FontWeight		    "normal"
    FontAngle		    "normal"
  }
  System {
    Name		    "SFcontrol1"
    Location		    [34, 217, 588, 643]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    200
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "A4"
    PaperUnits		    "centimeters"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      Constant
      Name		      "Constant"
      Position		      [105, 70, 135, 100]
    }
    Block {
      BlockType		      Constant
      Name		      "Constant1"
      Position		      [105, 185, 135, 215]
      Value		      "0"
    }
    Block {
      BlockType		      Constant
      Name		      "Constant2"
      Position		      [105, 310, 135, 340]
      Value		      "130"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Controller"
      Ports		      [1, 1, 0, 1]
      Position		      [345, 218, 530, 322]
      TreatAsAtomicUnit	      on
      MinAlgLoopOccurrences   off
      RTWSystemCode	      "Auto"
      Array {
	Type			"Handle"
	Dimension		1
	Simulink.SigProp {
	  $ObjectID		  11
	  SigName		  "off"
	  BlockPath		  "StateflowChart/off"
	  LogSignal		  1
	}
	PropName		"AvailSigsLoadSave"
      }
      MaskHideContents	      off
      MaskType		      "Stateflow"
      MaskDescription	      "Stateflow diagram"
      MaskDisplay	      "plot(sf('Private','sfblk','xIcon'),sf('Private'"
",'sfblk','yIcon'));text(0.5,0,sf('Private', 'sfblk', 'tIcon'),'HorizontalAl',"
"'Center','VerticalAl','Bottom');"
      MaskSelfModifiable      on
      MaskIconFrame	      off
      MaskIconOpaque	      off
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      System {
	Name			"Controller"
	Location		[257, 457, 812, 717]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"A4"
	PaperUnits		"centimeters"
	ZoomFactor		"100"
	Block {
	  BlockType		  Inport
	  Name			  "temp"
	  Position		  [20, 101, 40, 119]
	  IconDisplay		  "Port number"
	}
	Block {
	  BlockType		  TriggerPort
	  Name			  " input events "
	  Ports			  [0, 1]
	  Position		  [20, 136, 40, 154]
	  TriggerType		  "either"
	  ShowOutputPort	  on
	}
	Block {
	  BlockType		  Demux
	  Name			  " Demux "
	  Ports			  [1, 1]
	  Position		  [270, 160, 320, 200]
	  Outputs		  "1"
	}
	Block {
	  BlockType		  "S-Function"
	  Name			  " SFunction "
	  Tag			  "Stateflow S-Function SFcontrol1 1"
	  Ports			  [2, 2]
	  Position		  [180, 100, 230, 160]
	  FunctionName		  "sf_sfun"
	  PortCounts		  "[2 2]"
	  Port {
	    PortNumber		    2
	    Name		    "speed"
	    RTWStorageClass	    "Auto"
	    DataLoggingNameMode	    "SignalName"
	  }
	}
	Block {
	  BlockType		  Terminator
	  Name			  " Terminator "
	  Position		  [460, 171, 480, 189]
	}
	Block {
	  BlockType		  Outport
	  Name			  "speed"
	  Position		  [460, 101, 480, 119]
	  IconDisplay		  "Port number"
	}
	Line {
	  SrcBlock		  " Demux "
	  SrcPort		  1
	  DstBlock		  " Terminator "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  " SFunction "
	  SrcPort		  1
	  Points		  [0, 65]
	  DstBlock		  " Demux "
	  DstPort		  1
	}
	Line {
	  Name			  "speed"
	  Labels		  [0, 0]
	  SrcBlock		  " SFunction "
	  SrcPort		  2
	  DstBlock		  "speed"
	  DstPort		  1
	}
	Line {
	  SrcBlock		  "temp"
	  SrcPort		  1
	  DstBlock		  " SFunction "
	  DstPort		  1
	}
	Line {
	  SrcBlock		  " input events "
	  SrcPort		  1
	  DstBlock		  " SFunction "
	  DstPort		  2
	}
      }
    }
    Block {
      BlockType		      Display
      Name		      "Display"
      Ports		      [1]
      Position		      [575, 255, 665, 285]
      FontSize		      10
      Decimation	      "1"
      Lockdown		      off
    }
    Block {
      BlockType		      Reference
      Name		      "Manual Switch"
      Ports		      [2, 1]
      Position		      [200, 127, 230, 163]
      SourceBlock	      "simulink/Signal\nRouting/Manual Switch"
      SourceType	      "Manual Switch"
      ShowPortLabels	      on
      sw		      "0"
      action		      "0"
    }
    Block {
      BlockType		      Mux
      Name		      "Mux"
      Ports		      [3, 1]
      Position		      [315, 131, 320, 169]
      ShowName		      off
      Inputs		      "3"
      DisplayOption	      "bar"
    }
    Block {
      BlockType		      Sin
      Name		      "Sine Wave"
      Ports		      [0, 1]
      Position		      [105, 250, 135, 280]
      SineType		      "Time based"
      Frequency		      "2*pi"
      SampleTime	      "0"
    }
    Line {
      SrcBlock		      "Constant"
      SrcPort		      1
      Points		      [20, 0; 0, 50]
      DstBlock		      "Manual Switch"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Constant1"
      SrcPort		      1
      Points		      [20, 0; 0, -45]
      DstBlock		      "Manual Switch"
      DstPort		      2
    }
    Line {
      SrcBlock		      "Mux"
      SrcPort		      1
      Points		      [110, 0]
      DstBlock		      "Controller"
      DstPort		      trigger
    }
    Line {
      SrcBlock		      "Manual Switch"
      SrcPort		      1
      Points		      [30, 0]
      Branch {
	Points			[0, -5]
	DstBlock		"Mux"
	DstPort			1
      }
      Branch {
	Points			[0, 5]
	DstBlock		"Mux"
	DstPort			2
      }
    }
    Line {
      SrcBlock		      "Controller"
      SrcPort		      1
      DstBlock		      "Display"
      DstPort		      1
    }
    Line {
      SrcBlock		      "Sine Wave"
      SrcPort		      1
      Points		      [160, 0]
      DstBlock		      "Mux"
      DstPort		      3
    }
    Line {
      SrcBlock		      "Constant2"
      SrcPort		      1
      Points		      [190, 0]
      DstBlock		      "Controller"
      DstPort		      1
    }
  }
}

# Finite State Machines
#
#    Stateflow Version 6.2 (R14SP2) dated Aug  4 2005, 10:13:39
#
#

Stateflow {

	machine {
		id                   		1
		name                 		"SFcontrol1"
		created              		"07-Feb-2009 08:49:34"
		isLibrary            		0
		firstTarget          		28
		debug {
			disableAllBreakpoints		1
			animation            		[1 0.2]
		}
		sfVersion            		62014000
	}

	chart {
		id                                        		2
		name                                      		"Controller"
		windowPosition                            		[419.25 77.25 516.75 370.5]
		viewLimits                                		[2.608 542.241 0 381.42]
		zoomFactor                                		1.14
		screen                                    		[1 1 1280 800 1.333333333333333]
		treeNode                                  		[0 6 0 0]
		firstTransition                           		12
		firstJunction                             		8
		viewObj                                   		2
		visible                                   		1
		machine                                   		1
		subviewS {
		}
		decomposition                             		CLUSTER_CHART
		firstEvent                                		22
		firstData                                 		25
		chartFileNumber                           		1
		disableImplicitCasting                    		1
	}

	state {
		id                           		3
		labelString                  		"off\n"
						"en:speed=0;"
		position                     		[251.7442 190.125 97.2558 54.6915]
		fontSize                     		12
		chart                        		2
		treeNode                     		[2 0 4 5]
		subviewer                    		2
		type                         		OR_STATE
		decomposition                		CLUSTER_STATE
		eml {
			fimathString    		"fimath(...\n"
								"'RoundMode', 'floor',...\n"
								"'OverflowMode', 'wrap',...\n"
								"'ProductMode', 'KeepLSB', 'ProductWordLength', 32,..."
								"\n"
								"'SumMode', 'KeepLSB', 'SumWordLength', 32,...\n"
								"'CastBeforeSum', false)"
			treatIntsAsFixpt		0
		}
	}

	state {
		id                           		4
		labelString                  		"Hi\n"
						"en:speed=2;"
		position                     		[17.4737 70.18 95.3843 50.8812]
		fontSize                     		12
		chart                        		2
		treeNode                     		[2 0 6 3]
		subviewer                    		2
		type                         		OR_STATE
		decomposition                		CLUSTER_STATE
		eml {
			fimathString    		"fimath(...\n"
								"'RoundMode', 'floor',...\n"
								"'OverflowMode', 'wrap',...\n"
								"'ProductMode', 'KeepLSB', 'ProductWordLength', 32,..."
								"\n"
								"'SumMode', 'KeepLSB', 'SumWordLength', 32,...\n"
								"'CastBeforeSum', false)"
			treatIntsAsFixpt		0
		}
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -