| Using Simulink | Search  Help Desk |
Breaking at Zero-Crossings
Thezcbreak command causes the simulation to halt when Simulink detects a non-sampled zero crossing in a model that includes blocks where zero-crossings can arise. After halting, Simulink prints the location in the model, the time, and the type (rising or falling) of the zero-crossing. For example, setting a zero-crossing break at the start of execution of the zeroxing demo model
sldebug zeroxing [Tm=0 ] **Start** of system 'zeroxing' outputs (sldebug @0:0 'zeroxing/Sine Wave'): zcbreak Break at zero crossing events is enabled.and continuing the simulation
(sldebug @0:0 'zeroxing/Sine Wave'): continueresults in a rising zero-crossing break at
[Tm=0.34350110879329 ] Breaking at block 0:2 [Tm=0.34350110879329 ] Rising zero crossing on 3rd zcsignal in block 0:2 'zeroxing/Saturation'If a model does not include blocks capable of producing nonsampled zero-crossings, the command prints a message advising you of this fact.