<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I disable Callbacks in CVI in LabWindows/CVI</title>
    <link>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299449#M20002</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Good option that macro! &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://ni.lithium.com/i/smilies/16x16_smiley-wink.gif" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;
&lt;P&gt;In case you do prefere some actual instruction instead of a macro, you can use BeingDebuggedByCVI () which returns 1 if the program is running in the IDE. So you can setup the timer with this instruction:&lt;/P&gt;
&lt;P&gt;SetCtrlAttribute (your_panel, your_timer_control, ATTR_ENABLED, !BeingDebuggedByCVI());&lt;/P&gt;</description>
    <pubDate>Tue, 13 Dec 2005 17:12:19 GMT</pubDate>
    <dc:creator>RobertoBozzolo</dc:creator>
    <dc:date>2005-12-13T17:12:19Z</dc:date>
    <item>
      <title>How do I disable Callbacks in CVI</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299313#M19993</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;OK, funny questions I hear you say.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Well it is and it ins't. The scenario I have is as follows:-&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I have a UIR that has a panel that has several callbacks, one of which is a Timer callback.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;This UIR is used by several programs, some being debugged and some running live.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Now, when I am debugging a program the Timer callback keeps interrupting my debugging train of thought, i.e. it keeps interupting me whilst I'm looking at variables etc.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Is there a way I can disable the effect of the Timer callback for only the program I am debugging, i.e. by setting a variable call debug so that when it is true the Timer callback doesn't interrupt me, but when set to false the Timer acts as normal.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I could just set the timer to a different interval, but this would upset those programs running live.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I would like to stop the callback from being executed as even the interupt of doing nothing still upsets the debugging of a program.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Any suggestions greatfully received, before I lose too much hair.&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Dec 2005 14:03:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299313#M19993</guid>
      <dc:creator>Baldy_Bloke</dc:creator>
      <dc:date>2005-12-13T14:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable Callbacks in CVI</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299352#M19996</link>
      <description>&lt;DIV&gt;Hello,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;the way I should do this is by using a definition. At the beginning of your main program you can write for example:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;#define DBG_NO_TIMER&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;When you're not debugging, mark this out using the '//' signs.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Then later in your code just insert the lines:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;#ifdef DBG_NO_TIMER&lt;/DIV&gt;
&lt;DIV&gt;SetCtrlAttribute (your_panel, your_timer_control, ATTR_ENABLED, FALSE);&lt;/DIV&gt;
&lt;DIV&gt;#endif&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I hope this gets you on your way...&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Dec 2005 15:12:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299352#M19996</guid>
      <dc:creator>Wim S</dc:creator>
      <dc:date>2005-12-13T15:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable Callbacks in CVI</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299432#M19999</link>
      <description>If you're debugging a debug build while other people are using a release build you can use the predefined macro _CVI_DEBUG_.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="noindex"&gt;&lt;DIV&gt;#ifdef _CVI_DEBUG_&lt;/DIV&gt;
&lt;DIV&gt;SetCtrlAttribute (your_panel, your_timer_control, ATTR_ENABLED, FALSE);&lt;/DIV&gt;
&lt;DIV&gt;#endif // _CVI_DEBUG_&lt;BR /&gt;&lt;BR /&gt;From the help file:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN id="monospace"&gt;_CVI_DEBUG_&lt;/SPAN&gt; is defined if you enable 
&lt;STRONG&gt;Build»Configuration»Debug&lt;/STRONG&gt; in the Workspace window. The value of 
the macro is 1.&lt;BR /&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Dec 2005 17:01:03 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299432#M19999</guid>
      <dc:creator>daijoubu</dc:creator>
      <dc:date>2005-12-13T17:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable Callbacks in CVI</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299449#M20002</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Good option that macro! &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://ni.lithium.com/i/smilies/16x16_smiley-wink.gif" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;
&lt;P&gt;In case you do prefere some actual instruction instead of a macro, you can use BeingDebuggedByCVI () which returns 1 if the program is running in the IDE. So you can setup the timer with this instruction:&lt;/P&gt;
&lt;P&gt;SetCtrlAttribute (your_panel, your_timer_control, ATTR_ENABLED, !BeingDebuggedByCVI());&lt;/P&gt;</description>
      <pubDate>Tue, 13 Dec 2005 17:12:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299449#M20002</guid>
      <dc:creator>RobertoBozzolo</dc:creator>
      <dc:date>2005-12-13T17:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable Callbacks in CVI</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299754#M20029</link>
      <description>&lt;P&gt;Thanks for the suggestions.&lt;/P&gt;
&lt;P&gt;The one thought I have with the proposed suggestions is: -&lt;/P&gt;
&lt;P&gt;As the UIR is not part of the executable and is available for all programs to see and use, if one program disables the Timer on the UIR will this not be disable the Timer&amp;nbsp;for all programs that access this UIR, or is the Timer activation / de-activation&amp;nbsp;only performed on a per program basis?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2005 09:41:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299754#M20029</guid>
      <dc:creator>Baldy_Bloke</dc:creator>
      <dc:date>2005-12-14T09:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable Callbacks in CVI</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299766#M20030</link>
      <description>&lt;P&gt;Don't worry about that. A UIR file is only read by a program. It will not be modified.&lt;/P&gt;
&lt;P&gt;The UIR file is read into a program with the LoadPanel function. If later in this program settings of timers, buttons or whatever are changed, this does not affect the UIR file. So when another program loads this UIR file, it is loaded with the original settings.&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Dec 2005 10:07:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/299766#M20030</guid>
      <dc:creator>Wim S</dc:creator>
      <dc:date>2005-12-14T10:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I disable Callbacks in CVI</title>
      <link>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/301735#M20149</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;I don't really have much to add to this discussion except for a rather general recommendation.&lt;/P&gt;
&lt;P&gt;I would&amp;nbsp;suggest using an asynchronous timer instead of the timer control on a panel in a UIR file. Asynchronous timers run in their own threads and are much more reliable (and predictable). UIR timers can miss firing their callbacks if the system is busy processing other events. The asynchronous timer will not do this as it is running in its own thread with its own processor time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2005 22:07:05 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabWindows-CVI/How-do-I-disable-Callbacks-in-CVI/m-p/301735#M20149</guid>
      <dc:creator>MJF</dc:creator>
      <dc:date>2005-12-19T22:07:05Z</dc:date>
    </item>
  </channel>
</rss>

