Output of the function-call block

2 views (last 30 days)
Lex
Lex on 14 Mar 2011
Hey guys,
I'm working on a demo project to make it easier to start with Matlab for people who are new to Matlab.
Within this demo project I want to use a simple stateflow chart that triggers an function-call block. The stateflow chart uses two different states and every state triggers a different function-call block.
When I add an event to trigger the block, the event is active and inactive the way it should be. However once the function-call block is triggered it stays active while the outgoing event that triggers the function-call block isn't.
I've tested the outgoing signal of the stateflow charts and noticed that it was working correct. The function-call block is the one causing the problem.
I noticed that when I use a constant block in the function-call block, the output of the function-call block contains that value once activated. If I use a sample base time pulse generator the output does follow the output of the stateflow chart. But when I set it to a 100% pulse width the output doesn't follow the stateflow output and remains high. Even when the state is inactive. To me it looks like the function-call block doesn't respond to the trigger when a constant value is used within the the function-call block.
When I set the pulse width to 90 percent the output in active state makes the correct signal but when inactive it remains high. When I set the pulse width to 80 percent the output in active state makes the correct signal again and stays low when inactive. It seems that the signal just remains it last value when getting inactive instead of going to zero.
I hope someone can explain this behaviour and tell me how to get a constant value when active and a zero when inactive.
Kind regard, Lex van Rijswijk The Netherlands
EDIT: I use Matlab 2009B. The setup of the function-call block looks like this; Trigger type: Function-call States when enabling: reset (also tried 'held') Propogate sizes...: During execution Sample time type: triggered

Answers (0)

Categories

Find more on Complex Logic in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!