<?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: Running Histogram in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578890#M271237</link>
    <description>Hi squirrel,&lt;BR /&gt;&lt;BR /&gt;to detect changes of a variable you can use a shift register in your while loop and compare the actual value with the value from last iteration. Wire the result to a case structure and do whatever you want in the true case...&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 12 Sep 2007 14:19:13 GMT</pubDate>
    <dc:creator>GerdW</dc:creator>
    <dc:date>2007-09-12T14:19:13Z</dc:date>
    <item>
      <title>Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578798#M271198</link>
      <description>&lt;DIV&gt;I'd like to create 4 separate running histograms selectable by tabs.&amp;nbsp; The part I'm struggling with is how I should have the histogram update...&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;The machine that I am monitoring does not have consistent time cycles.&amp;nbsp; The time cycles range from 21 seconds to 45 seconds, and if an operator takes a break, the time cycle can be up to 35 minutes.&amp;nbsp; Machine downtime can be hours at a time.&amp;nbsp; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;So, I can't specify a time interval for which the histogram will update.&amp;nbsp; Is there a way that I can track a variable and update the histogram when this certain variable changes from 0 to 1?&amp;nbsp; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Sep 2007 12:28:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578798#M271198</guid>
      <dc:creator>Squirrell</dc:creator>
      <dc:date>2007-09-12T12:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578890#M271237</link>
      <description>Hi squirrel,&lt;BR /&gt;&lt;BR /&gt;to detect changes of a variable you can use a shift register in your while loop and compare the actual value with the value from last iteration. Wire the result to a case structure and do whatever you want in the true case...&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Sep 2007 14:19:13 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578890#M271237</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2007-09-12T14:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578908#M271247</link>
      <description>&lt;DIV&gt;Ah!&amp;nbsp; *slaps self in forehead again*&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I must not have had enough coffee this morning..&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thanks!&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Sep 2007 14:41:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578908#M271247</guid>
      <dc:creator>Squirrell</dc:creator>
      <dc:date>2007-09-12T14:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578931#M271253</link>
      <description>&lt;DIV&gt;Ok, now I'm having some problems with the histogram itself.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I have the "Create Histogram" express VI connected to a waveform graph.&amp;nbsp; The signal only hits the histogram vi when the While-Loop allows for it.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Unfortunately, I'm only getting a flat bar going across the histogram.&amp;nbsp; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Sep 2007 15:15:03 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578931#M271253</guid>
      <dc:creator>Squirrell</dc:creator>
      <dc:date>2007-09-12T15:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578961#M271266</link>
      <description>&lt;DIV&gt;Show us your code! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; A VI is worth a thousand words! &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I really&amp;nbsp;don't&amp;nbsp;understand all you technical terms such as "...&lt;STRONG&gt;hits&lt;/STRONG&gt; the histogram...", "...flat bar...",&amp;nbsp;and I have no idea how a while loop can allow or disallow something. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Sep 2007 15:52:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/578961#M271266</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2007-09-12T15:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579080#M271323</link>
      <description>&lt;DIV&gt;I have attached the VI.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I'm almost positive that I'm making this more complicated than it needs to be...&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Ignore the "Flow Value" section.&amp;nbsp; The Test Result section isn't important either- except for "D."&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Basically, I want to record the values of Test Result D in a moving histogram.&amp;nbsp; I ONLY want the histogram to update when "Robot Position 11 Monitor" equals "1."&amp;nbsp;&amp;nbsp; That tag is the only variable in the entire machien that only changes once per cycle.&amp;nbsp; I want the histogram to update once per cycle.&amp;nbsp; So, I figure that the Case Structure with the While Loop will do that for me; update the histogram only when the robot is at position 11.&amp;nbsp; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I hope this makes sense.&amp;nbsp; I'm used to object-based programming, so this is quite a learning experience.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Sep 2007 18:14:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579080#M271323</guid>
      <dc:creator>Squirrell</dc:creator>
      <dc:date>2007-09-12T18:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579135#M271345</link>
      <description>I think the key point you have not understood in making the transition from text based languages to LabVIEW is data flow.   LabVIEW can do OOP, but that is irrelevant to what you are trying to do.  The loop inside the case structure will run as fast as the processor will allow, repeatedly adding the same point (Test Result D, first value) to the histogram until the stop button is pressed.  Then the outer loop will run again and as soon as the Robot position 11 = 1, the same thing will repeat.&lt;BR /&gt;&lt;BR /&gt;Fixes: 1. Get rid of the inner While loop. (The Point by Point Vis ahve an inner loop with a shift register to accumulate values).&lt;BR /&gt;&lt;BR /&gt;2. Use the Histogram Graph output of the Histogrm VI.  It does exactly the same thing internally as you do to connect to the graph.  Open it up and take a look.&lt;BR /&gt;&lt;BR /&gt;3. Use equality testing (Robot Postion 11) in real number with great caution.  Due to finite precision representation in the computer, the number 1 could be internally represented as 0.9999999982 which is NOT = 1. Use the In Range and Coerce with suitable tolerances.&lt;BR /&gt;&lt;BR /&gt;4.  This is personal preference, but I like the In Range and Coerce primitive much better than the In Range express.  It uses less diagarm space and the limit values are visible on the diagram rather than being hidden inside the config dialog.&lt;BR /&gt;&lt;BR /&gt;5. The front panel was huge.  Scrolling for 5 minutes to find the other controls does not make a very good user interface. You can put descriptive names on the tabs.&lt;BR /&gt;&lt;BR /&gt;Lynn</description>
      <pubDate>Wed, 12 Sep 2007 19:24:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579135#M271345</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2007-09-12T19:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579136#M271346</link>
      <description>&lt;DIV&gt;All you need to do is &lt;STRONG&gt;delete the inner while loop&lt;/STRONG&gt; (inside the case structure) and it's stop button.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Right now, the inner loop spins at infinite speed while reading the same value from the input tunnel over ond over, and blocking iteration of the big while loop at the same time.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Then you should also add a small wait in the big loop (10-100ms) so the loop does not spin out of control.&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Sep 2007 19:25:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579136#M271346</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2007-09-12T19:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579167#M271361</link>
      <description>&lt;DIV&gt;Fixes: 1. Get rid of the inner While loop. (The Point by Point Vis ahve an inner loop with a shift register to accumulate values).&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;I did that, and the histogram reset after plotting a single value.&amp;nbsp; I tried copying the pt by pt histogram VI into that, and yet it still does not accumulate values.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;2. Use the Histogram Graph output of the Histogrm VI. It does exactly the same thing internally as you do to connect to the graph. Open it up and take a look.&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;Will do&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;3. Use equality testing (Robot Postion 11) in real number with great caution. Due to finite precision representation in the computer, the number 1 could be internally represented as 0.9999999982 which is NOT = 1. Use the In Range and Coerce with suitable tolerances.&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;In this case, it is True or False coming in from the PLC.&amp;nbsp; If I place a numeric indicator on it with 0.00000001 accuracy, it is still 1 or 0.&amp;nbsp; That's why I use it. However, your point is very valid and it was a good reminder, so thank you.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;4. This is personal preference, but I like the In Range and Coerce primitive much better than the In Range express. It uses less diagarm space and the limit values are visible on the diagram rather than being hidden inside the config dialog.&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;I agree. &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;&lt;/FONT&gt;&lt;BR /&gt;5. The front panel was huge. Scrolling for 5 minutes to find the other controls does not make a very good user interface. You can put descriptive names on the tabs.&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#ff0000"&gt;I know; I did that on purpose so it would focus on the histogram for now.&amp;nbsp; I would never implement something like that for our operators...&amp;nbsp; &lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 12 Sep 2007 20:08:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579167#M271361</guid>
      <dc:creator>Squirrell</dc:creator>
      <dc:date>2007-09-12T20:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579175#M271364</link>
      <description>Re: 1.  Are you sure that you are feeding new data in on each iteration?  With the VI you posted the data comes from a control. Unless you change the value of that control for each iteration, the loop will process the same data repeatedly (and as Altenbach pointed out much faster than an operator could change the control).  I presumed that you had some mechanism for entering meaningful data which was not posted, but maybe that is where the problem is.&lt;BR /&gt;&lt;BR /&gt;If you run with executiom highlighting on (the light bulb on the diagram toolbar), you can see what the program is doing including the values on the wires at each time.&lt;BR /&gt;&lt;BR /&gt;Try that and let us know whether the data is changing.&lt;BR /&gt;&lt;BR /&gt;Lynn</description>
      <pubDate>Wed, 12 Sep 2007 20:20:58 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579175#M271364</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2007-09-12T20:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579486#M271470</link>
      <description>&lt;DIV&gt;"If you run with executiom highlighting on (the light bulb on the diagram toolbar), you can see what the program is doing including the values on the wires at each time."&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I did that, but since the tag for the robot position 11 changes abruptly, I can't time the execution right.&amp;nbsp; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Is there another way of doing this?&amp;nbsp; &lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Sep 2007 11:42:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579486#M271470</guid>
      <dc:creator>Squirrell</dc:creator>
      <dc:date>2007-09-13T11:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Running Histogram</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579765#M271598</link>
      <description>Try a conditional probe, set to Pause if the condition is met.  Break points can be useful also.  You would need to put it inside the case structure so the loop doesnot pause on every iteration.&lt;BR /&gt;&lt;BR /&gt;Lynn</description>
      <pubDate>Thu, 13 Sep 2007 17:46:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Running-Histogram/m-p/579765#M271598</guid>
      <dc:creator>johnsold</dc:creator>
      <dc:date>2007-09-13T17:46:51Z</dc:date>
    </item>
  </channel>
</rss>

