<?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: Reset Switch Buttons when VI closes in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041883#M463528</link>
    <description>&lt;P&gt;You have a classic race condition. Since there is no data dependency, writing to the locals occurs in parallel with the execution of the while loop. LabVIEW does NOT execute left-to-right. Execution order is entirely dictated by dataflow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no need for sequence frames and such. Simply place the FALSE diagram constant inside the loop and wire to the two locals outside the loop. This data dependency ensures that the locals cannot be written until the&amp;nbsp;while loop&amp;nbsp;has completed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Think dataflow! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Othere things make little sense: for example why do you need to unbundle the status with every iteration of the loop? That operation belongs before the loop, in fact you should bypass the loop if the status is true.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2009 17:51:48 GMT</pubDate>
    <dc:creator>altenbach</dc:creator>
    <dc:date>2009-12-17T17:51:48Z</dc:date>
    <item>
      <title>Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041803#M463494</link>
      <description>How can you reset switch buttons when you close the VI.&amp;nbsp; The problem that I experience is that the two buttons that I want to reset back to false control the exit of other loops and essentially the program.&amp;nbsp; I have tried using sequence structures and it will reset the switch value but it will not exit the program then because the two buttons that I need to be reset will not allow me to exit the program because they are now false.&amp;nbsp; I have used local variables with these buttons so I can not use latch which is unfortunate.&amp;nbsp; Does anyone have an suggestions?</description>
      <pubDate>Thu, 17 Dec 2009 16:18:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041803#M463494</guid>
      <dc:creator>rwm11</dc:creator>
      <dc:date>2009-12-17T16:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041811#M463496</link>
      <description>&lt;P&gt;Your description is not clear. Can you show us some code, or at least a picture of it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why would a button state prevent exiting the program? Makes no sense! &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2009 16:26:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041811#M463496</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-12-17T16:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041813#M463497</link>
      <description>&lt;P&gt;Set the button to the desired state (T/F). On the front panel, right click on the button. Select Data Operations/Make Current Value Default. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise you can use a sequence structure to set the value with a local variable in the 0th frame and run your loops in the 1st frame.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2009 16:28:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041813#M463497</guid>
      <dc:creator>Willy2a</dc:creator>
      <dc:date>2009-12-17T16:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041816#M463499</link>
      <description>You may create a local variable for each control, and wire the value at which you want it to be initialized. Make sure your initialization is placed outside any loop/structure.</description>
      <pubDate>Thu, 17 Dec 2009 16:30:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041816#M463499</guid>
      <dc:creator>xdaf</dc:creator>
      <dc:date>2009-12-17T16:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041819#M463501</link>
      <description>Willy, I believe your first solution will work only if you close the VI, then open it again.&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by xdaf on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 12-17-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 05:33 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Dec 2009 16:33:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041819#M463501</guid>
      <dc:creator>xdaf</dc:creator>
      <dc:date>2009-12-17T16:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041824#M463505</link>
      <description>I believe you want to create an event structure that catches the method you use to terminate the application. In the event structure you can set the values you want. I personally set all the critical values on startup. It guarantees the correct operation and is not dependent on any default values being set when you start the program up.</description>
      <pubDate>Thu, 17 Dec 2009 16:36:20 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041824#M463505</guid>
      <dc:creator>Joseph_Loo</dc:creator>
      <dc:date>2009-12-17T16:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041856#M463519</link>
      <description>&lt;P&gt;I have tried several of the suggestions but I cannot get it to work.&amp;nbsp; I have attached the while loop and event structure used to exit the VI.&amp;nbsp; The constant F and two local variables to the right are the variables that I need set to false when the program closes.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;IMG src="file:/C:/DOCUME%7E1/marks/LOCALS%7E1/Temp/moz-screenshot-1.png" border="0" /&gt;</description>
      <pubDate>Thu, 17 Dec 2009 17:16:27 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041856#M463519</guid>
      <dc:creator>rwm11</dc:creator>
      <dc:date>2009-12-17T17:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041860#M463520</link>
      <description>&lt;P&gt;You should include the "write to local variables" on the right inside&amp;nbsp; flat sequence, and wire the loop stop boolean to the structure (by doing so, you force the execution of the flat sequence AFTER you exit the loop).&lt;/P&gt;&lt;P&gt;Anyway, I'm missing something:&amp;nbsp;according to the picture you've posted, your controls should be initialized to false&amp;nbsp;as you launch the program...&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by xdaf on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt;12-17-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 06:22 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by xdaf on &lt;/SPAN&gt;&lt;SPAN class="local-date"&gt; 12-17-2009&lt;/SPAN&gt;&lt;SPAN class="local-time"&gt; 06:22 PM&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Dec 2009 17:22:56 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041860#M463520</guid>
      <dc:creator>xdaf</dc:creator>
      <dc:date>2009-12-17T17:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reset Switch Buttons when VI closes</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041883#M463528</link>
      <description>&lt;P&gt;You have a classic race condition. Since there is no data dependency, writing to the locals occurs in parallel with the execution of the while loop. LabVIEW does NOT execute left-to-right. Execution order is entirely dictated by dataflow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no need for sequence frames and such. Simply place the FALSE diagram constant inside the loop and wire to the two locals outside the loop. This data dependency ensures that the locals cannot be written until the&amp;nbsp;while loop&amp;nbsp;has completed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Think dataflow! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Othere things make little sense: for example why do you need to unbundle the status with every iteration of the loop? That operation belongs before the loop, in fact you should bypass the loop if the status is true.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2009 17:51:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Reset-Switch-Buttons-when-VI-closes/m-p/1041883#M463528</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2009-12-17T17:51:48Z</dc:date>
    </item>
  </channel>
</rss>

