<?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: Events counting and timing. in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066314#M1167775</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/7614"&gt;@altenbach&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(You could also take the tick count difference and divide by 1000, but you need to ensure that the max time between pushes is below 2^32ms, about 49 days)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is a bit off topic, but..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think going over 2^32 ms in this case doesn't matter as long as you keep the data in the same representation. If you get to where that happens your result&amp;nbsp;&lt;EM&gt;should&lt;/EM&gt; be a negative number, but because LabVIEW is representing it unsigned and the sign bit is not even in the data anymore you will get the correct answer. Hard to explain but I think it's best shown as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Approaching the maximum value for a U32&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="U32 Subtract 1.png" style="width: 354px;"&gt;&lt;img src="https://ip1.i.lithium.com/ec73a4ed42551a8d35858207f7724c1dec6a027c/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373030373269414130353830374431373036464139362f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="U32 Subtract 1.png" alt="U32 Subtract 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Larger number has rolled over and started counting up from 0, but subtract still gives the "right" (wrong?) answer.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="U32 Subtract 2.png" style="width: 355px;"&gt;&lt;img src="https://ip1.i.lithium.com/c3b4dbfcfefcb79e0f15c5a2f39d4a31ed3766e4/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373030373369423737433533373831453937443146352f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="U32 Subtract 2.png" alt="U32 Subtract 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jul 2020 18:44:36 GMT</pubDate>
    <dc:creator>StevenD</dc:creator>
    <dc:date>2020-07-09T18:44:36Z</dc:date>
    <item>
      <title>Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066205#M1167718</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I’m building a program to count how many times I pressed the button and a timer that counts and displays the seconds (to 3 decimal places) between times that the button was pressed. So far, I was able to construct a simple VI to count the number of presses however, I’m struggling to Implement a timer that counts and displays the seconds between times the button was pressed. I would really appreciate any correction or feedback to point me in the right direction. My VI is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 14:12:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066205#M1167718</guid>
      <dc:creator>Aladdin2020</dc:creator>
      <dc:date>2020-07-09T14:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066220#M1167727</link>
      <description>&lt;P&gt;Hi XDX,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;first i simplified your VI:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://forums.ni.com/ni/attachments/ni/170/1167727/1/check.png" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;One boolean function is enough to look for falling edges…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/590706"&gt;@Aladdin2020&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I’m struggling to Implement a timer that counts and displays the seconds between times the button was pressed.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When the button (which you should give a better label, not just "boolean"!) is pressed you need to store the current timer value in a shift register. In the next iterations you simply subtract the stored timer value from the current value to get the elapsed time…&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 14:54:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066220#M1167727</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2020-07-09T14:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066244#M1167740</link>
      <description>&lt;P&gt;Use a latch action button and high resolution relative time, e.g. as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="altenbach_1-1594308700195.png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/675e8f6012adff45c27ea12413864a161ce938e3/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373030363169424646393246433537363332393338332f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="altenbach_1-1594308700195.png" alt="altenbach_1-1594308700195.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(You could also take the tick count difference and divide by 1000, but you need to ensure that the max time between pushes is below 2^32ms, about 49 days)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I doubt you need milliseconds, though)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 15:39:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066244#M1167740</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2020-07-09T15:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066249#M1167744</link>
      <description>&lt;P&gt;Hi altenbach,&lt;/P&gt;
&lt;P&gt;Thank you for your help! I appreciate your time! Your solution is pretty creative and it’s exactly what I was looking for. So thank you again!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 15:44:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066249#M1167744</guid>
      <dc:creator>Aladdin2020</dc:creator>
      <dc:date>2020-07-09T15:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066253#M1167745</link>
      <description>&lt;P&gt;Make sure to learn about the various mechanical action modes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a switch boolean, here's an easier way to tell whenever it goes from false to true. (no need for a pile of not equal, NOT, AND, etc.).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Similarly, use "less than" to detect TRUE&amp;gt;False transition and "Not equal" to detect any change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="altenbach_0-1594310001361.png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/0b7ff48b9ddcab25288c17805c3e07915ff773ac/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373030363269314235444341423639353742453136422f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="altenbach_0-1594310001361.png" alt="altenbach_0-1594310001361.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 16:03:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066253#M1167745</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2020-07-09T16:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066304#M1167773</link>
      <description>&lt;P&gt;Though &amp;gt; and &amp;lt; operations on booleans in LabVIEW can work, I don't find it as natural as "regular" logic operations.&amp;nbsp; Plus, I still carry some &lt;A href="https://forums.ni.com/t5/LabVIEW/Number-array-to-boolean-array/m-p/4050162/highlight/true#M1161667" target="_blank" rel="noopener"&gt;historic memory&lt;/A&gt;&amp;nbsp;from a time &amp;amp; place where &amp;gt; and &amp;lt; would have failed.&amp;nbsp; I avoid altenbach's "pile" of logic operators by using the "compound arithmetic" node which supports the option for inverting inputs and output individually.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's a better fit for the way I think, to-MAY-to, to-MAH-to and all that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Kevin P&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 668px;"&gt;&lt;img src="https://ip1.i.lithium.com/022457f50e05bceae8f6e4901545900301ee1829/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373030373169453234344532433531423730453842352f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 18:00:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066304#M1167773</guid>
      <dc:creator>Kevin_Price</dc:creator>
      <dc:date>2020-07-09T18:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066314#M1167775</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/7614"&gt;@altenbach&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(You could also take the tick count difference and divide by 1000, but you need to ensure that the max time between pushes is below 2^32ms, about 49 days)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is a bit off topic, but..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think going over 2^32 ms in this case doesn't matter as long as you keep the data in the same representation. If you get to where that happens your result&amp;nbsp;&lt;EM&gt;should&lt;/EM&gt; be a negative number, but because LabVIEW is representing it unsigned and the sign bit is not even in the data anymore you will get the correct answer. Hard to explain but I think it's best shown as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Approaching the maximum value for a U32&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="U32 Subtract 1.png" style="width: 354px;"&gt;&lt;img src="https://ip1.i.lithium.com/ec73a4ed42551a8d35858207f7724c1dec6a027c/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373030373269414130353830374431373036464139362f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="U32 Subtract 1.png" alt="U32 Subtract 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Larger number has rolled over and started counting up from 0, but subtract still gives the "right" (wrong?) answer.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="U32 Subtract 2.png" style="width: 355px;"&gt;&lt;img src="https://ip1.i.lithium.com/c3b4dbfcfefcb79e0f15c5a2f39d4a31ed3766e4/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32373030373369423737433533373831453937443146352f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="U32 Subtract 2.png" alt="U32 Subtract 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 18:44:36 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066314#M1167775</guid>
      <dc:creator>StevenD</dc:creator>
      <dc:date>2020-07-09T18:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066317#M1167776</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/108457"&gt;@StevenD&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Larger number has rolled over and started counting up from 0, but subtract still gives the "right" (wrong?) answer.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You don't have a problem at the rollover also long as the &lt;U&gt;time difference&lt;/U&gt; is less than ~49 days. After that, the displayed time since last push will start again at zero even if the button has not been pressed for ~49 days! An incorrect result.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 19:16:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4066317#M1167776</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2020-07-09T19:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4279317#M1247851</link>
      <description>&lt;P&gt;i want to know what is this and from where i find it ?&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joinde77_0-1674512752540.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/a2c6cd0fa3ac0401f8d2a3024ef4ca22b399a4aa/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33313236383869323133313136413536344335334434332f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="joinde77_0-1674512752540.png" alt="joinde77_0-1674512752540.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 22:26:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4279317#M1247851</guid>
      <dc:creator>joinde77</dc:creator>
      <dc:date>2023-01-23T22:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Events counting and timing.</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4279321#M1247853</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/714755"&gt;@joinde77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i want to know what is this and from where i find it ?&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="joinde77_0-1674512752540.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/a2c6cd0fa3ac0401f8d2a3024ef4ca22b399a4aa/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33313236383869323133313136413536344335334434332f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="joinde77_0-1674512752540.png" alt="joinde77_0-1674512752540.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's a&amp;nbsp;&lt;A href="https://www.ni.com/docs/en-US/bundle/labview/page/feedback-node.html" target="_blank" rel="noopener"&gt;Feedback Node&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 23:44:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Events-counting-and-timing/m-p/4279321#M1247853</guid>
      <dc:creator>ZYOng</dc:creator>
      <dc:date>2025-05-19T23:44:55Z</dc:date>
    </item>
  </channel>
</rss>

