<?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: local variable doesn't update in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648112#M591237</link>
    <description>&lt;P&gt;I would do this with two event structures both looking for the stop button. You never miss it that way and you are not constantly polling. More efficient code.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jul 2011 13:19:52 GMT</pubDate>
    <dc:creator>aeastet</dc:creator>
    <dc:date>2011-07-26T13:19:52Z</dc:date>
    <item>
      <title>local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1647880#M591193</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the example below the upper loop doesn't always update the value of the stop-control. why is that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 09:16:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1647880#M591193</guid>
      <dc:creator>labviewette</dc:creator>
      <dc:date>2011-07-26T09:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1647902#M591198</link>
      <description>&lt;P&gt;The Variable reads the Value of the Control every 900 ms. So If you don't hold the stop button that long, the variable doesn't read the value of the button.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 09:38:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1647902#M591198</guid>
      <dc:creator>PeterFoerster</dc:creator>
      <dc:date>2011-07-26T09:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1647934#M591205</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for the reply.&lt;/P&gt;
&lt;P&gt;in the end i solved this issue by introducing a new variable and setting its property "value-signaling" to the value of the stop button, then reading the value of this variable in the second loop via property node "value". is there another, more appealing solution for this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 10:26:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1647934#M591205</guid>
      <dc:creator>labviewette</dc:creator>
      <dc:date>2011-07-26T10:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648100#M591231</link>
      <description>&lt;P&gt;As I understand you shouldn't read Data by property node, as that's a much slower way than the local variable. (At least that's what I've always been told)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to be sure that you read every value change of a control you can use a queue. But if you use queues, the reading loops should always be faster than the writing ones. Using a queue to stop parallel loops is like using a tank to go hunting, though.&lt;/P&gt;
&lt;P&gt;You could also try an event triggered approach. It really depends on what you want to do, really.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;your second post said something about another indicator. Does your VI look a little like this then?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 13:15:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648100#M591231</guid>
      <dc:creator>PeterFoerster</dc:creator>
      <dc:date>2011-07-26T13:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648112#M591237</link>
      <description>&lt;P&gt;I would do this with two event structures both looking for the stop button. You never miss it that way and you are not constantly polling. More efficient code.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 13:19:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648112#M591237</guid>
      <dc:creator>aeastet</dc:creator>
      <dc:date>2011-07-26T13:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648120#M591238</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/99506"&gt;@aeastet&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I would do this with two event structures both looking for the stop button. You never miss it that way and you are not constantly polling. More efficient code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Isn't 2 event structures in a single VI on the list of dangerous no-no's?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 13:22:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648120#M591238</guid>
      <dc:creator>Taki1999</dc:creator>
      <dc:date>2011-07-26T13:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648122#M591239</link>
      <description>&lt;P&gt;That's right, you can use the timeout event to time the loop.&lt;/P&gt;
&lt;P&gt;However that timing isn't really accurate over longer periods of time.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 13:22:40 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648122#M591239</guid>
      <dc:creator>PeterFoerster</dc:creator>
      <dc:date>2011-07-26T13:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648216#M591266</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/109945"&gt;@Taki1999&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/99506"&gt;@aeastet&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I would do this with two event structures both looking for the stop button. You never miss it that way and you are not constantly polling. More efficient code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Isn't 2 event structures in a single VI on the list of dangerous no-no's?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Only if you don't know what you are doing and don't set them up properly.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 14:03:35 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648216#M591266</guid>
      <dc:creator>RavensFan</dc:creator>
      <dc:date>2011-07-26T14:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648230#M591269</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your feedback. here is what i did.&lt;/P&gt;
&lt;P&gt;although the property node is supposed to be slower than local variables, it suffices in this case.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 14:07:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648230#M591269</guid>
      <dc:creator>labviewette</dc:creator>
      <dc:date>2011-07-26T14:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648344#M591288</link>
      <description>&lt;P&gt;That "solution" is no better than your original. Using a property node instead of a local variable gains you absolutely nothing. A property node requires a thread switch to the user interface thread. In some cases this can cause huge performance impacts. I don't know why you don't want to use an event structure. Are you using LabVIEW Base which has no access to event structures? If you must use loops, then a better way to handle a loop that has a long loop time is to actually have the loop time short and then use a case structure to determine if it's time to execute the loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this, for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/591288/4/parallel%20loops%20MOD_BD.png" border="0" alt="" title="" align="middle" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 14:53:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648344#M591288</guid>
      <dc:creator>smercurio_fc</dc:creator>
      <dc:date>2011-07-26T14:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648444#M591301</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/33243"&gt;@smercurio_fc&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;That "solution" is no better than your original. Using a property node instead of a local variable gains you absolutely nothing. A property node requires a thread switch to the user interface thread. In some cases this can cause huge performance impacts. I don't know why you don't want to use an event structure. Are you using LabVIEW Base which has no access to event structures? If you must use loops, then a better way to handle a loop that has a long loop time is to actually have the loop time short and then use a case structure to determine if it's time to execute the loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this, for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/591288/4/parallel%20loops%20MOD_BD.png" border="0" alt="" title="" align="middle" /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It would also be a good idea to place the stop local variable in a sequence structure and read its value AFTER all your processing is completed. Otherwise you run the risk of doing an extra loop iteration. As written above there is a very high probability the local variable very early in the loop.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 15:23:56 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648444#M591301</guid>
      <dc:creator>Mark_Yedinak</dc:creator>
      <dc:date>2011-07-26T15:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648458#M591303</link>
      <description>&lt;P&gt;This is an easy way and it does not depend on loop time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://forums.ni.com/t5/image/serverpage/image-id/48862iE60BBF7EAF85BEC7/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" alt="Example_VI_BD.png" title="Example_VI_BD.png" align="middle" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 15:28:39 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648458#M591303</guid>
      <dc:creator>aeastet</dc:creator>
      <dc:date>2011-07-26T15:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648488#M591310</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/99506"&gt;@aeastet&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;This is an easy way and it does not depend on loop time.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is similar &lt;A href="http://forums.ni.com/t5/LabVIEW/stopping-programs-multiple-loops/m-p/252274#M136388" target="_self"&gt;to this&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would use value changed and keep the button at the latch mechanical action. Remember, you only need an event structure in the "other loop" (the one without the stop button). The loop with the stop button can be polling normally.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://forums.ni.com/ni/attachments/ni/170/591310/1/multistop.png" border="0" alt="" title="" align="center" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 15:52:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648488#M591310</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2011-07-26T15:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648498#M591313</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/2210"&gt;@Mark&lt;/a&gt; Yedinak wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;It would also be a good idea to place the stop local variable in a sequence structure and read its value AFTER all your processing is completed. Otherwise you run the risk of doing an extra loop iteration. As written above there is a very high probability the local variable very early in the loop.&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's a valid point, though the intent of the example was just to show the technique of how to deal with loop times that are supposed to run with a long duration, but still have a responsive UI. I still think the best solution is to use an event structure, and I don't quite understand the OP's apparent reluctance in doing so. &lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 15:51:30 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648498#M591313</guid>
      <dc:creator>smercurio_fc</dc:creator>
      <dc:date>2011-07-26T15:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648502#M591314</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/33243"&gt;@smercurio_fc&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/2210"&gt;@Mark&lt;/a&gt; Yedinak wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;It would also be a good idea to place the stop local variable in a sequence structure and read its value AFTER all your processing is completed. Otherwise you run the risk of doing an extra loop iteration. As written above there is a very high probability the local variable very early in the loop.&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's a valid point, though the intent of the example was just to show the technique of how to deal with loop times that are supposed to run with a long duration, but still have a responsive UI. I still think the best solution is to use an event structure, and I don't quite understand the OP's apparent reluctance in doing so.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I agree, the event structure is defintely the preferred choice. I also like to use queues/notifiers. This gives an added benefit that messages can be sent which allows more than just a Stop.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2011 15:53:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1648502#M591314</guid>
      <dc:creator>Mark_Yedinak</dc:creator>
      <dc:date>2011-07-26T15:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: local variable doesn't update</title>
      <link>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1649662#M591521</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks all for the loads of ideas !&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2011 14:03:38 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/local-variable-doesn-t-update/m-p/1649662#M591521</guid>
      <dc:creator>labviewette</dc:creator>
      <dc:date>2011-07-27T14:03:38Z</dc:date>
    </item>
  </channel>
</rss>

