|
Hello everyone, I have a serious problem with my project: I cant find a way to make Simulink wait a certain amount of seconds.
The project is about inflating an item in steps, so for example: inflate to 0.5 bar, pause for 30 seconds, inflate again to 1 bar, pause for 30 seconds, and so on.
I have a "do while" cycle inside a "for" cycle. The "for" cycle is set out to run for the number of inflating steps needed; inside the "do while" I have a condition that, while its verified, sends an analog output signal to open a valve and when the condition is false, the valve will be closed and the "do while" cycle ends. Now the problem is that, before the "do while" ends, I must have a pause, before the next inflating step begin.
I've tried in many ways:
- anything that involve simulink "clock" cannot be used cause it uses continous sample time and inside iteration cycles only (inf) or inherited (-1) can be used.
- I created a matlab script that works pretty well with "datestr(now)" command; in matlab command window runs perfectly, but if I put it in a Simulink Embedded Matlab Function block and try to built it gives me various incompatible errors.
Any ideas? I cant belive a so powerful software like Simulink cannot take a giving time pause during the simulation inside an iteration cycle...
Thank you
|