左栏Simulation Loop: simulate(TestDebugSimulink) 高亮显示
且ID = 0
右栏Outputs:输出:
%----------------------------------------------------------------%
[TM = 0 ] simulate(TestDebugSimulink)
(sldebug @0):
左栏Simulation Loop: initializationPhase 高亮显示
且ID = 1
右栏Outputs:输出:
%----------------------------------------------------------------%
[TM = 0 ] initializationPhase
(sldebug @1):
由此可以看出:
(sldebug @X):
为左栏中的 ID号
initializationPhase
应为左栏中的Method
因此,不断地点击StepInto
,在Outputs
中得到内容如下
警告: The behavior of the Simulink Debugger has been modified in R2012b. See release notes for details.
警告: 'Signal storage reuse' is enabled for this model. Block I/O values displayed in the debugger may not be correct.
In order to preserve block output signal values, consider disabling the 'Signal storage reuse' option in the 'All Parameters' tab of the Configuration Parameters dialog
警告: 'Block reduction optimization' is enabled for this model. Some non-virtual blocks may not execute due to optimization.
To be able to execute all non-virtual blocks consider disabling the 'Block reduction optimization' option in the 'All Parameters' tab of the Configuration Parameters dialog
%----------------------------------------------------------------%
[TM = 0 ] simulate(TestDebugSimulink)
(sldebug @0):
%----------------------------------------------------------------%
[TM = 0 ] initializationPhase
(sldebug @1):
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.SetupRunTimeResources
(sldebug @2):
%----------------------------------------------------------------%
[TM = 0 ] 0:0 Constant.SetupRunTimeResources 'TestDebugSimulink/x'
(sldebug @3):
Data of 0:0 Constant block 'TestDebugSimulink/x':
No data to display
%----------------------------------------------------------------%
[TM = 0 ] 0:1 Constant.SetupRunTimeResources 'TestDebugSimulink/y'
(sldebug @4):
Data of 0:1 Constant block 'TestDebugSimulink/y':
No data to display
%----------------------------------------------------------------%
[TM = 0 ] 0:2 Sum.SetupRunTimeResources 'TestDebugSimulink/S1'
(sldebug @5):
Data of 0:2 Sum block 'TestDebugSimulink/S1':
No data to display
%----------------------------------------------------------------%
[TM = 0 ] 0:3 Display.SetupRunTimeResources 'TestDebugSimulink/Display'
(sldebug @6):
Data of 0:3 Display block 'TestDebugSimulink/Display':
No data to display
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.InitializeConditions
(sldebug @7):
%----------------------------------------------------------------%
[TM = 0 ] 0:0 Constant.Start 'TestDebugSimulink/x'
(sldebug @8):
Data of 0:0 Constant block 'TestDebugSimulink/x':
No data to display
%----------------------------------------------------------------%
[TM = 0 ] 0:1 Constant.Start 'TestDebugSimulink/y'
(sldebug @9):
Data of 0:1 Constant block 'TestDebugSimulink/y':
No data to display
%----------------------------------------------------------------%
[TM = 0 ] 0:3 Display.Start 'TestDebugSimulink/Display'
(sldebug @10):
Data of 0:3 Display block 'TestDebugSimulink/Display':
No data to display
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Enable
(sldebug @11):
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Outputs.InvariantConstants
(sldebug @12):
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Outputs.ParameterChangeEvent
(sldebug @13):
%----------------------------------------------------------------%
[TM = 0 ] 0:0 Constant.Outputs.Major 'TestDebugSimulink/x'
(sldebug @14):
Data of 0:0 Constant block 'TestDebugSimulink/x':
Y1 = [1]
%----------------------------------------------------------------%
[TM = 0 ] 0:1 Constant.Outputs.Major 'TestDebugSimulink/y'
(sldebug @15):
Data of 0:1 Constant block 'TestDebugSimulink/y':
Y1 = [1]
%----------------------------------------------------------------%
[TM = 0 ] 0:2 Sum.Outputs.Major 'TestDebugSimulink/S1'
(sldebug @16):
Data of 0:2 Sum block 'TestDebugSimulink/S1':
U1 = [1]
U2 = [1]
Y1 = [2]
%----------------------------------------------------------------%
[TM = 0 ] 0:3 Display.Outputs.Major 'TestDebugSimulink/Display'
(sldebug @17):
Data of 0:3 Display block 'TestDebugSimulink/Display':
U1 = [2]
%----------------------------------------------------------------%
[TM = 0 ] simulationPhase
(sldebug @18):
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Outputs.ParameterChangeEvent
(sldebug @19):
%----------------------------------------------------------------%
[TM = 0 ] 0:0 Constant.Outputs.Major 'TestDebugSimulink/x'
(sldebug @20):
Data of 0:0 Constant block 'TestDebugSimulink/x':
Y1 = [1]
%----------------------------------------------------------------%
[TM = 0 ] 0:1 Constant.Outputs.Major 'TestDebugSimulink/y'
(sldebug @21):
Data of 0:1 Constant block 'TestDebugSimulink/y':
Y1 = [1]
%----------------------------------------------------------------%
[TM = 0 ] 0:2 Sum.Outputs.Major 'TestDebugSimulink/S1'
(sldebug @22):
Data of 0:2 Sum block 'TestDebugSimulink/S1':
U1 = [1]
U2 = [1]
Y1 = [2]
%----------------------------------------------------------------%
[TM = 0 ] 0:3 Display.Outputs.Major 'TestDebugSimulink/Display'
(sldebug @23):
Data of 0:3 Display block 'TestDebugSimulink/Display':
U1 = [2]
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 1 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 1 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 2 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 2 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 3 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 3 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 4 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 4 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 5 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 5 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 6 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 6 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 7 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 7 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 8 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 8 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 9 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 9 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 10 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 10 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 10 ] terminationPhase
(sldebug @26):
%----------------------------------------------------------------%
[TM = 10 ] TestDebugSimulink.CleanupRunTimeResources
(sldebug @27):
%----------------------------------------------------------------%
[TM = 10 ] TestDebugSimulink.Terminate
(sldebug @28):
%----------------------------------------------------------------%
[TM = 10 ] 0:0 Constant.CleanupRunTimeResources 'TestDebugSimulink/x'
(sldebug @29):
%----------------------------------------------------------------%
[TM = 10 ] 0:1 Constant.CleanupRunTimeResources 'TestDebugSimulink/y'
(sldebug @30):
%----------------------------------------------------------------%
[TM = 10 ] 0:2 Sum.CleanupRunTimeResources 'TestDebugSimulink/S1'
(sldebug @31):
%----------------------------------------------------------------%
[TM = 10 ] 0:3 Display.CleanupRunTimeResources 'TestDebugSimulink/Display'
(sldebug @32):
%----------------------------------------------------------------%
[TM = 10 ] simulate(TestDebugSimulink)
(sldebug @0):
警告: The behavior of the Simulink Debugger has been modified in R2012b. See release notes for details.
警告: 'Signal storage reuse' is enabled for this model. Block I/O values displayed in the debugger may not be correct.
In order to preserve block output signal values, consider disabling the 'Signal storage reuse' option in the 'All Parameters' tab of the Configuration Parameters dialog
警告: 'Block reduction optimization' is enabled for this model. Some non-virtual blocks may not execute due to optimization.
To be able to execute all non-virtual blocks consider disabling the 'Block reduction optimization' option in the 'All Parameters' tab of the Configuration Parameters dialog
%----------------------------------------------------------------%
[TM = 0 ] simulate(TestDebugSimulink)
(sldebug @0):
// 开始仿真
%----------------------------------------------------------------%
[TM = 0 ] initializationPhase
(sldebug @1):
// Phase 的初始化
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.SetupRunTimeResources
(sldebug @2):
// 进行"TestDebugSimulink"文件模型仿真的资源加载
%----------------------------------------------------------------%
[TM = 0 ] 0:0 Constant.SetupRunTimeResources 'TestDebugSimulink/x'
(sldebug @3):
Data of 0:0 Constant block 'TestDebugSimulink/x':
No data to display
// 模型中名为(第一个data)`x`的 Constant block 的资源加载,且不需要显示
%----------------------------------------------------------------%
[TM = 0 ] 0:1 Constant.SetupRunTimeResources 'TestDebugSimulink/y'
(sldebug @4):
Data of 0:1 Constant block 'TestDebugSimulink/y':
No data to display
// 模型中名为(第二个data)`y`的 Constant block 的资源加载,且不需要显示
%----------------------------------------------------------------%
[TM = 0 ] 0:2 Sum.SetupRunTimeResources 'TestDebugSimulink/S1'
(sldebug @5):
Data of 0:2 Sum block 'TestDebugSimulink/S1':
No data to display
// 模型中名为(第三个data)`S1`的 Sum block 的资源加载,且不需要显示
%----------------------------------------------------------------%
[TM = 0 ] 0:3 Display.SetupRunTimeResources 'TestDebugSimulink/Display'
(sldebug @6):
Data of 0:3 Display block 'TestDebugSimulink/Display':
No data to display
// 模型中名为(第四个data)`Display`的 Display block 的资源加载,且不需要显示
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.InitializeConditions
(sldebug @7):
// 初始化模型条件
%----------------------------------------------------------------%
[TM = 0 ] 0:0 Constant.Start 'TestDebugSimulink/x'
(sldebug @8):
Data of 0:0 Constant block 'TestDebugSimulink/x':
No data to display
// 开始模型中名为(第一个data)`x`的 Constant block,且不需要显示
%----------------------------------------------------------------%
[TM = 0 ] 0:1 Constant.Start 'TestDebugSimulink/y'
(sldebug @9):
Data of 0:1 Constant block 'TestDebugSimulink/y':
No data to display
// 开始模型中名为(第二个data)`y`的 Constant block,且不需要显示
%----------------------------------------------------------------%
[TM = 0 ] 0:3 Display.Start 'TestDebugSimulink/Display'
(sldebug @10):
Data of 0:3 Display block 'TestDebugSimulink/Display':
No data to display
// 开始模型中名为(第四个data)`y`的 Display block,且不需要显示
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Enable
(sldebug @11):
// 模型使能
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Outputs.InvariantConstants
(sldebug @12):
// 输出模型中的 InvariantConstants
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Outputs.ParameterChangeEvent
(sldebug @13):
// 输出模型中的 ParameterChangeEvent
%----------------------------------------------------------------%
[TM = 0 ] 0:0 Constant.Outputs.Major 'TestDebugSimulink/x'
(sldebug @14):
Data of 0:0 Constant block 'TestDebugSimulink/x':
Y1 = [1]
// 命名为 x 的 Constant block 输出 1
%----------------------------------------------------------------%
[TM = 0 ] 0:1 Constant.Outputs.Major 'TestDebugSimulink/y'
(sldebug @15):
Data of 0:1 Constant block 'TestDebugSimulink/y':
Y1 = [1]
// 命名为 y 的 Constant block 输出 1
%----------------------------------------------------------------%
[TM = 0 ] 0:2 Sum.Outputs.Major 'TestDebugSimulink/S1'
(sldebug @16):
Data of 0:2 Sum block 'TestDebugSimulink/S1':
U1 = [1]
U2 = [1]
Y1 = [2]
// 命名为 S1 的 Sum block 两个输入相加,输出 2
%----------------------------------------------------------------%
[TM = 0 ] 0:3 Display.Outputs.Major 'TestDebugSimulink/Display'
(sldebug @17):
Data of 0:3 Display block 'TestDebugSimulink/Display':
U1 = [2]
// 命名为 Display 的 Display block 输入为 2
// 开始重复一次上述步骤
%----------------------------------------------------------------%
[TM = 0 ] simulationPhase
(sldebug @18):
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Outputs.ParameterChangeEvent
(sldebug @19):
%----------------------------------------------------------------%
[TM = 0 ] 0:0 Constant.Outputs.Major 'TestDebugSimulink/x'
(sldebug @20):
Data of 0:0 Constant block 'TestDebugSimulink/x':
Y1 = [1]
%----------------------------------------------------------------%
[TM = 0 ] 0:1 Constant.Outputs.Major 'TestDebugSimulink/y'
(sldebug @21):
Data of 0:1 Constant block 'TestDebugSimulink/y':
Y1 = [1]
%----------------------------------------------------------------%
[TM = 0 ] 0:2 Sum.Outputs.Major 'TestDebugSimulink/S1'
(sldebug @22):
Data of 0:2 Sum block 'TestDebugSimulink/S1':
U1 = [1]
U2 = [1]
Y1 = [2]
%----------------------------------------------------------------%
[TM = 0 ] 0:3 Display.Outputs.Major 'TestDebugSimulink/Display'
(sldebug @23):
Data of 0:3 Display block 'TestDebugSimulink/Display':
U1 = [2]
// 结束重复一次上述步骤
不断地输出,更新。
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 0 ] TestDebugSimulink.Update
(sldebug @25):
不断地输出,更新。
%----------------------------------------------------------------%
[TM = 1 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 1 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 2 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 2 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 3 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 3 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 4 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 4 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 5 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 5 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 6 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 6 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 7 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 7 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 8 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 8 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 9 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 9 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 10 ] TestDebugSimulink.Outputs.Major
(sldebug @24):
%----------------------------------------------------------------%
[TM = 10 ] TestDebugSimulink.Update
(sldebug @25):
%----------------------------------------------------------------%
[TM = 10 ] terminationPhase
(sldebug @26):
// 结束 Phase
%----------------------------------------------------------------%
[TM = 10 ] TestDebugSimulink.CleanupRunTimeResources
(sldebug @27):
// 清除资源
%----------------------------------------------------------------%
[TM = 10 ] TestDebugSimulink.Terminate
(sldebug @28):
// 结束
%----------------------------------------------------------------%
[TM = 10 ] 0:0 Constant.CleanupRunTimeResources 'TestDebugSimulink/x'
(sldebug @29):
// 清除 x
%----------------------------------------------------------------%
[TM = 10 ] 0:1 Constant.CleanupRunTimeResources 'TestDebugSimulink/y'
(sldebug @30):
// 清除 y
%----------------------------------------------------------------%
[TM = 10 ] 0:2 Sum.CleanupRunTimeResources 'TestDebugSimulink/S1'
(sldebug @31):
// 清除 S1
%----------------------------------------------------------------%
[TM = 10 ] 0:3 Display.CleanupRunTimeResources 'TestDebugSimulink/Display'
(sldebug @32):
// 清除 Display
%----------------------------------------------------------------%
[TM = 10 ] simulate(TestDebugSimulink)
(sldebug @0):
// 等待下一次仿真开始
Simulink 仿真主要步骤: