Timer function and standalone display issues

1 view (last 30 days)
I have a rather large program, that has at one point a timer object. The issue I'm facing is the following: The following code segment
disp('starting')
start(timerobj)
disp('started')
where the timerfnc of the timerobj also displays text as first task - yields only starting started
But all text, that is displayed in the timerobj does not work. All other stuff in the timer works (the hardware communication, the GUI-interaction, everything) except for the display (or fprintf) commands. This happens in the standalone-compiled version, whoever, when I perform this in MATLAB (R2007b or R2010b, same probs) it works.
Does anyone have an idea where the issue might be?
Regards RS
  1 Comment
Robert Stettler
Robert Stettler on 13 Mar 2015
So I found the issue: In this large project, there was a java import for something entirely different, but that went wrong for some reason. And for even more unclear reasons, that failed import caused the issue. Long story short: when I remove all java imports, then it works.

Sign in to comment.

Accepted Answer

Sebastian Castro
Sebastian Castro on 11 Mar 2015
If your timer takes much longer to compute than the period you allow it, I can see why MATLAB would hang up and never be able to make it past the start of the timer. Recall that MATLAB is single-threaded (unless you're using Parallel Computing Toolbox functionality).
I would try the following things:
  1. Replace your timer function with (almost) blank code, i.e., something that runs really fast. Does MATLAB get to the "disp('started')" line?
  2. Increase the period of the timer to something really big, and then try bringing it down from there until your timer function can comfortably finish in the specified time.
- Sebastian
  1 Comment
Robert Stettler
Robert Stettler on 12 Mar 2015
Hi Sebastian
First of all: Thank you for your answer. Unfortunately, your suggestions don't work. I already tried them without luck. The biggest issue here is, everything works just fine, all the commands in the timer are executed correctly EXCEPT for the prints! The tool just continues to work, hours after I start the timer, but as I said, the "command window" (in standalone a DOS-window) remains empty. Something more, the DOS-window is not even crashed, I responds fine without delay, just stops printing stuff.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!