Chart Execution by Using Temporal Logic
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a stateflow chart that needs a timer in one of it's transitions. We typically use the after(n,tick) but a new designer has started using after(n,msec). My main question is if this model is running on target hardware how does the code know when after(n,msec) is complete? Is processor time defined anywhere?
0 Commenti
Risposte (1)
Pavan Guntha
il 3 Set 2021
Hello Paul,
The generated code for a stateflow chart which has one of the conditions for state transitions as either 'after(n,tick)' or 'after(n,sec)' indicates that in both the cases a counter is implemented to keep track of time. The only thing changes is the condition which depends on how 'sec' and 'tick' are interpretted. The following example illustrates this idea:
Consider the following stateflow chart:
The generated code for this looks as follows:
If the condition in stateflow chart is changed to 'after(n,tick)' format, the generated code looks as follows:
In both the cases, the stepsize is considered to be 0.2 sec. The conditions in the first case considers how many steps of size 0.2 sec are required to complete 1 sec and 2 sec respectively to make a state transition whereas in second case it considers just the number of steps mentioned in the condition itself (that's how 'ticks' are interpretted).
Hope this helps!
0 Commenti
Vedere anche
Categorie
Scopri di più su Complex Logic in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!