Model { Name CAN Version 6.4 MdlSubVersion 0 GraphicalInterface { NumRootInports 0 NumRootOutports 0 ParameterArgumentNames "" ComputedModelVersion "1.99" NumModelReferences 0 NumTestPointedSignals 0 } SavedCharacterEncoding "windows-949" SaveDefaultBlockParams on ScopeRefreshTime 0.035000 OverrideScopeRefreshTime on DisableAllScopes off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" MinMaxOverflowArchiveMode "Overwrite" Created "Thu Sep 27 23:57:03 2007" Creator "just4you" UpdateHistory "UpdateHistoryNever" ModifiedByFormat "%" LastModifiedBy "Administrateur" ModifiedDateFormat "%" LastModifiedDate "Thu May 21 00:32:54 2009" ModelVersionFormat "1.%" ConfigurationManager "None" SampleTimeColors on LibraryLinkDisplay "none" WideLines off ShowLineDimensions on ShowPortDataTypes on ShowLoopsOnError on IgnoreBidirectionalLines off ShowStorageClass off ShowTestPointIcons on ShowViewerIcons on SortedOrder off ExecutionContextIcon off ShowLinearizationAnnotations on BlockNameDataTip off BlockParametersDataTip off BlockDescriptionStringDataTip off ToolBar on StatusBar on BrowserShowLibraryLinks off BrowserLookUnderMasks off LinearizationMsg "none" Profile off ParamWorkspaceSource "MATLABWorkspace" AccelSystemTargetFile "accel.tlc" AccelTemplateMakefile "accel_default_tmf" AccelMakeCommand "make_rtw" TryForcingSFcnDF off RecordCoverage off CovPath "/" CovSaveName "covdata" CovMetricSettings "dw" CovNameIncrementing off CovHtmlReporting on covSaveCumulativeToWorkspaceVar on CovSaveSingleToWorkspaceVar on CovCumulativeVarName "covCumulativeData" CovCumulativeReport off CovReportOnPause on ExtModeBatchMode off ExtModeEnableFloating on ExtModeTrigType "manual" ExtModeTrigMode "normal" 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 on ExtModeSkipDownloadWhenConnect off ExtModeLogAll on ExtModeAutoUpdateStatusClock on BufferReuse on ShowModelReferenceBlockVersion off ShowModelReferenceBlockIO off Array { Type "Handle" Dimension 1 Simulink.ConfigSet { $ObjectID 1 Version "1.2.0" Array { Type "Handle" Dimension 8 Simulink.SolverCC { $ObjectID 2 Version "1.2.0" StartTime "0.0" StopTime "inf" AbsTol "auto" FixedStep "0.001" InitialStep "auto" MaxNumMinSteps "-1" MaxOrder 5 ConsecutiveZCsStepRelTol "10*128*eps" MaxConsecutiveZCs "1000" ExtrapolationOrder 4 NumberNewtonIterations 1 MaxStep "auto" MinStep "auto" MaxConsecutiveMinStep "1" RelTol "1e-3" SolverMode "Auto" Solver "FixedStepDiscrete" SolverName "FixedStepDiscrete" ZeroCrossControl "UseLocalSettings" AlgebraicLoopSolver "TrustRegion" SolverResetMethod "Fast" PositivePriorityOrder off AutoInsertRateTranBlk off SampleTimeConstraint "Unconstrained" RateTranMode "Deterministic" } Simulink.DataIOCC { $ObjectID 3 Version "1.2.0" Decimation "1" ExternalInput "[t, u]" FinalStateName "xFinal" InitialState "xInitial" LimitDataPoints on MaxDataPoints "1000" LoadExternalInput off LoadInitialState off SaveFinalState off SaveFormat "Array" SaveOutput on SaveState off SignalLogging on InspectSignalLogs off SaveTime on StateSaveName "xout" TimeSaveName "tout" OutputSaveName "yout" SignalLoggingName "logsout" OutputOption "RefineOutputTimes" OutputTimes "[]" Refine "1" } Simulink.OptimizationCC { $ObjectID 4 Version "1.2.0" BlockReduction on BooleanDataType on ConditionallyExecuteInputs on InlineParams on InlineInvariantSignals off OptimizeBlockIOStorage on BufferReuse on EnforceIntegerDowncast on ExpressionFolding on FoldNonRolledExpr on LocalBlockOutputs on RollThreshold 5 SystemCodeInlineAuto off StateBitsets off DataBitsets off UseTempVars off ZeroExternalMemoryAtStartup on ZeroInternalMemoryAtStartup on InitFltsAndDblsToZero on NoFixptDivByZeroProtection off EfficientFloat2IntCast off OptimizeModelRefInitCode on LifeSpan "1" BufferReusableBoundary on } Simulink.DebuggingCC { $ObjectID 5 Version "1.2.0" RTPrefix "error" ConsistencyChecking "none" ArrayBoundsChecking "none" SignalInfNanChecking "none" ReadBeforeWriteMsg "UseLocalSettings" WriteAfterWriteMsg "UseLocalSettings" WriteAfterReadMsg "UseLocalSettings" AlgebraicLoopMsg "warning" ArtificialAlgebraicLoopMsg "warning" CheckSSInitialOutputMsg on CheckExecutionContextPreStartOutputMsg off CheckExecutionContextRuntimeOutputMsg off SignalResolutionControl "UseLocalSettings" BlockPriorityViolationMsg "warning" MinStepSizeMsg "warning" TimeAdjustmentMsg "none" MaxConsecutiveZCsMsg "error" SolverPrmCheckMsg "warning" InheritedTsInSrcMsg "warning" DiscreteInheritContinuousMsg "warning" MultiTaskDSMMsg "warning" MultiTaskCondExecSysMsg "none" MultiTaskRateTransMsg "error" SingleTaskRateTransMsg "none" TasksWithSamePriorityMsg "warning" SigSpecEnsureSampleTimeMsg "warning" CheckMatrixSingularityMsg "none" IntegerOverflowMsg "warning" Int32ToFloatConvMsg "warning" ParameterDowncastMsg "error" ParameterOverflowMsg "error" ParameterUnderflowMsg "none" ParameterPrecisionLossMsg "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" StrictBusMsg "None" ModelReferenceSimTargetVerbose off } Simulink.HardwareCC { $ObjectID 6 Version "1.2.0" Array { Type "Cell" Dimension 2 Cell "ProdHWDeviceType" Cell "ProdEqTarget" PropName "DisabledProps" } ProdBitPerChar 8 ProdBitPerShort 16 ProdBitPerInt 16 ProdBitPerLong 32 ProdIntDivRoundTo "Undefined" ProdEndianess "LittleEndian" ProdWordSize 16 ProdShiftRightIntArith on ProdHWDeviceType "16-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 "32-bit Generic" TargetUnknown off ProdEqTarget on } Simulink.ModelReferenceCC { $ObjectID 7 Version "1.2.0" UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" CheckModelReferenceTargetMessage "error" ModelReferenceNumInstancesAllowed "Multi" ModelReferencePassRootInputsByReference on ModelReferenceMinAlgLoopOccurrences off } Simulink.RTWCC { $BackupClass "Simulink.RTWCC" $ObjectID 9 Version "1.2.0" Array { Type "Cell" Dimension 1 Cell "TargetLang" PropName "DisabledProps" } SystemTargetFile "dspic.tlc" GenCodeOnly off MakeCommand "make_rtw" GenerateMakefile on TemplateMakefile "dspic_pic30_gcc.tmf" PostCodeGenCommand "dsPIC_Compile()" Description "Embedded Target for Microchip dsPIC (real-time)" GenerateReport on SaveLog off RTWVerbose on RetainRTWFile off ProfileTLC off TLCDebug off TLCCoverage off TLCAssert off ProcessScriptMode "Default" ConfigurationMode "Optimized" ProcessScript "dspic_make_rtw_hook" ConfigAtBuild off IncludeHyperlinkInReport on LaunchReport on TargetLang "C" IncludeBusHierarchyInRTWFileBlockHierarchyMap off IncludeERTFirstTime off Array { Type "Handle" Dimension 2 Simulink.CodeAppCC { $ObjectID 10 Version "1.2.0" ForceParamTrailComments off GenerateComments on IgnoreCustomStorageClasses 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 } Simulink.STFCustomTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 11 Version "1.2.0" Array { Type "Cell" Dimension 5 Cell "GenerateSampleERTMain" Cell "MatFileLogging" Cell "SupportNonInlinedSFcns" Cell "UtilityFuncGeneration" Cell "IncludeMdlTerminateFcn" PropName "DisabledProps" } TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant off ParMdlRefBuildCompliant off CompOptLevelCompliant off IncludeMdlTerminateFcn off CombineOutputUpdateFcns on SuppressErrorStatus on IncludeFileDelimiter "Auto" ERTCustomFileBanners on SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging off MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime off SupportNonInlinedSFcns off EnableShiftOperators on ParenthesesLevel "Nominal" PortableWordSizes off ModelStepFunctionPrototypeControlCompliant off AutosarCompliant off SystemTargetFile "dspic.tlc" DialogCategory 0 Array { Type "Handle" Dimension 1 Simulink.ERTTargetCC { $BackupClass "Simulink.TargetCC" $ObjectID 12 Version "1.6.0" Array { Type "Cell" Dimension 8 Cell "GenerateSampleERTMain" Cell "GenerateErtSFunction" Cell "MatFileLogging" Cell "GRTInterface" Cell "ERTCustomFileTemplate" Cell "SupportNonInlinedSFcns" Cell "UtilityFuncGeneration" Cell "IncludeMdlTerminateFcn" PropName "DisabledProps" } TargetFcnLib "ansi_tfl_tmw.mat" TargetLibSuffix "" TargetPreCompLibLocation "" GenFloatMathFcnCalls "ANSI_C" UtilityFuncGeneration "Auto" GenerateFullHeader on GenerateSampleERTMain off GenerateTestInterfaces off IsPILTarget off ModelReferenceCompliant off ParMdlRefBuildCompliant off CompOptLevelCompliant off IncludeMdlTerminateFcn off CombineOutputUpdateFcns on SuppressErrorStatus on IncludeFileDelimiter "Auto" ERTCustomFileBanners on SupportAbsoluteTime on LogVarNameModifier "rt_" MatFileLogging off MultiInstanceERTCode off SupportNonFinite on SupportComplex on PurelyIntegerCode off SupportContinuousTime off SupportNonInlinedSFcns off EnableShiftOperators on ParenthesesLevel "Nominal" PortableWordSizes off ModelStepFunctionPrototypeControlCompliant off AutosarCompliant off GenerateErtSFunction off GenerateASAP2 off ExtMode off ExtModeTransport 0 ExtModeStaticAlloc off ExtModeStaticAllocSize 1000000 ExtModeTesting off ExtModeMexFile "ext_comm" ExtModeIntrfLevel "Level1" InlinedParameterPlacement "NonHierarchical" TargetOS "BareBoardExample" MultiInstanceErrorCode "Error" RateGroupingCode on RootIOFormat "Individual arguments" RTWCAPISignals off RTWCAPIParams off RTWCAPIStates off ERTSrcFileBannerTemplate "dsPIC_code_template.cgt" ERTHdrFileBannerTemplate "dsPIC_code_template.cgt" ERTDataSrcFileTemplate "dsPIC_code_template.cgt" ERTDataHdrFileTemplate "dsPIC_code_template.cgt" ERTCustomFileTemplate "dsPIC_main.tlc" ModuleNamingRule "Unspecified" SignalDisplayLevel 10 ParamTuneLevel 10 GlobalDataDefinition "Auto" DataDefinitionFile "global.c" GlobalDataReference "Auto" DataReferenceFile "global.h" GRTInterface off PreserveExpressionOrder off PreserveIfCondition off EnableUserReplacementTypes off Array { Type "Struct" Dimension 1 MATStruct { double "" single "" int32 "" int16 "" int8 "" uint32 "" uint16 "" uint8 "" boolean "" int "" uint "" char "" } PropName "ReplacementTypes" } MemSecPackage "--- None ---" MemSecDataConstants "Default" MemSecDataIO "Default" MemSecDataInternal "Default" MemSecDataParameters "Default" MemSecFuncInitTerm "Default" MemSecFuncExecute "Default" } PropName "Components" } CustomProperty { DataType "string" Name "GMAKE_PLACE" Value "C:\\PROGRA~1\\MATLAB\\R2009a\\bin\\win32\\gmake" } CustomProperty { DataType "string" Name "OPTIM_GCC" Value "-mcpu=30f4012 -O3 -fschedule-insns -fschedule-insns2" } CustomProperty { DataType "string" Name "LDFLAGS" Value "-t --report-mem -Map ../untitled.map --heap 0 -cref" } CustomProperty { DataType "string" Name "LDPICTYPE" Value "-T C:\\PROGRA~1\\MICROC~1\\MPLABC~2\\support\\dsPIC30F\\gld\\p30f4012.gld" } CustomProperty { DataType "string" Name "LDLIBPIC" Value "C:\\PROGRA~1\\MICROC~1\\MPLABC~2\\lib\\libpic30-coff.a C:\\PROGRA~1\\MICROC~1\\MPLABC~2\\lib\\dsPIC30F\\li" "bp30f4012-coff.a C:\\PROGRA~1\\MICROC~1\\MPLABC~2\\lib\\libc-coff.a C:\\PROGRA~1\\MICROC~1\\MPLABC~2\\lib\\libm-coff" ".a" } CustomProperty { DataType "string" Name "PIC_INCLUDES" Value "-I C:\\PROGRA~1\\MICROC~1\\MPLABC~2\\include" } CustomProperty { DataType "string" Name "PIC_REF" Value "30f4012" } CustomProperty { DataType "string" Name "GCCPATH" Value "''" } } PropName "Components" } } PropName "Components" } Name "Configuration" ExtraOptions "-aGenerateTraceInfo=1 -aIgnoreTestpoints=0 " CurrentDlgPage "Real-Time Workshop" SimulationMode "normal" } PropName "ConfigurationSets" } Simulink.ConfigSet { $PropName "ActiveConfigurationSet" $ObjectID 1 } BlockDefaults { ForegroundColor "black" BackgroundColor "white" DropShadow off NamePlacement "normal" FontName "Arial" FontSize 10 FontWeight "normal" FontAngle "normal" ShowName on Orientation "right" } 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" } BlockParameterDefaults { Block { BlockType Constant Value "1" VectorParams1D on SamplingMode "Sample based" OutDataTypeMode "Inherit from 'Constant value'" OutDataType "fixdt(1,16,0)" ConRadixGroup "Use specified scaling" OutScaling "[]" SampleTime "inf" FramePeriod "inf" } Block { BlockType DataStoreMemory ReadBeforeWriteMsg "none" WriteAfterWriteMsg "none" WriteAfterReadMsg "none" StateMustResolveToSignalObject off ShowAdditionalParam off DataType "auto" OutDataType "fixdt(1,16,0)" OutScaling "[]" SignalType "auto" } Block { BlockType DataStoreRead } Block { BlockType DataStoreWrite } Block { BlockType EnablePort StatesWhenEnabling "held" ShowOutputPort off ZeroCross on } Block { BlockType Logic Operator "AND" Inputs "2" IconShape "rectangular" AllPortsSameDT on OutDataTypeMode "Logical (see Configuration Parameters: Optimization)" LogicDataType "uint(8)" SampleTime "-1" } Block { BlockType "S-Function" FunctionName "system" SFunctionModules "''" PortCounts "[]" SFunctionDeploymentMode off } Block { BlockType Scope 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 "-1" } Block { BlockType SubSystem ShowPortLabels "on" Permissions "ReadWrite" PermitHierarchicalResolution "All" TreatAsAtomicUnit off CheckFcnCallInpInsideContextMsg off SystemSampleTime "-1" RTWFcnNameOpts "Auto" RTWFileNameOpts "Auto" SimViewingDevice off DataTypeOverride "UseLocalSettings" MinMaxOverflowLogging "UseLocalSettings" } Block { BlockType WhileIterator MaxIters "5" WhileBlockType "while" ResetStates "held" ShowIterationPort off OutputDataType "int32" } } System { Name CAN Location [142, 202, 1137, 821] Open on ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" ReportName "simulink-default.rpt" Block { BlockType Reference Name "CAN Configuration" Tag "dsPIC_CAN_Config" Ports [] Position [205, 131, 330, 189] List { ListType RTWdata NumCAN "1" TcanTcy "1" BRP "26" PRSEG "4" SEG1PH "4" SEG2PH "5" SJW "2" SAM "0" Mode "0" } SourceBlock "dsPICdrivers/BUS CAN/CAN Configuration" SourceType "CAN Configuration" NumCAN "1" Mode "Normal" TcanTcy "Tcan = Tcy" BRP "26" PRSEG "4" SEG1PH "4" SAM_popup "Once at sample point" SEG2PH "5" SJW "2" SampleTime "-1" OrderingInOutPopup "None" Info "Tq = 2.7e-006s X 15 --> Fcan = 24.6914 KHz" } Block { BlockType Reference Name "CAN Receive" Tag "dsPIC_CAN_Receive" Ports [0, 6] Position [120, 286, 450, 509] List { ListType RTWdata NumCAN "1" ErrCount "1" DBEN "0" DataLost "1" RXM0 "536870911" RXM1 "536870911" RXF0 "49" F0type "1" DL0 "1" DL0received "1" FlagNewMessage0 "1" OutId0 "1" DataRequestSend0 "0" RXF1 "52" F1type "0" DL1 "0" DL1received "0" FlagNewMessage1 "0" OutId1 "0" DataRequestSend1 "0" RXF2 "53" F2type "2" DL2 "0" DL2received "0" FlagNewMessage2 "0" OutId2 "0" DataRequestSend2 "0" RXF3 "0" F3type "0" DL3 "0" DL3received "0" FlagNewMessage3 "0" OutId3 "0" DataRequestSend3 "0" RXF4 "0" F4type "0" DL4 "0" DL4received "0" FlagNewMessage4 "0" OutId4 "0" DataRequestSend4 "0" } SourceBlock "dsPICdrivers/BUS CAN/CAN Receive" SourceType "CAN Configuration" NumCAN "1" RXM0 "2^29-1" DL0 "1" RXF0 "49" F0type "Standard 11 bits" DL0received on FlagNewMessage0 on OutId0 on DataRequestSend0 off DL1 "Off" RXF1 "52" F1type "Standard or Extended" DL1received off FlagNewMessage1 off OutId1 off DataRequestSend1 off RXM1 "2^29-1" DL2 "Off" RXF2 "53" F2type "Extended 29 bits" DL2received off FlagNewMessage2 off OutId2 off DataRequestSend2 off DL3 "Off" RXF3 "0" F3type "Standard or Extended" DL3received off FlagNewMessage3 off OutId3 off DataRequestSend3 off DL4 "Off" RXF4 "0" F4type "Standard or Extended" DL4received off FlagNewMessage4 off OutId4 off DataRequestSend4 off DBEN off ErrCount on DataLost on SampleTime "-1" OrderingInOutPopup "None" Info "0" } Block { BlockType Reference Name "CAN Transmit1" Tag "dsPIC_CAN_Transmit" Ports [2, 5] Position [215, 578, 380, 682] List { ListType RTWdata NumCAN "1" TxPriority "3" IdentifierType "0" IdentifierBlockInput "1" SRR "1" TransmitBlockInput "1" DLC "2" TxFull "1" OutErrCount "1" TXBO "1" TXEP "1" TXWAR "1" WaitPreviousTransmission "0" } SourceBlock "dsPICdrivers/BUS CAN/CAN Transmit" SourceType "CAN Configuration" NumCAN "1" WaitPreviousTransmission off TxPriority "Highest" IdentifierType "Standard 11 bits" IdentifierBlockInput on Identifier "0" SRR "Message request a remote transmission" DLC "2" TransmitBlockInput on TransmitValue "0" TxFull on OutErrCount on TXBO on TXEP on TXWAR on SampleTime "-1" OrderingInOutPopup "None" Info "0" } Block { BlockType Reference Name "Compare\nTo Constant" Ports [1, 1] Position [690, 40, 720, 70] SourceBlock "simulink/Logic and Bit\nOperations/Compare\nTo Constant" SourceType "Compare To Constant" ShowPortLabels "on" SystemSampleTime "-1" relop "==" const "55" LogicOutDataTypeMode "boolean" ZeroCross off } Block { BlockType Reference Name "Configure Model \nfor dsPIC" Ports [] Position [20, 114, 132, 170] BackgroundColor "yellow" DropShadow on SourceBlock "dsPICdrivers/Simulink Configuration/Configure Model \nfor dsPIC" SourceType "" } Block { BlockType Constant Name "Constant1" Position [105, 636, 160, 664] Value "[22 44]" OutDataTypeMode "Inherit via back propagation" OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType Constant Name "Constant2" Position [40, 577, 100, 603] Value "49" OutDataTypeMode "uint16" OutDataType "sfix(16)" OutScaling "2^0" SampleTime ".05" } Block { BlockType Reference Name "Counter\nFree-Running1" Ports [0, 1] Position [15, 535, 45, 565] SourceBlock "simulink/Sources/Counter\nFree-Running" SourceType "Counter Free-Running" ShowPortLabels "on" SystemSampleTime "-1" NumBits "8" tsamp ".01" } Block { BlockType DataStoreMemory Name "Data Store\nMemory" Position [455, 55, 519, 81] DataStoreName "UART_Flag" ReadBeforeWriteMsg "warning" WriteAfterWriteMsg "warning" WriteAfterReadMsg "warning" RTWStateStorageClass "Auto" VectorParams1D on OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType DataStoreMemory Name "Data Store\nMemory1" Position [390, 55, 454, 81] DataStoreName "UART_Data" ReadBeforeWriteMsg "warning" WriteAfterWriteMsg "warning" WriteAfterReadMsg "warning" RTWStateStorageClass "Auto" VectorParams1D on OutDataType "sfix(16)" OutScaling "2^0" } Block { BlockType DataStoreRead Name "Data Store\nRead" Position [630, 93, 705, 127] DataStoreName "UART_Flag" SampleTime "-1" } Block { BlockType DataStoreRead Name "Data Store\nRead2" Position [585, 38, 660, 72] DataStoreName "UART_Data" SampleTime ".01" } Block { BlockType DataStoreWrite Name "Data Store\nWrite" Position [611, 275, 699, 320] Orientation "down" NamePlacement "alternate" DataStoreName "UART_Flag" SampleTime "-1" } Block { BlockType DataStoreWrite Name "Data Store\nWrite1" Position [609, 160, 701, 205] Orientation "up" DataStoreName "UART_Data" SampleTime "-1" } Block { BlockType SubSystem Name "Enabled\nSubsystem1" Ports [0, 0, 1] Position [885, 84, 985, 126] TreatAsAtomicUnit on MinAlgLoopOccurrences off PropExecContextOutsideSubsystem off RTWSystemCode "Auto" MaskHideContents off System { Name "Enabled\nSubsystem1" Location [311, 223, 813, 575] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType EnablePort Name "Enable" Ports [] Position [235, 20, 255, 40] } Block { BlockType SubSystem Name "While Iterator\nSubsystem" Ports [] Position [110, 71, 370, 179] TreatAsAtomicUnit on MinAlgLoopOccurrences off PropExecContextOutsideSubsystem off RTWSystemCode "Auto" MaskHideContents off System { Name "While Iterator\nSubsystem" Location [243, 350, 873, 650] Open off ModelBrowserVisibility off ModelBrowserWidth 200 ScreenColor "white" PaperOrientation "landscape" PaperPositionMode "auto" PaperType "A4" PaperUnits "centimeters" TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] TiledPageScale 1 ShowPageBoundaries off ZoomFactor "100" Block { BlockType Reference Name "C1h" Ports [1, 1] Position [165, 75, 195, 105] SourceBlock "simulink/Logic and Bit\nOperations/Compare\nTo Constant" SourceType "Compare To Constant" ShowPortLabels "on" SystemSampleTime "-1" relop "==" const "66" LogicOutDataTypeMode "boolean" ZeroCross off } Block { BlockType Logic Name "Logical\nOperator" Ports [1, 1] Position [255, 154, 285, 186] Operator "NOT" AllPortsSameDT off OutDataTypeMode "boolean" } Block { BlockType Reference Name "Rx Input" Tag "dsPIC_RX" Ports [0, 1] Position [50, 71, 120, 109] Priority "5" SourceBlock "dsPICdrivers/Serial PORT/Rx Input" SourceType "Rx" UART "1" SampleTime "-1" BlockingFctChk off OutputDefault "0" IsPresentFlagChk off } Block { BlockType "S-Function" Name "Software RESET" Tag "dsPIC_Reset" Ports [1] Position [320, 72, 405, 108] FunctionName "dsPIC_Reset" EnableBusSupport off MaskDescription "Reset the microcontroller when input is different from 0" MaskDisplay "fprintf('Reset');\nport_label('input', 1 ,'~=0');" MaskIconFrame on MaskIconOpaque on MaskIconRotate "none" MaskIconUnits "autoscale" } Block { BlockType WhileIterator Name "While Iterator" Ports [1] Position [330, 148, 405, 192] MaxIters "-1" WhileBlockType "do-while" ResetStates "reset" } Line { SrcBlock "Logical\nOperator" SrcPort 1 DstBlock "While Iterator" DstPort 1 } Line { SrcBlock "Rx Input" SrcPort 1 DstBlock "C1h" DstPort 1 } Line { SrcBlock "C1h" SrcPort 1 Points [15, 0] Branch { DstBlock "Software RESET" DstPort 1 } Branch { Points [0, 80] DstBlock "Logical\nOperator" DstPort 1 } } } } } } Block { BlockType Logic Name "Logical\nOperator2" Ports [2, 1] Position [745, 44, 775, 86] AllPortsSameDT off OutDataTypeMode "boolean" } Block { BlockType Reference Name "Master" Tag "dsPIC_MASTER" Ports [] Position [30, 37, 139, 88] BackgroundColor "lightBlue" Priority "1" List { ListType RTWdata NumBusyPort "-1" } SourceBlock "dsPICdrivers/Master" SourceType "Master" TimeStepType "Timer1" picType "30f4012" fcy "20e6" Quartz_33f "10e6" PLLActive_33f off fcyDesired_33f "40e6" tmr1 "[1 19999 0]" tmr1Info "Time Step : 0.001 ; Error : 0% PR1=19999" tmr2345 "[0 0 0 0]" tmr2345cfg "[-1 -1 -1 -1]" IOautoConf on typePort "[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 4 0 0 0 0 0" " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" " 0 0 19 19 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0" " 0 0 0 0 ]" TRIS "[ 65535 65535 65535 65535 65535 65535 65535 ]" ADPCFG "0" MasterBusyPort "None" MasterOverloadPort "None" FOSC "XT_PLL8" ClockSwitchMonitor "Both disabled" TempProtection_33f "TEMP_ON" FPBOR "PBOR_OFF" PWRT "PWRT_OFF" MCLR "MCLR_DIS" PowerSave off OverrideFcy off NewFcy "1e6" PR2345 "[65535 65535 65535 65535]" } Block { BlockType Reference Name "Rx Input" Tag "dsPIC_RX" Ports [0, 2] Position [540, 216, 610, 254] Priority "5" SourceBlock "dsPICdrivers/Serial PORT/Rx Input" SourceType "Rx" UART "1" SampleTime ".01" BlockingFctChk off OutputDefault "0" IsPresentFlagChk on } Block { BlockType Scope Name "Scope" Ports [1] Position [895, 229, 925, 261] Floating off Location [188, 390, 512, 629] Open off NumInputPorts "1" List { ListType AxesTitles axes1 "%" } DataFormat "StructureWithTime" SampleTime "0" } Block { BlockType Scope Name "Scope1" Ports [1] Position [950, 364, 980, 396] Floating off Location [188, 390, 512, 629] Open off NumInputPorts "1" List { ListType AxesTitles axes1 "%" } SaveName "ScopeData1" DataFormat "StructureWithTime" SampleTime "0" } Block { BlockType Reference Name "TX Output Multiplexed\nfor Matlab / Labview" Tag "dsPIC_TX_Multiplexed" Ports [8] Position [960, 437, 1105, 568] Priority "5" SourceBlock "dsPICdrivers/Serial PORT/TX Output Multiplexed\nfor Matlab // Labview" SourceType "send structured data frame to Matlab / Labview" UART "1" CleverSpreadingChk on CleverSpreading "1" CHANNEL "[0 1 2 3 4 5 6 7]" CHANNELBLOCKED "[]" CHANNELBLOCKED_BITEWISE "0" Status "OK" } Block { BlockType Reference Name "UART Configuration" Tag "dsPIC_config_UART" Ports [] Position [235, 54, 336, 84] BackgroundColor "lightBlue" Priority "2" List { ListType RTWdata RxBufferSize "32" } SourceBlock "dsPICdrivers/Serial PORT/UART Configuration" SourceType "Configure UART" UART "1" proposed_BAUD "115200" ALT_TX_RX on InterruptTxWhen "When Transmit Buffer is empty" TXInterruptPri "5" TxBufferSize "32" TXEN on InterruptRxWhen "When Receive Buffer is full (contain 4 characters)" RXInterruptPri "1" RxBufferSize "32" BAUD "115200" UxBRG "10" Info "UxBRG = 10 || Real Baud : 113636 || % error : -1.3573 || max 11.3636 Bytes / Step" RealBaud "0" } Block { BlockType Constant Name "Constant" Tag "dsPIC_CAN_Receive" Position [40, 95, 70, 125] IOType "siggen" Value "192" OutDataTypeMode "uint8" OutDataType "sfix(16)" OutScaling "2^0" } Line { SrcBlock "Rx Input" SrcPort 2 Points [40, 0] DstBlock "Data Store\nWrite" DstPort 1 } Line { SrcBlock "Rx Input" SrcPort 1 Points [40, 0] DstBlock "Data Store\nWrite1" DstPort 1 } Line { SrcBlock "Compare\nTo Constant" SrcPort 1 DstBlock "Logical\nOperator2" DstPort 1 } Line { SrcBlock "Logical\nOperator2" SrcPort 1 Points [155, 0] DstBlock "Enabled\nSubsystem1" DstPort enable } Line { SrcBlock "Data Store\nRead" SrcPort 1 Points [0, -35] DstBlock "Logical\nOperator2" DstPort 2 } Line { SrcBlock "Data Store\nRead2" SrcPort 1 DstBlock "Compare\nTo Constant" DstPort 1 } Line { SrcBlock "Constant2" SrcPort 1 Points [95, 0] DstBlock "CAN Transmit1" DstPort 1 } Line { SrcBlock "Constant1" SrcPort 1 Points [35, 0] DstBlock "CAN Transmit1" DstPort 2 } Line { SrcBlock "CAN Receive" SrcPort 2 Points [0, 10; 490, 0] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 6 } Line { SrcBlock "CAN Receive" SrcPort 1 Points [330, 0; 0, 140] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 1 } Line { SrcBlock "CAN Receive" SrcPort 3 Points [290, 0; 0, 85] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 2 } Line { SrcBlock "CAN Receive" SrcPort 4 Points [250, 0; 0, 65] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 3 } Line { SrcBlock "CAN Receive" SrcPort 5 Points [210, 0; 0, 45] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 4 } Line { SrcBlock "CAN Receive" SrcPort 6 Points [170, 0; 0, 25] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 5 } Line { SrcBlock "CAN Transmit1" SrcPort 1 Points [275, 0; 0, -50] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 7 } Line { SrcBlock "CAN Transmit1" SrcPort 2 Points [295, 0; 0, -55] DstBlock "TX Output Multiplexed\nfor Matlab / Labview" DstPort 8 } } }