MATLAB Answers

i am facing an error -Error while evaluating TimerFcn for timer 'timer-1' Double inputs must have integer values in the range of ASSUMEDTYPE.,data is not showing continously..:(

조회 수: 14(최근 30일)
Sidharth Pancholi
Sidharth Pancholi 2016년 2월 29일
답변: Abolfazl Nejatian 2020년 8월 15일
i am getting data from teensy3.2 to matlab gui and there is a acquire option for data acquire option
v.timerObj = timer('Period', v.gSecPerScreenRefresh, 'ExecutionMode', 'fixedSpacing', 'timerFcn', {@getDataFromDeviceType});
output=Assuming device is named "COM7", use the Device Manager to show active ports.
Channels available: 8 Device ID register value: 146
ads Data: Recording 7 channels at 4000 Hz attached to port "COM7"
Error while evaluating TimerFcn for timer 'timer-1'
Double inputs must have integer values in the range of ASSUMEDTYPE.
  댓글 수: 10
Walter Roberson
Walter Roberson 2016년 12월 10일
Maria, I recommend that you post that as an Answer so you can be credited for it.

댓글을 달려면 로그인하십시오.


Abolfazl Nejatian
Abolfazl Nejatian 2020년 8월 1일
I have faced with the similar error.
is there any way to use Try/Catch block to handle this kind of error in Timerfcn .
i mean this error happens in a vague situation for me (once in 10 times of run) so the question is is there any way to ignore it?
thanks in advance
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 8월 1일
Are you also using ScopedMath from Arduino? Or from Flock of Birds? Or do you have some other code that is invoking bitshift() ?
You could put in a try/catch block, such as replacing
theSamples(i,samples) = bitshift(theSamples(i,samples),-8);
shifted_output = bitshift(theSamples(i,samples),-8);
catch ME
shifted_output = something; %... what, exactly?
theSamples(i,samples) = shifted_output;
but if you were going to do that, then it seems to me it would make more sense put in some code to help debug the problem.

댓글을 달려면 로그인하십시오.

Abolfazl Nejatian
Abolfazl Nejatian 2020년 8월 15일
in my code, I use many times,
and by changing the current folder this error appears for me.
well, in the second folder i have some java code to parse some data from the OANDA database and during this interaction/ some times i got timerfcn error.
i use pause(.1) after any cd() and then some errors are gone but still some time(it is vague for me when !) i faced with the error.
the bad point is when it faces with error entire of the cycle of timer stop.


아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by