Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

window pop up 1

Status
Not open for further replies.

chopieske

New member
Jun 14, 2012
3
Hello all,
I was wondering if there existed a block in Simulink that when a condition is satisfied, a window pops up with a message I would define.
Thank you in advance.
 
Replies continue below

Recommended for you

Yes, there is. Or more accurately, when a condition is satisfied you can enable a block to display a box with a message in it.

Here's the pseudo code

If condition==satisfied
then
MSG$="OMG it works!!!!"
messagebox(MSG$)
else
endif

This may need some banal refinements, but frankly let's face it, you should have done Business Studies.








Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
Actually I was asking for block in Simulink, not MatLab code.

I'll try to be more specific:
I need to stop a simulation either when it finishes (obviously) or when a signal exceeds a certain value (for which I use a RELATIONAL OPERATOR block and a STOP block). It would be helpful to show a message if the simulation has stopped because of that value exceeding the limit imposed. (This model is going to be used by people when I'm not working here anymore so I won't be able to explain them.)
My question is if there is such a block in Simulink that when that condition is satisfied, a window or some kind of message pops up saying why the simulation has stopped. I would put this block parallel to the STOP block.

Would you GregLocock (or anybody else) be able to help again? Thank you.
...and please, don't be misrespectful.

Cheers
 
Nevermind, I already found it after 2 days of intensive search.

In case it can be of any help to somebody, it is a block called ASSERTION. It stops the simulation, shows an error window and writes whatever message in the Command Window.

Cheers
 
That'll teach me to be snarky, I hadn't realised there was no messagebox function as such. I'd have written some m code long before finding 'assertion'.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor