Andy Bartlett <
an...@mathworks.com> wrote in message <hbpv7p$7nt$
1...@fred.mathworks.com>...
> This is a multi-part message in MIME format.
> --------------090406010604080202000601
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> --------------090406010604080202000601
> Content-Type: text/plain;
> name="test_negative_saturation.mdl"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
> filename="test_negative_saturation.mdl"
>
> Model {
> Name "test_negative_saturation"
> Version 7.3
> MdlSubVersion 0
> GraphicalInterface {
> NumRootInports 0
> NumRootOutports 0
> ParameterArgumentNames ""
> ComputedModelVersion "1.102"
> NumModelReferences 0
> NumTestPointedSignals 0
> }
> Description "Double to Fixed-Point Conversion\n\nThis model shows how to convert signals between built-in and\nfi"
> "xed-point data types and illustrates how fixed-point data types\naffect the representable precision and range. The "
> "fixed-point\ndata type used in this model is fixdt(1,5,2), which is a signed\n5-bit number with 2 bits to the right "
> "of the binary point:\n\n Precision = (2^-2) = 0.25\n Representable minimum = -(2^-2)*(2^4) = -4\n Representa"
> "ble maximum = (2^-2)*(2^4-1) = 3.75\n\nOpen the Data Type Conversion block 'Dbl-to-FixPt' to modify the\nattributes"
> " of the fixed-point data type and see how they impact the\nrange and precision of the resulting fixed-point signal.\n"
> "\nTips for specifying fixed-point data types:\n\n\n* Click the |>>| button to open the Data Type Assistant.\n* You c"
> "an specify the output minimum/maximum and use these\nvalues to calculate the \"best-precision scaling\", which\nmaxi"
> "mizes the precision while covering the specified range.\n* Once you are familiar with the syntax for fixdt, you can "
> "enter\nthe expression directly into the data type parameter without\nusing the Data Type Assistant.\n"
> SavedCharacterEncoding "US-ASCII"
> SaveDefaultBlockParams on
> ScopeRefreshTime 0.035000
> OverrideScopeRefreshTime on
> DisableAllScopes off
> DataTypeOverride "ForceOff"
> MinMaxOverflowLogging "MinMaxAndOverflow"
> MinMaxOverflowArchiveMode "Overwrite"
> Created "Fri Jun 19 12:41:37 1998"
> Creator "The MathWorks Inc."
> UpdateHistory "UpdateHistoryNever"
> ModifiedByFormat "%<Auto>"
> LastModifiedBy "andyb"
> ModifiedDateFormat "%<Auto>"
> LastModifiedDate "Thu Oct 22 10:56:41 2009"
> RTWModifiedTimeStamp 178109792
> ModelVersionFormat "1.%<AutoIncrement:102>"
> ConfigurationManager "none"
> SampleTimeColors off
> SampleTimeAnnotations off
> LibraryLinkDisplay "none"
> WideLines on
> ShowLineDimensions off
> ShowPortDataTypes on
> ShowLoopsOnError on
> IgnoreBidirectionalLines off
> ShowStorageClass off
> ShowTestPointIcons on
> ShowSignalResolutionIcons on
> ShowViewerIcons on
> SortedOrder off
> ExecutionContextIcon off
> ShowLinearizationAnnotations on
> BlockNameDataTip off
> BlockParametersDataTip on
> BlockDescriptionStringDataTip off
> ToolBar on
> StatusBar on
> BrowserShowLibraryLinks off
> BrowserLookUnderMasks off
> SimulationMode "normal"
> LinearizationMsg "none"
> Profile off
> ParamWorkspaceSource "MATLABWorkspace"
> AccelSystemTargetFile "accel.tlc"
> AccelTemplateMakefile "accel_default_tmf"
> AccelMakeCommand "make_rtw"
> TryForcingSFcnDF off
> RecordCoverage off
> CovPath "/"
> CovSaveName "covdata"
> CovMetricSettings "d"
> CovNameIncrementing off
> CovHtmlReporting on
> covSaveCumulativeToWorkspaceVar on
> CovSaveSingleToWorkspaceVar on
> CovCumulativeVarName "covCumulativeData"
> CovCumulativeReport off
> CovReportOnPause on
> CovModelRefEnable "Off"
> CovExternalEMLEnable off
> ExtModeBatchMode off
> ExtModeEnableFloating on
> ExtModeTrigType "manual"
> ExtModeTrigMode "oneshot"
> ExtModeTrigPort "1"
> ExtModeTrigElement "any"
> ExtModeTrigDuration 1000
> ExtModeTrigDurationFloating "auto"
> ExtModeTrigHoldOff 0
> ExtModeTrigDelay 0
> ExtModeTrigDirection "rising"
> ExtModeTrigLevel 0
> ExtModeArchiveMode "off"
> ExtModeAutoIncOneShot off
> ExtModeIncDirWhenArm off
> ExtModeAddSuffixToVar off
> ExtModeWriteAllDataToWs off
> ExtModeArmWhenConnect off
> ExtModeSkipDownloadWhenConnect off
> ExtModeLogAll on
> ExtModeAutoUpdateStatusClock off
> BufferReuse on
> ShowModelReferenceBlockVersion off
> ShowModelReferenceBlockIO off
> Array {
> Type "Handle"
> Dimension 1
> Simulink.ConfigSet {
> $ObjectID 1
> Version "1.6.0"
> Array {
> Type "Handle"
> Dimension 8
> Simulink.SolverCC {
> $ObjectID 2
> Version "1.6.0"
> StartTime "0.0"
> StopTime "1"
> AbsTol "1e-6"
> FixedStep "0.001"
> InitialStep "auto"
> MaxNumMinSteps "-1"
> MaxOrder 5
> ZcThreshold "auto"
> ConsecutiveZCsStepRelTol "10*128*eps"
> MaxConsecutiveZCs "1000"
> ExtrapolationOrder 4
> NumberNewtonIterations 1
> MaxStep "auto"
> MinStep "auto"
> MaxConsecutiveMinStep "1"
> RelTol "1e-3"
> SolverMode "SingleTasking"
> Solver "FixedStepDiscrete"
> SolverName "FixedStepDiscrete"
> ShapePreserveControl "DisableAll"
> ZeroCrossControl "UseLocalSettings"
> ZeroCrossAlgorithm "Nonadaptive"
> AlgebraicLoopSolver "TrustRegion"
> SolverResetMethod "Fast"
> PositivePriorityOrder off
> AutoInsertRateTranBlk off
> SampleTimeConstraint "Unconstrained"
> InsertRTBMode "Whenever possible"
> SignalSizeVariationType "Allow only fixed size"
> }
> Simulink.DataIOCC {
> $ObjectID 3
> Version "1.6.0"
> Decimation "1"
> ExternalInput "[t, u]"
> FinalStateName "xFinal"
> InitialState "xInitial"
> LimitDataPoints off
> MaxDataPoints "1000"
> LoadExternalInput off
> LoadInitialState off
> SaveFinalState off
> SaveCompleteFinalSimState off
> SaveFormat "Array"
> SaveOutput on
> SaveState off
> SignalLogging on
> InspectSignalLogs off
> SaveTime on
> StateSaveName "xout"
> TimeSaveName "tout"
> OutputSaveName "yout"
> SignalLoggingName "sigsOut"
> OutputOption "RefineOutputTimes"
> OutputTimes "[]"
> Refine "1"
> }
> Simulink.OptimizationCC {
> $ObjectID 4
> Version "1.6.0"
> Array {
> Type "Cell"
> Dimension 4
> Cell "ZeroExternalMemoryAtStartup"
> Cell "ZeroInternalMemoryAtStartup"
> Cell "NoFixptDivByZeroProtection"
> Cell "OptimizeModelRefInitCode"
> PropName "DisabledProps"
> }
> BlockReduction on
> BooleanDataType off
> ConditionallyExecuteInputs on
> InlineParams off
> InlineInvariantSignals off
> OptimizeBlockIOStorage on
> BufferReuse on
> EnhancedBackFolding off
> StrengthReduction off
> EnforceIntegerDowncast on
> ExpressionFolding on
> EnableMemcpy on
> MemcpyThreshold 64
> PassReuseOutputArgsAs "Structure reference"
> ExpressionDepthLimit
2147483647> FoldNonRolledExpr on
> LocalBlockOutputs on
> RollThreshold 5
> SystemCodeInlineAuto off
> StateBitsets off
> DataBitsets off
> UseTempVars off
> ZeroExternalMemoryAtStartup on
> ZeroInternalMemoryAtStartup on
> InitFltsAndDblsToZero on
> NoFixptDivByZeroProtection off
> EfficientFloat2IntCast off
> EfficientMapNaN2IntZero on
> OptimizeModelRefInitCode off
> LifeSpan "inf"
> BufferReusableBoundary on
> SimCompilerOptimization "Off"
> AccelVerboseBuild off
> }
> Simulink.DebuggingCC {
> $ObjectID 5
> Version "1.6.0"
> RTPrefix "error"
> ConsistencyChecking "none"
> ArrayBoundsChecking "none"
> SignalInfNanChecking "none"
> SignalRangeChecking "error"
> ReadBeforeWriteMsg "UseLocalSettings"
> WriteAfterWriteMsg "UseLocalSettings"
> WriteAfterReadMsg "UseLocalSettings"
> AlgebraicLoopMsg "warning"
> ArtificialAlgebraicLoopMsg "warning"
> SaveWithDisabledLinksMsg "warning"
> SaveWithParameterizedLinksMsg "none"
> CheckSSInitialOutputMsg on
> UnderspecifiedInitializationDetection "Classic"
> MergeDetectMultiDrivingBlocksExec "none"
> CheckExecutionContextPreStartOutputMsg off
> CheckExecutionContextRuntimeOutputMsg off
> SignalResolutionControl "TryResolveAllWithWarning"
> BlockPriorityViolationMsg "warning"
> MinStepSizeMsg "warning"
> TimeAdjustmentMsg "none"
> MaxConsecutiveZCsMsg "error"
> SolverPrmCheckMsg "none"
> InheritedTsInSrcMsg "warning"
> DiscreteInheritContinuousMsg "warning"
> MultiTaskDSMMsg "warning"
> MultiTaskCondExecSysMsg "none"
> MultiTaskRateTransMsg "error"
> SingleTaskRateTransMsg "none"
> TasksWithSamePriorityMsg "warning"
> SigSpecEnsureSampleTimeMsg "none"
> CheckMatrixSingularityMsg "none"
> IntegerOverflowMsg "none"
> Int32ToFloatConvMsg "warning"
> ParameterDowncastMsg "warning"
> ParameterOverflowMsg "warning"
> ParameterUnderflowMsg "none"
> ParameterPrecisionLossMsg "none"
> ParameterTunabilityLossMsg "warning"
> UnderSpecifiedDataTypeMsg "none"
> UnnecessaryDatatypeConvMsg "none"
> VectorMatrixConversionMsg "none"
> InvalidFcnCallConnMsg "error"
> FcnCallInpInsideContextMsg "Use local settings"
> SignalLabelMismatchMsg "none"
> UnconnectedInputMsg "warning"
> UnconnectedOutputMsg "warning"
> UnconnectedLineMsg "warning"
> SFcnCompatibilityMsg "none"
> UniqueDataStoreMsg "none"
> BusObjectLabelMismatch "warning"
> RootOutportRequireBusObject "warning"
> AssertControl "UseLocalSettings"
> EnableOverflowDetection off
> ModelReferenceIOMsg "none"
> ModelReferenceVersionMismatchMessage "none"
> ModelReferenceIOMismatchMessage "none"
> ModelReferenceCSMismatchMessage "none"
> UnknownTsInhSupMsg "warning"
> ModelReferenceDataLoggingMessage "warning"
> ModelReferenceSymbolNameMessage "warning"
> ModelReferenceExtraNoncontSigs "error"
> StateNameClashWarn "warning"
> StrictBusMsg "None"
> LoggingUnavailableSignals "error"
> BlockIODiagnostic "none"
> }
> Simulink.HardwareCC {
> $ObjectID 6
> Version "1.6.0"
> ProdBitPerChar 8
> ProdBitPerShort 16
> ProdBitPerInt 32
> ProdBitPerLong 32
> ProdIntDivRoundTo "Undefined"
> ProdEndianess "Unspecified"
> ProdWordSize 32
> ProdShiftRightIntArith on
> ProdHWDeviceType "32-bit Generic"
> TargetBitPerChar 8
> TargetBitPerShort 16
> TargetBitPerInt 32
> TargetBitPerLong 32
> TargetShiftRightIntArith on
> TargetIntDivRoundTo "Undefined"
> TargetEndianess "Unspecified"
> TargetWordSize 32
> TargetTypeEmulationWarnSuppressLevel 0
> TargetPreprocMaxBitsSint 32
> TargetPreprocMaxBitsUint 32
> TargetHWDeviceType "Specified"
> TargetUnknown on
> ProdEqTarget on
> }
> Simulink.ModelReferenceCC {
> $ObjectID 7
> Version "1.6.0"
> UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
> CheckModelReferenceTargetMessage "error"
> ModelReferenceNumInstancesAllowed "Multi"
> ModelReferencePassRootInputsByReference on
> ModelReferenceMinAlgLoopOccurrences off
> }
> Simulink.SFSimCC {
> $ObjectID 8
> Version "1.6.0"
> SFSimEnableDebug on
> SFSimOverflowDetection on
> SFSimEcho on
> SimBlas on
> SimUseLocalCustomCode off
> SimBuildMode "sf_incremental_build"
> }
> Simulink.RTWCC {
> $BackupClass "Simulink.RTWCC"
> $ObjectID 9
> Version "1.6.0"
> Array {
> Type "Cell"
> Dimension 1
> Cell "IncludeHyperlinkInReport"
> PropName "DisabledProps"
> }
> SystemTargetFile "grt.tlc"
> GenCodeOnly off
> MakeCommand "make_rtw"
> GenerateMakefile on
> TemplateMakefile "grt_default_tmf"
> GenerateReport off
> SaveLog off
> RTWVerbose on
> RetainRTWFile off
> ProfileTLC off
> TLCDebug off
> TLCCoverage off
> TLCAssert off
> ProcessScriptMode "Default"
> ConfigurationMode "Optimized"
> ConfigAtBuild off
> RTWUseLocalCustomCode off
> RTWUseSimCustomCode off
> IncludeHyperlinkInReport off
> LaunchReport off
> TargetLang "C"
> IncludeBusHierarchyInRTWFileBlockHierarchyMap off
> IncludeERTFirstTime on
> GenerateTraceInfo off
> GenerateTraceReport off
> GenerateTraceReportSl off
> GenerateTraceReportSf off
> GenerateTraceReportEml off
> GenerateCodeInfo off
> RTWCompilerOptimization "Off"
> CheckMdlBeforeBuild "Off"
> Array {
> Type "Handle"
> Dimension 2
> Simulink.CodeAppCC {
> $ObjectID 10
> Version "1.6.0"
> Array {
> Type "Cell"
> Dimension 9
> Cell "IgnoreCustomStorageClasses"
> Cell "InsertBlockDesc"
> Cell "SFDataObjDesc"
> Cell "SimulinkDataObjDesc"
> Cell "DefineNamingRule"
> Cell "SignalNamingRule"
> Cell "ParamNamingRule"
> Cell "InlinedPrmAccess"
> Cell "CustomSymbolStr"
> PropName "DisabledProps"
> }
> ForceParamTrailComments off
> GenerateComments on
> IgnoreCustomStorageClasses on
> IgnoreTestpoints off
> IncHierarchyInIds off
> MaxIdLength 31
> PreserveName off
> PreserveNameWithParent off
> ShowEliminatedStatement off
> IncAutoGenComments off
> SimulinkDataObjDesc off
> SFDataObjDesc off
> IncDataTypeInIds off
> MangleLength 1
> CustomSymbolStrGlobalVar "$R$N$M"
> CustomSymbolStrType "$N$R$M"
> CustomSymbolStrField "$N$M"
> CustomSymbolStrFcn "$R$N$M$F"
> CustomSymbolStrBlkIO "rtb_$N$M"
> CustomSymbolStrTmpVar "$N$M"
> CustomSymbolStrMacro "$R$N$M"
> DefineNamingRule "None"
> ParamNamingRule "None"
> SignalNamingRule "None"
> InsertBlockDesc off
> SimulinkBlockComments on
> EnableCustomComments off
> InlinedPrmAccess "Literals"
> ReqsInCode off
> UseSimReservedNames off
> }
> Simulink.GRTTargetCC {
> $BackupClass "Simulink.TargetCC"
> $ObjectID 11
> Version "1.6.0"
> Array {
> Type "Cell"
> Dimension 12
> Cell "IncludeMdlTerminateFcn"
> Cell "CombineOutputUpdateFcns"
> Cell "SuppressErrorStatus"
> Cell "ERTCustomFileBanners"
> Cell "GenerateSampleERTMain"
> Cell "MultiInstanceERTCode"
> Cell "PurelyIntegerCode"
> Cell "SupportNonFinite"
> Cell "SupportComplex"
> Cell "SupportAbsoluteTime"
> Cell "SupportContinuousTime"
> Cell "SupportNonInlinedSFcns"
> PropName "DisabledProps"
> }
> TargetFcnLib "ansi_tfl_tmw.mat"
> TargetLibSuffix ""
> TargetPreCompLibLocation ""
> TargetFunctionLibrary "ANSI_C"
> UtilityFuncGeneration "Auto"
> ERTMultiwordTypeDef "System defined"
> ERTMultiwordLength 256
> MultiwordLength 2048
> GenerateFullHeader on
> GenerateSampleERTMain off
> GenerateTestInterfaces off
> IsPILTarget off
> ModelReferenceCompliant on
> ParMdlRefBuildCompliant on
> CompOptLevelCompliant on
> IncludeMdlTerminateFcn on
> CombineOutputUpdateFcns off
> SuppressErrorStatus off
> ERTFirstTimeCompliant off
> IncludeFileDelimiter "Auto"
> ERTCustomFileBanners off
> SupportAbsoluteTime on
> LogVarNameModifier "rt_"
> MatFileLogging on
> MultiInstanceERTCode off
> SupportNonFinite on
> SupportComplex on
> PurelyIntegerCode off
> SupportContinuousTime on
> SupportNonInlinedSFcns on
> EnableShiftOperators on
> ParenthesesLevel "Nominal"
> PortableWordSizes off
> ModelStepFunctionPrototypeControlCompliant off
> CPPClassGenCompliant off
> AutosarCompliant off
> UseMalloc off
> ExtMode off
> ExtModeStaticAlloc off
> ExtModeTesting off
> ExtModeStaticAllocSize 1000000
> ExtModeTransport 0
> ExtModeMexFile "ext_comm"
> ExtModeIntrfLevel "Level1"
> RTWCAPISignals off
> RTWCAPIParams off
> RTWCAPIStates off
> GenerateASAP2 off
> }
> PropName "Components"
> }
> }
> PropName "Components"
> }
> Name "Configuration"
> CurrentDlgPage "Solver"
> ConfigPrmDlgPosition " [ 200, 197, 1080, 827 ] "
> }
> PropName "ConfigurationSets"
> }
> Simulink.ConfigSet {
> $PropName "ActiveConfigurationSet"
> $ObjectID 1
> }
> BlockDefaults {
> ForegroundColor "black"
> BackgroundColor "white"
> DropShadow off
> NamePlacement "normal"
> FontName "Helvetica"
> FontSize 10
> FontWeight "normal"
> FontAngle "normal"
> ShowName on
> BlockRotation 0
> BlockMirror off
> }
> AnnotationDefaults {
> HorizontalAlignment "center"
> VerticalAlignment "middle"
> ForegroundColor "black"
> BackgroundColor "white"
> DropShadow off
> FontName "Helvetica"
> FontSize 10
> FontWeight "normal"
> FontAngle "normal"
> UseDisplayTextAsClickCallback off
> }
> LineDefaults {
> FontName "Helvetica"
> FontSize 9
> FontWeight "normal"
> FontAngle "normal"
> }
> BlockParameterDefaults {
> Block {
> BlockType Constant
> Value "1"
> VectorParams1D on
> SamplingMode "Sample based"
> OutMin "[]"
> OutMax "[]"
> OutDataTypeMode "Inherit from 'Constant value'"
> OutDataType "fixdt(1,16,0)"
> ConRadixGroup "Use specified scaling"
> OutScaling "[]"
> OutDataTypeStr "Inherit: Inherit from 'Constant value'"
> LockScale off
> SampleTime "inf"
> FramePeriod "inf"
> }
> Block {
> BlockType DataTypeConversion
> OutMin "[]"
> OutMax "[]"
> OutDataTypeMode "Inherit via back propagation"
> OutDataType "fixdt(1,16,0)"
> OutScaling "[]"
> OutDataTypeStr "Inherit: Inherit via back propagation"
> LockScale off
> ConvertRealWorld "Real World Value (RWV)"
> RndMeth "Zero"
> SaturateOnIntegerOverflow on
> SampleTime "-1"
> }
> Block {
> BlockType Display
> Format "short"
> Decimation "10"
> Floating off
> SampleTime "-1"
> }
> }
> System {
> Name "test_negative_saturation"
> Location [21, 82, 1064, 330]
> Open on
> ModelBrowserVisibility off
> ModelBrowserWidth 200
> ScreenColor "white"
> PaperOrientation "landscape"
> PaperPositionMode "auto"
> PaperType "usletter"
> PaperUnits "inches"
> TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
> TiledPageScale 1
> ShowPageBoundaries off
> ZoomFactor "100"
> ReportName "simulink-default.rpt"
> Block {
> BlockType Constant
> Name "Constant"
> Position [15, 32, 205, 68]
> AttributesFormatString "DT = %<OutDataTypeStr>"
> Value "[2;0.5;-2]"
> VectorParams1D off
> OutDataTypeMode "Specify via dialog"
> OutDataType "fixdt(1,48,39)"
> ConRadixGroup "Best Precision: Vector-wise"
> OutDataTypeStr "fixdt(1,48,39)"
> }
> Block {
> BlockType DataTypeConversion
> Name "Dbl-to-FixPt1"
> Position [640, 31, 685, 69]
> AttributesFormatString "DT = %<OutDataTypeStr>"
> OutDataTypeMode "Specify via dialog"
> OutDataType "fixdt(1,16,15)"
> OutDataTypeStr "fixdt(1,16,15)"
> RndMeth "Floor"
> }
> Block {
> BlockType Display
> Name "Display"
> Ports [1]
> Position [250, 59, 435, 131]
> Format "long"
> Decimation "1"
> Lockdown off
> }
> Block {
> BlockType Display
> Name "Display1"
> Ports [1]
> Position [250, 152, 685, 218]
> Format "binary (Stored Integer)"
> Decimation "1"
> Lockdown off
> }
> Block {
> BlockType Display
> Name "Display2"
> Ports [1]
> Position [795, 13, 980, 87]
> Format "long"
> Decimation "1"
> Lockdown off
> }
> Block {
> BlockType Display
> Name "Display3"
> Ports [1]
> Position [795, 151, 990, 219]
> Format "binary (Stored Integer)"
> Decimation "1"
> Lockdown off
> }
> Line {
> SrcBlock "Constant"
> SrcPort 1
> Points [20, 0]
> Branch {
> Points [0, 45]
> Branch {
> DstBlock "Display"
> DstPort 1
> }
> Branch {
> Points [0, 90]
> DstBlock "Display1"
> DstPort 1
> }
> }
> Branch {
> DstBlock "Dbl-to-FixPt1"
> DstPort 1
> }
> }
> Line {
> SrcBlock "Dbl-to-FixPt1"
> SrcPort 1
> Points [20, 0]
> Branch {
> Points [0, 135]
> DstBlock "Display3"
> DstPort 1
> }
> Branch {
> DstBlock "Display2"
> DstPort 1
> }
> }
> }
> }
>
> --------------090406010604080202000601--
Thanks for your detailed reply. Sorry about late acknowledgement.
> Perhaps the data types specified on your model don't agree with what was
> intended.
Yes, you are right. I had made an embarrassing mistake in my model.
Thanks a lot for your reply.