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

not stop timertimertimerfonwhile running

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

Best Answer

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.