<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169358</link>
    <title>MATLAB Central Newsreader - timer and callback routine</title>
    <description>Feed for thread: timer and callback routine</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 15 May 2008 23:34:02 -0400</pubDate>
      <title>timer and callback routine</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169358#432393</link>
      <author>Paul </author>
      <description>I've trying to code a timer that will start a data&lt;br&gt;
acquisition  program at a certain time.  &lt;br&gt;
&lt;br&gt;
The problem I have is that the callback function in the&lt;br&gt;
timer routine is just that ... a call to a 'function'. &lt;br&gt;
Therefore the more general question would be:  how to&lt;br&gt;
execute a callback 'program' and not a 'function'.  Or&lt;br&gt;
should I just somehow rewrite the data acquisition program&lt;br&gt;
to look like a function?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 16 May 2008 03:04:01 -0400</pubDate>
      <title>Re: timer and callback routine</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169358#432414</link>
      <author>helper </author>
      <description>"Paul " &amp;lt;par@ceri.memphis.edu&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0ih9a$brn$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I've trying to code a timer that will start a data&lt;br&gt;
&amp;gt; acquisition  program at a certain time.  &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The problem I have is that the callback function in the&lt;br&gt;
&amp;gt; timer routine is just that ... a call to a 'function'. &lt;br&gt;
&amp;gt; Therefore the more general question would be:  how to&lt;br&gt;
&amp;gt; execute a callback 'program' and not a 'function'.  Or&lt;br&gt;
&amp;gt; should I just somehow rewrite the data acquisition program&lt;br&gt;
&amp;gt; to look like a function?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
What you are calling a "program" is typically referred to &lt;br&gt;
as a "script"...and yes, rewrite it to be a function.  And &lt;br&gt;
it isn't difficult.  At the very first line of your &lt;br&gt;
script/program, add the line:&lt;br&gt;
&lt;br&gt;
function MyDAQFunction&lt;br&gt;
&amp;lt;add script code here&amp;gt;&lt;br&gt;
&lt;br&gt;
Then set the "TimerFcn" property of the timer to "@(x,y)&lt;br&gt;
MyDAQFunction" (without the quotes).  Oh, also be sure to &lt;br&gt;
save the function as the name "MyDAQFunction.m".  It is the &lt;br&gt;
name it is saved as that matters, not the name after the &lt;br&gt;
FUNCTION keyword.&lt;br&gt;
&lt;br&gt;
Function created!  Good luck&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
