Error message when using timers in AppDesigner after a few seconds running
I’m quite new to using timers in Matlab, and currently I’m running a project that will need them to continuously update some info in our App Designer window. The problem is, I followed the instructions in this tutorial from Matlab and initially my timer and callback function work normally. But after some time of it running I receive the following error message:
Error while evaluating TimerFcn for timer ‘timer-1’
Not enough input arguments.
I currently initialize my timer in the startupFcn of the app as:
function startupFcn(app)
global params
app.textbox_Log.Value = {‘Start’};
app.timerCounter1sec = 0;
app.timerCounter10sec = 0;
app.logStatus = ‘running’;
app.timer500ms = timer(‘Period’,0.5,…
‘ExecutionMode’, ‘fixedSpacing’, …
‘TasksToExecute’, Inf, …
‘BusyMode’, ‘drop’, …
‘TimerFcn’, @app.timerTest);
start(app.timer500ms);
updateJobList(app, params);
fillJobsTable(app, params);
end
And my callback function is defined as the following (I will omit the code for now since I don’t think it’s that important right now):
function timerTest(app,~,~)
% Function details…
end
Can someone help me with this? I have no clue of what is happening to throw this error in the timer, even considering that it works for around 3-4 seconds before breaking.I’m quite new to using timers in Matlab, and currently I’m running a project that will need them to continuously update some info in our App Designer window. The problem is, I followed the instructions in this tutorial from Matlab and initially my timer and callback function work normally. But after some time of it running I receive the following error message:
Error while evaluating TimerFcn for timer ‘timer-1’
Not enough input arguments.
I currently initialize my timer in the startupFcn of the app as:
function startupFcn(app)
global params
app.textbox_Log.Value = {‘Start’};
app.timerCounter1sec = 0;
app.timerCounter10sec = 0;
app.logStatus = ‘running’;
app.timer500ms = timer(‘Period’,0.5,…
‘ExecutionMode’, ‘fixedSpacing’, …
‘TasksToExecute’, Inf, …
‘BusyMode’, ‘drop’, …
‘TimerFcn’, @app.timerTest);
start(app.timer500ms);
updateJobList(app, params);
fillJobsTable(app, params);
end
And my callback function is defined as the following (I will omit the code for now since I don’t think it’s that important right now):
function timerTest(app,~,~)
% Function details…
end
Can someone help me with this? I have no clue of what is happening to throw this error in the timer, even considering that it works for around 3-4 seconds before breaking. I’m quite new to using timers in Matlab, and currently I’m running a project that will need them to continuously update some info in our App Designer window. The problem is, I followed the instructions in this tutorial from Matlab and initially my timer and callback function work normally. But after some time of it running I receive the following error message:
Error while evaluating TimerFcn for timer ‘timer-1’
Not enough input arguments.
I currently initialize my timer in the startupFcn of the app as:
function startupFcn(app)
global params
app.textbox_Log.Value = {‘Start’};
app.timerCounter1sec = 0;
app.timerCounter10sec = 0;
app.logStatus = ‘running’;
app.timer500ms = timer(‘Period’,0.5,…
‘ExecutionMode’, ‘fixedSpacing’, …
‘TasksToExecute’, Inf, …
‘BusyMode’, ‘drop’, …
‘TimerFcn’, @app.timerTest);
start(app.timer500ms);
updateJobList(app, params);
fillJobsTable(app, params);
end
And my callback function is defined as the following (I will omit the code for now since I don’t think it’s that important right now):
function timerTest(app,~,~)
% Function details…
end
Can someone help me with this? I have no clue of what is happening to throw this error in the timer, even considering that it works for around 3-4 seconds before breaking. timer, appdesigner, app designer, handles, error, input argument MATLAB Answers — New Questions