[Simulink Test] Detect Signal Change in Logical & Temporal Assessment Without Modifying Harness

Hello MATLAB Community,
I am working with Simulink Test (version R2025b) and want to create a temporal assessment that triggers a verification when a logged signal (`CMD_MODE`) changes value, without modifying my existing test harness.
Problem:
I have tried the following syntaxes in Logical & Temporal Assessment, but none work:
- changed(CMD_MODE) → "Invalid call"
- CMD_MODE != CMD_MODE[1] → "Not a valid MATLAB expression"
- prev(CMD_MODE, 1) → "Unknown function"
The signal `CMD_MODE` is of type int8, and I want to verify a condition on another signal (`OUTPUT`) whenever it changes.
Questions:
1. What is the correct syntax to detect a signal value change in a Temporal Logic Assessment?
2. Is there an official operator (like rise()/fall()) for non-boolean signals?
3. If no solution exists without modifying the harness, what is the least intrusive workaround?
What I’ve Already Tried:
- rise()/fall() (only works for boolean signals)
- prev() or signal[1] (syntax not recognized)
- Adding a Memory block in the harness (works but prefer to avoid)
Environment:
- MATLAB/Simulink: R2025b
- CMD_MODE` type: nt8
- Example condition to verify: OUTPUT == 1 after change
Thanks

2 Comments

Hi Theo,
To use Logical and Temporal Assessments, you'll need to create symbols and map them to the model.
Based on your description, it looks like this mapping step may not have been completed yet. In the image above, the signals I added are showing warnings because they haven't been mapped. You can right-click on a signal and select the option to map it to a signal in your model.
The mapping step was done ! My question is just : "How can I create a triger like this : when the value of my logging signal change then you verifie this ..."
I don't knox how to do this in the logical and temporal assement without loggig a signal in the model afdter a "Detect change" block in the model !

Sign in to comment.

 Accepted Answer

I think you will have to add a "Unit Delay" block (or a Memory block as you've tried) in the harness to be able to map them into two symbols. Then use these two symbols to create the "detect change" logic. Use the "becomes true" of this logic to trig the desired verification.
If the initial value of `CMD_MODE` is known and is a constant, then you don't need to modify the harness. Just compare `CMD_MODE` to this constant in the logic.
When a symbol is mapped to a signal or a parameter, it does not record or contain the history of the value, while to detect a value change, you have to have a value history. That is the dilemma.

More Answers (0)

Products

Release

R2025b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!