sonar.mdl

来自「simulink real-time workshop for dragon12」· MDL 代码 · 共 385 行

MDL
385
字号
Model {
  Name			  "Sonar"
  Version		  5.1
  SaveDefaultBlockParams  on
  SampleTimeColors	  on
  LibraryLinkDisplay	  "none"
  WideLines		  on
  ShowLineDimensions	  off
  ShowPortDataTypes	  off
  ShowLoopsOnError	  on
  IgnoreBidirectionalLines off
  ShowStorageClass	  off
  SortedOrder		  off
  RecordCoverage	  off
  CovPath		  "/"
  CovSaveName		  "covdata"
  CovMetricSettings	  "dw"
  CovNameIncrementing	  off
  CovHtmlReporting	  on
  covSaveCumulativeToWorkspaceVar on
  CovSaveSingleToWorkspaceVar on
  CovCumulativeVarName	  "covCumulativeData"
  CovCumulativeReport	  off
  DataTypeOverride	  "UseLocalSettings"
  MinMaxOverflowLogging	  "UseLocalSettings"
  MinMaxOverflowArchiveMode "Overwrite"
  BlockNameDataTip	  off
  BlockParametersDataTip  off
  BlockDescriptionStringDataTip	off
  ToolBar		  on
  StatusBar		  on
  BrowserShowLibraryLinks off
  BrowserLookUnderMasks	  on
  CloseFcn		  "rtwprivate ssgencode ModelCloseRequest MC_AD"
  Created		  "Wed Jun 13 23:02:07 2001"
  UpdateHistory		  "UpdateHistoryNever"
  ModifiedByFormat	  "%<Auto>"
  LastModifiedBy	  "fwornle"
  ModifiedDateFormat	  "%<Auto>"
  LastModifiedDate	  "Sat Sep 23 16:11:59 2006"
  ModelVersionFormat	  "1.%<AutoIncrement:306>"
  ConfigurationManager	  "none"
  SimParamPage		  "RTW"
  LinearizationMsg	  "none"
  Profile		  off
  ParamWorkspaceSource	  "MATLABWorkspace"
  AccelSystemTargetFile	  "accel.tlc"
  AccelTemplateMakefile	  "accel_default_tmf"
  AccelMakeCommand	  "make_rtw"
  TryForcingSFcnDF	  off
  ExtModeMexFile	  "ext_comm_mc9S12"
  ExtModeMexArgs	  "2, 0, 115200"
  ExtModeBatchMode	  off
  ExtModeTrigType	  "manual"
  ExtModeTrigMode	  "normal"
  ExtModeTrigPort	  "1"
  ExtModeTrigElement	  "any"
  ExtModeTrigDuration	  1000
  ExtModeTrigHoldOff	  0
  ExtModeTrigDelay	  0
  ExtModeTrigDirection	  "rising"
  ExtModeTrigLevel	  0
  ExtModeArchiveMode	  "off"
  ExtModeAutoIncOneShot	  off
  ExtModeIncDirWhenArm	  off
  ExtModeAddSuffixToVar	  off
  ExtModeWriteAllDataToWs off
  ExtModeArmWhenConnect	  on
  ExtModeSkipDownloadWhenConnect off
  ExtModeLogAll		  on
  ExtModeAutoUpdateStatusClock on
  BufferReuse		  on
  RTWExpressionDepthLimit 5
  SimulationMode	  "external"
  Solver		  "ode1"
  SolverMode		  "SingleTasking"
  StartTime		  "0.0"
  StopTime		  "99999"
  MaxOrder		  5
  MaxStep		  "0.02"
  MinStep		  "auto"
  MaxNumMinSteps	  "-1"
  InitialStep		  "auto"
  FixedStep		  "0.002"
  RelTol		  "1e-3"
  AbsTol		  "1e-6"
  OutputOption		  "RefineOutputTimes"
  OutputTimes		  "[]"
  Refine		  "1"
  LoadExternalInput	  off
  ExternalInput		  "[t, u]"
  LoadInitialState	  off
  InitialState		  "xInitial"
  SaveTime		  off
  TimeSaveName		  "tout"
  SaveState		  off
  StateSaveName		  "xout"
  SaveOutput		  off
  OutputSaveName	  "yout"
  SaveFinalState	  off
  FinalStateName	  "xFinal"
  SaveFormat		  "Array"
  Decimation		  "1"
  LimitDataPoints	  off
  MaxDataPoints		  "1000"
  SignalLoggingName	  "sigsOut"
  ConsistencyChecking	  "none"
  ArrayBoundsChecking	  "none"
  AlgebraicLoopMsg	  "warning"
  BlockPriorityViolationMsg "warning"
  MinStepSizeMsg	  "warning"
  InheritedTsInSrcMsg	  "warning"
  DiscreteInheritContinuousMsg "warning"
  MultiTaskRateTransMsg	  "error"
  SingleTaskRateTransMsg  "none"
  CheckForMatrixSingularity "none"
  IntegerOverflowMsg	  "warning"
  Int32ToFloatConvMsg	  "warning"
  ParameterDowncastMsg	  "error"
  ParameterOverflowMsg	  "error"
  ParameterPrecisionLossMsg "warning"
  UnderSpecifiedDataTypeMsg "none"
  UnnecessaryDatatypeConvMsg "none"
  VectorMatrixConversionMsg "none"
  InvalidFcnCallConnMsg	  "error"
  SignalLabelMismatchMsg  "none"
  UnconnectedInputMsg	  "warning"
  UnconnectedOutputMsg	  "warning"
  UnconnectedLineMsg	  "warning"
  SfunCompatibilityCheckMsg "none"
  RTWInlineParameters	  off
  BlockReductionOpt	  off
  BooleanDataType	  off
  ConditionallyExecuteInputs on
  ParameterPooling	  on
  OptimizeBlockIOStorage  on
  ZeroCross		  on
  AssertionControl	  "UseLocalSettings"
  ProdHWDeviceType	  "Microprocessor"
  ProdHWWordLengths	  "8,16,32,32"
  RTWSystemTargetFile	  "mc9S12.tlc"
  RTWTemplateMakefile	  "mc9S12.tmf"
  RTWMakeCommand	  "make_mc9S12"
  RTWGenerateCodeOnly	  off
  RTWRetainRTWFile	  off
  TLCProfiler		  off
  TLCDebug		  off
  TLCCoverage		  off
  TLCAssertion		  off
  RTWOptions		  " -aCore_time=\"RTI\" -aCycTI_pin=5 -aDebug2SCI0=0 -"
"aEnforceIntegerDowncast=1 -aExtMode=1 -aExtModeTesting=0 -aFoldNonRolledExpr="
"1 -aForceParamTrailComments=0 -aGenerateComments=1 -aGenerateReport=0 -aHasFu"
"zzyBlocks=0 -aHasRFComms=0 -aHasTimers=\"0x00000000\" -aIgnoreCustomStorageCl"
"asses=1 -aIncDataTypeInIds=0 -aIncHierarchyInIds=0 -aInlineInvariantSignals=0"
" -aInlineParameters=0 -aInlinedPrmAccess=\"Literals\" -aLCDdispErrors=0 -aLoc"
"alBlockOutputs=1 -aLogVarNameModifier=\"rt_\" -aMATLAB_comms_port=\"SCI1\" -a"
"MaxRTWIdLen=31 -aMem_Map=\"Flash_flat\" -aNumFreePortSCI0=0 -aNumFreePortSCI1"
"=0 -aPrefixModelToSubsysFcnNames=1 -aPurelyIntegerCode=0 -aRFCommsServerChann"
"els=1 -aRTWVerbose=1 -aRollThreshold=5 -aRun_Immediately=1 -aSCI0=\"idle\" -a"
"SCI1=\"MCOM\" -aSerTI_pin=6 -aShowEliminatedStatements=1 -aStaticLibraryRebui"
"ld=0 -aTarget_board=\"UofA-Mobile-Robot\" -aTimerBasePeriod=0 -aTimerPrescale"
"r=0 -aTimerPrescalerMask=0 -aTiming_signals=0 -abaudrate=115200 -aport=\"COM2"
"\" -atimeport=\"PORTB\""
  BlockDefaults {
    Orientation		    "right"
    ForegroundColor	    "black"
    BackgroundColor	    "white"
    DropShadow		    off
    NamePlacement	    "normal"
    FontName		    "Helvetica"
    FontSize		    10
    FontWeight		    "normal"
    FontAngle		    "normal"
    ShowName		    on
  }
  BlockParameterDefaults {
    Block {
      BlockType		      Display
      Format		      "short"
      Decimation	      "10"
      Floating		      off
    }
    Block {
      BlockType		      Gain
      Gain		      "1"
      Multiplication	      "Element-wise(K.*u)"
      ShowAdditionalParam     off
      ParameterDataTypeMode   "Same as input"
      ParameterDataType	      "sfix(16)"
      ParameterScalingMode    "Best Precision: Matrix-wise"
      ParameterScaling	      "2^0"
      OutDataTypeMode	      "Same as input"
      OutDataType	      "sfix(16)"
      OutScaling	      "2^0"
      LockScale		      off
      RndMeth		      "Floor"
      SaturateOnIntegerOverflow	on
    }
    Block {
      BlockType		      Outport
      Port		      "1"
      OutputWhenDisabled      "held"
      InitialOutput	      "[]"
    }
    Block {
      BlockType		      "S-Function"
      FunctionName	      "system"
      PortCounts	      "[]"
      SFunctionModules	      "''"
    }
    Block {
      BlockType		      SubSystem
      ShowPortLabels	      on
      Permissions	      "ReadWrite"
      RTWSystemCode	      "Auto"
      RTWFcnNameOpts	      "Auto"
      RTWFileNameOpts	      "Auto"
      SimViewingDevice	      off
      DataTypeOverride	      "UseLocalSettings"
      MinMaxOverflowLogging   "UseLocalSettings"
    }
    Block {
      BlockType		      ZeroOrderHold
    }
  }
  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		    "Sonar"
    Location		    [371, 193, 1019, 355]
    Open		    on
    ModelBrowserVisibility  off
    ModelBrowserWidth	    212
    ScreenColor		    "white"
    PaperOrientation	    "landscape"
    PaperPositionMode	    "auto"
    PaperType		    "usletter"
    PaperUnits		    "inches"
    ZoomFactor		    "100"
    ReportName		    "simulink-default.rpt"
    Block {
      BlockType		      ZeroOrderHold
      Name		      "0.2 s"
      Position		      [265, 61, 300, 99]
      SampleTime	      "0.2"
    }
    Block {
      BlockType		      Display
      Name		      "Distance (m)"
      Ports		      [1]
      Position		      [450, 68, 535, 92]
      Decimation	      "1"
    }
    Block {
      BlockType		      SubSystem
      Name		      "Sonar"
      Ports		      [0, 1]
      Position		      [70, 40, 210, 120]
      List {
	ListType		RTWdata
	portStr			"PORTA"
	ddrStr			"DDRA"
	pinStr			"6"
      }
      FontSize		      12
      ShowPortLabels	      off
      TreatAsAtomicUnit	      off
      MaskPromptString	      "Output Port (see hardware manuals for valid opt"
"ions)|Ouput Pin (see hardware manuals for valid options)|Input Port (see hard"
"ware manuals for valid options)|Input Pin (see hardware manuals for valid opt"
"ions)|Sample time"
      MaskStyleString	      "popup(Port A|Port B|Port H|Port J|Port M|Port P"
"|Port S|Port T),popup(0|1|2|3|4|5|6|7),popup(Port A|Port B|Port H|Port J|Port"
" M|Port P|Port S|Port T),popup(0|1|2|3|4|5|6|7),edit"
      MaskTunableValueString  "off,off,off,off,off"
      MaskCallbackString      "||||"
      MaskEnableString	      "on,on,on,on,on"
      MaskVisibilityString    "on,on,on,on,on"
      MaskToolTipString	      "on,on,on,on,on"
      MaskVarAliasString      ",,,,"
      MaskVariables	      "out_port=@1;out_pin=@2;in_port=@3;in_pin=@4;sam"
"pletime=@5;"
      MaskInitialization      "[out_portstr, out_pinstr, in_portstr, in_pinstr"
"] = mbc_sonar(out_port, out_pin, in_port, in_pin, sampletime);"
      MaskDisplay	      "fprintf('Output\\n%s Pin %s\\nInput\\n%s Pin %s"
"', out_portstr, out_pinstr, in_portstr, in_pinstr)"
      MaskSelfModifiable      on
      MaskIconFrame	      on
      MaskIconOpaque	      on
      MaskIconRotate	      "none"
      MaskIconUnits	      "autoscale"
      MaskValueString	      "Port T|0|Port T|1|0.02"
      System {
	Name			"Sonar"
	Location		[262, 81, 719, 287]
	Open			off
	ModelBrowserVisibility	off
	ModelBrowserWidth	200
	ScreenColor		"white"
	PaperOrientation	"landscape"
	PaperPositionMode	"auto"
	PaperType		"A4"
	PaperUnits		"centimeters"
	ZoomFactor		"100"
	Block {
	  BlockType		  "S-Function"
	  Name			  "sonar pulse"
	  Tag			  "MC9S12target"
	  Ports			  [0, 1]
	  Position		  [40, 91, 165, 129]
	  List {
	    ListType		    RTWdata
	    out_portStr		    "PTT"
	    out_ddrStr		    "DDRT"
	    out_pinMask		    "1"
	    out_pinStr		    "0"
	    in_portStr		    "PTT"
	    in_ddrStr		    "DDRT"
	    in_pinMask		    "2"
	    in_pinStr		    "1"
	  }
	  FontSize		  12
	  FunctionName		  "sonar_sfcn_9S12"
	  Parameters		  "sampletime, out_port, out_pin, in_port, in_"
"pin"
	  MaskIconFrame		  on
	  MaskIconOpaque	  on
	  MaskIconRotate	  "none"
	  MaskIconUnits		  "autoscale"
	}
	Block {
	  BlockType		  Outport
	  Name			  "Out1"
	  Position		  [340, 101, 360, 119]
	}
	Line {
	  SrcBlock		  "sonar pulse"
	  SrcPort		  1
	  DstBlock		  "Out1"
	  DstPort		  1
	}
      }
    }
    Block {
      BlockType		      Gain
      Name		      "calibrate"
      Position		      [365, 65, 395, 95]
      Gain		      "1/9000"
    }
    Line {
      SrcBlock		      "Sonar"
      SrcPort		      1
      DstBlock		      "0.2 s"
      DstPort		      1
    }
    Line {
      SrcBlock		      "calibrate"
      SrcPort		      1
      DstBlock		      "Distance (m)"
      DstPort		      1
    }
    Line {
      SrcBlock		      "0.2 s"
      SrcPort		      1
      DstBlock		      "calibrate"
      DstPort		      1
    }
  }
}

⌨️ 快捷键说明

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