Assertion - Check whether signal is nonzero

Library

Model Verification

Description

The Assertion block checks whether any of the elements of the signal at its input is nonzero. If all elements are nonzero, the block does nothing. If any element is zero, the block halts the simulation, by default, and displays an error message. The block's parameter dialog box allows you to

You can also use the Model Verification block enabling setting on the Data Validity diagnostics pane of the Configuration Parameters dialog box to enable or disable all Assertion blocks in a model.

The Assertion block and its companion blocks in the Model Verification library are intended to facilitate creation of self-validating models. For example, you can use model verification blocks to test that signals do not exceed specified limits during simulation. When you are satisfied that a model is correct, you can turn error checking off by disabling the verification blocks. You do not have to physically remove them from the model. If you need to modify a model, you can temporarily turn the verification blocks back on to ensure that your changes do not break the model.

Data Type Support

The Assertion block accepts input signals of any dimensions and any numeric data type supported by Simulink software, including fixed-point data types.

For a discussion on the data types supported by Simulink software, see Data Types Supported by Simulink.

Parameters and Dialog Box

Enable Assertion

Unchecking this option disables the Assertion block, that is, causes the model to behave as if the Assertion block did not exist. The Model Verification block enabling setting on the Data Validity diagnostics pane of the Configuration Parameters dialog box allows you to enable or disable all Assertion blocks in a model regardless of the setting of this option.

Simulation callback when assertion fails

An M-expression to be evaluated when the assertion fails.

Stop simulation when assertion fails

If checked, this option causes the Assertion block to halt the simulation when the block's input is zero and display an error message in the Simulation Diagnostics viewer. Otherwise, the block displays a warning message in the MATLAB® Command Window and continues the simulation.

Sample time (-1 for inherited)

Enter the time interval between sample time hits or specify another appropriate sample time such as continuous. By default, the block inherits its sample time based upon its context within the model. See Working with Sample Times.

Characteristics

Direct Feedthrough

No

Sample Time

Inherited from driving block

Scalar Expansion

No

Dimensionalized

Yes

Zero Crossing

No

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS