How to disable the stopping of a timer when it executes its TimerFcn

3 ビュー (過去 30 日間)
Zdravko Pavic
Zdravko Pavic 2017 年 5 月 10 日
コメント済み: Zdravko Pavic 2017 年 5 月 10 日
Hello, this is my first question here. For now found every solution i needed I wrote a small software to count some values of my geigercounter. I query some counts via serial port from an arduino nano.
Therefor i have a timer that queries every specific period some counts.
My problem ist, that this specific period is falsified by the time it takes to run the "TimerFcn".
I make this to create the timer:
intervalltimer = timer('TimerFcn',{@intervallfunktion, handles},'Period',Zeitschritt,'ExecutionMode','fixedSpacing','StartDelay',Zeitschritt);
The time it takes to run the function "intervallfunktion" is allways shorter then the period "Zeitschritt". The problem is that the timer stops when the TimerFon is running :/ Is there a way to force the timer not to stop running while the TimerFcn "intervallfunktion" is beeing executed?
Thank You very much! And please apologize my grammar, my English is not that good and I have to use it more often.
Zdravko Pavic

採用された回答

Guillaume
Guillaume 2017 年 5 月 10 日
Simply change the 'ExecutionMode' to 'fixedRate' instead of 'fixedSpacing'. 'fixedSpacing' tells the timer to start counting 'Period' after the TimerFcn returns, so the behaviour you're seeing is as expected.
  1 件のコメント
Zdravko Pavic
Zdravko Pavic 2017 年 5 月 10 日
Thank You Guillaume! This seems to be working good now!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by