<?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: program time not stable in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731081#M334635</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;I would be curious if you get error messages.&lt;/P&gt;
&lt;P&gt;I changed it to a state machine which will automatically stop if there is an error detected.&lt;/P&gt;
&lt;P&gt;I also show the current state.&amp;nbsp; For both examples (this one and the last one) I suggest changing the delay to something big like 500 ms so that you can see the transitions.&amp;nbsp; Which is why I changed the constant form 5 to 500 and made it a control.&lt;/P&gt;
&lt;P&gt;I suspect that it 5 ms is way to small a value, so we need to find out when it becomes unstable. &lt;/P&gt;
&lt;P&gt;Try it out and post feedback&lt;/P&gt;
&lt;P&gt;RayR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jun 2008 21:43:34 GMT</pubDate>
    <dc:creator>Ray.R</dc:creator>
    <dc:date>2008-06-24T21:43:34Z</dc:date>
    <item>
      <title>program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730288#M334263</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;I try to make a program to create a pulsed voltage with a power supply. To get the pulse I have to enable and disable the output of the power supply. The problem is, that the frequency I get is not stable except the highes frequency. The frequency is limited by the power supply. Due to this I can say, that the instability is caused by LabVIEW. If I set the Wait time (see attached VI) to 0 the frequency is stable. But if I insert a value I get an instability. &lt;BR /&gt;Is there any chance to get a stable frequenz?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Jun 2008 22:53:20 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730288#M334263</guid>
      <dc:creator>Intern01</dc:creator>
      <dc:date>2008-06-23T22:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730296#M334268</link>
      <description>&lt;DIV&gt;You will not get precision timing because there is noway of forcing order between the Wait and the command to the instrument.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;RayR&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Jun 2008 23:26:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730296#M334268</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-06-23T23:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730304#M334273</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;I've modified your code and provide explanation with reference to the attached image.&lt;/P&gt;
&lt;P&gt;Let's look at a few scenarios:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; A1 is first, B1 then B2 followed by A2 repeat.&lt;/P&gt;
&lt;P&gt;Sends OFF, 10 ms later Sends ON, 0ms sends OFF 10ms later sends ON... And then it might be 5ms ON then OFF 5ms then ON..&amp;nbsp; and random after that.&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;B1 first, A1 next, followed by A2 followed by B2, repeat.&lt;/P&gt;
&lt;P&gt;Waits 5 ms, then OFF command, 0 ms turn ON waits 10 ms then OFF, etc.&lt;/P&gt;
&lt;P&gt;For the other scenarios, just use random possibilities..&amp;nbsp;which is what was going on..&lt;/P&gt;
&lt;P&gt;RayR&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://forums.ni.com/attachments/ni/170/334273/2/Wait.PNG" /&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by JoeLabView on &lt;SPAN class="date_text"&gt;06-23-2008&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;07:38 PM&lt;/SPAN&gt;</description>
      <pubDate>Mon, 23 Jun 2008 23:38:24 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730304#M334273</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-06-23T23:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730309#M334277</link>
      <description>Thank you for the fast answere, but the signal I get is still the same. I still get a signal with the variations. &lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Jun 2008 23:50:29 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730309#M334277</guid>
      <dc:creator>Intern01</dc:creator>
      <dc:date>2008-06-23T23:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730319#M334285</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;I suspected that would happen..&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It is because there is an element that we omitted from the equation, which is the reponse time from the instrument.&lt;/P&gt;
&lt;P&gt;So you need to implement the code in such a way that the time between the ON &amp;amp; OFF times need to be relative to a constant timestamp.&lt;/P&gt;
&lt;P&gt;I'll modify the example to illustrate.&lt;/P&gt;
&lt;P&gt;RayR&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2008 00:06:34 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730319#M334285</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-06-24T00:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730321#M334287</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;See attached example.&amp;nbsp; It uses "Wait Until Next ms Multiple", which will adjust for any deltas in sending the commands.&lt;/DIV&gt;
&lt;DIV&gt;It also has an improved implementation.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Another improvement would be to create a state machine instead of using the Boolean to select the Case.&amp;nbsp; I did it this way for simplicity...&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;RayR&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by JoeLabView on &lt;SPAN class="date_text"&gt;06-23-2008&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;08:16 PM&lt;/SPAN&gt;</description>
      <pubDate>Tue, 24 Jun 2008 00:16:30 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730321#M334287</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-06-24T00:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730971#M334582</link>
      <description>I tried it with your example but no improvement. &lt;BR /&gt;&lt;BR /&gt;Can you give me an example how to create it with a state machine?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Jun 2008 19:16:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/730971#M334582</guid>
      <dc:creator>Intern01</dc:creator>
      <dc:date>2008-06-24T19:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731081#M334635</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;I would be curious if you get error messages.&lt;/P&gt;
&lt;P&gt;I changed it to a state machine which will automatically stop if there is an error detected.&lt;/P&gt;
&lt;P&gt;I also show the current state.&amp;nbsp; For both examples (this one and the last one) I suggest changing the delay to something big like 500 ms so that you can see the transitions.&amp;nbsp; Which is why I changed the constant form 5 to 500 and made it a control.&lt;/P&gt;
&lt;P&gt;I suspect that it 5 ms is way to small a value, so we need to find out when it becomes unstable. &lt;/P&gt;
&lt;P&gt;Try it out and post feedback&lt;/P&gt;
&lt;P&gt;RayR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2008 21:43:34 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731081#M334635</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-06-24T21:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731099#M334644</link>
      <description>Hi, &lt;BR /&gt;&lt;BR /&gt;thanks for your efforts, but the signal is still the same. &lt;BR /&gt;&lt;BR /&gt;I tried it with something very simple maybe stupid. I insert an empty for loop to keep the system busy for a short time, but no change. I think that the times of hand the while loop are not stable. &lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 24 Jun 2008 22:20:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731099#M334644</guid>
      <dc:creator>Intern01</dc:creator>
      <dc:date>2008-06-24T22:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731127#M334657</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;I may have forgotten to mention that the Windows clock (PC) is not very accurate, especially when dealing with milliseconds.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I looked at your code and doubt that having a For Loop running 10000 iterations doing nothing will help.&lt;/P&gt;
&lt;P&gt;Did you try the last example I posted?&amp;nbsp; Did it give any error message(s)?&amp;nbsp; What wait time did you try?&amp;nbsp; Did you try a range of values?&amp;nbsp; Did you start with 500ms?&lt;/P&gt;
&lt;P&gt;I was thinking of putting an indicator which would show the time deltas between the ON &amp;amp; OFF periods.&amp;nbsp; This way, you could monitor where the instability resides.&lt;/P&gt;
&lt;P&gt;RayR&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jun 2008 23:41:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731127#M334657</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-06-24T23:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731551#M334814</link>
      <description>Yes I tried it with your last example. No improvement and no errors. &lt;BR /&gt;&lt;BR /&gt;I thought about he same, that the computer clock is not stable. &lt;BR /&gt;&lt;BR /&gt;Thanks a lot for your help. I talked to my boss and he said I should by the more expensive power supply with a build in pulse module, but let me know if you have another idea for the problem. &lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Jun 2008 14:37:34 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731551#M334814</guid>
      <dc:creator>Intern01</dc:creator>
      <dc:date>2008-06-25T14:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731652#M334862</link>
      <description>One thing...do you guess that the CPU speed is not accurate enough or the speed how Windows handle the program is not accurate?&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Jun 2008 15:50:27 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731652#M334862</guid>
      <dc:creator>Intern01</dc:creator>
      <dc:date>2008-06-25T15:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731742#M334901</link>
      <description>&lt;DIV&gt;It would be more Windows related..&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;However.... if you wanted to try a more exotic trick, there is something you could try..&amp;nbsp; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Are you using a multi-core PC and Labview 8.5?&amp;nbsp; &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;RayR&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Jun 2008 17:30:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731742#M334901</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-06-25T17:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731764#M334913</link>
      <description>I have a Intel Core 2 Duo processor and LabVIEW 8.5.1&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Jun 2008 17:53:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731764#M334913</guid>
      <dc:creator>Intern01</dc:creator>
      <dc:date>2008-06-25T17:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731803#M334932</link>
      <description>&lt;DIV&gt;The other technique I'm thinking of consists of having two loops (two execution threads) where one thread is concerned with turning OFF the power supply and the other one to turn it ON.&amp;nbsp; Each execution thread would be tied to a CPU core and a notifier would tell the other thread when it can execute.&amp;nbsp; Each loop would execute one iteration and wait until the other loop sends a notification to proceed.&amp;nbsp; The delay would be between sending the command to the instrument and before sending the notification.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I'll look for the discussion on this topic.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;RayR&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Jun 2008 18:48:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/731803#M334932</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-06-25T18:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/735263#M336612</link>
      <description>Hey, &lt;BR /&gt;&lt;BR /&gt;It was a good idea and try with the duel core processor, but the problem is, that the computer on which the program should run has no duel core processor. &lt;BR /&gt;Is there any other idea to provent this problem?&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Jul 2008 14:54:28 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/735263#M336612</guid>
      <dc:creator>Intern01</dc:creator>
      <dc:date>2008-07-01T14:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: program time not stable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/735714#M336822</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Timing precision with Windows is not easy...&lt;/P&gt;
&lt;P&gt;I'll have to think about that..&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jul 2008 02:38:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/program-time-not-stable/m-p/735714#M336822</guid>
      <dc:creator>Ray.R</dc:creator>
      <dc:date>2008-07-02T02:38:43Z</dc:date>
    </item>
  </channel>
</rss>

