<?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: Programming an ON-OFF relay in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442009#M215744</link>
    <description>I tested my program again and found that the problem is a timing issue. When I change the loop delay to 10ms and the dt of H(s) to 10ms (instead of 100ms), the results are very close to those of Simulink. The problem is that these values are impossible to work with on a PIII 900MHz as everything goes in slow motion.&lt;BR /&gt;&lt;BR /&gt;Are there solutions to improve speed or a more effective way to make my program behave correctly without having to decrease the loop time?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 16 Nov 2006 13:03:23 GMT</pubDate>
    <dc:creator>CedricVH</dc:creator>
    <dc:date>2006-11-16T13:03:23Z</dc:date>
    <item>
      <title>Programming an ON-OFF relay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/441011#M215386</link>
      <description>I created a theoretical transfer function 5/(s³+7s³+11s+5) and want to control it using an on-off relay which sends out 15V when on and 0V when off. When I do a Simulink simulation with the hysteresis set to 0 and input set to 6V, I get the result as seen in "simulink.jpg"&lt;BR /&gt;&lt;BR /&gt;As LabVIEW has no build in on-off relay, I had to program it myself. After doing that I tested the system with a very simple application and the results were competely different than in Simulink. The number of oscilation in the same time-interval is different and the ampitude of the signal in the LabVIEW program varies while it does not in Simulink. The results of my program can be seen in "labview.jpg"&lt;BR /&gt;&lt;BR /&gt;I include the source code of the simple test program "onofftest.vi" and the source code of my self-made on-off relay "onoff.vi" bundled in the library "onofftest.llb"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;When I debug onoff.vi, I get the values I expect: it only outputs 0V and 15V. I do not know what I have done wrong and I hope there is a more experienced devellopper who can help me out.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;Cedric.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Nov 2006 21:04:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/441011#M215386</guid>
      <dc:creator>CedricVH</dc:creator>
      <dc:date>2006-11-14T21:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Programming an ON-OFF relay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442009#M215744</link>
      <description>I tested my program again and found that the problem is a timing issue. When I change the loop delay to 10ms and the dt of H(s) to 10ms (instead of 100ms), the results are very close to those of Simulink. The problem is that these values are impossible to work with on a PIII 900MHz as everything goes in slow motion.&lt;BR /&gt;&lt;BR /&gt;Are there solutions to improve speed or a more effective way to make my program behave correctly without having to decrease the loop time?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Nov 2006 13:03:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442009#M215744</guid>
      <dc:creator>CedricVH</dc:creator>
      <dc:date>2006-11-16T13:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Programming an ON-OFF relay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442075#M215767</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Sorry, I can't look at the LV code from my network PC so I can only offer some generic comments / guesses.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Assumption 1: Simulink graph is based purely on a theoretical simulation model allowing an arbitrarily small timeslice for integration, not on an actual hardware implementation.&amp;nbsp; LabVIEW graph is based on an actual hardware implementation, generating and monitoring real-world electrons.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;General comment: you can't rely on a real-world control algorithm with a fairly coarse timeslice running non-deterministically under Windows to perfectly match a theoretical model.&amp;nbsp; Sometimes you can get a really good match almost all the time, but ultimately there are limits.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Offhand, I would guess there are some ways to increase your typical LabVIEW loop rate *and* keep it pretty consistent without sending everything into "slow motion."&amp;nbsp; I wouldn't normally consider a 10 msec loop time to be very fast for bang-bang (ON/OFF) control.&amp;nbsp; I'll try to look at the code when I get a chance.&amp;nbsp; A first wild guess is that you might be reconfiguring your DAQ tasks on every loop iteration?&amp;nbsp;&amp;nbsp; If so, that isn't necessary and is definitely a bad idea for a control loop.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Of course, this is just guessing until I see the code so I'll shut up now...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;-Kevin P.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2006 14:27:09 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442075#M215767</guid>
      <dc:creator>Kevin_Price</dc:creator>
      <dc:date>2006-11-16T14:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Programming an ON-OFF relay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442142#M215800</link>
      <description>Thanks for your answer!&lt;BR /&gt;&lt;BR /&gt;My application is meant to be purely theoretical and there is no Data Aquisition involved. It just consist of an ON-OFF relay and a 3rd order Transfer-Function. I want to use it as a didactic simulation without the need of real world components.&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 16 Nov 2006 15:46:57 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442142#M215800</guid>
      <dc:creator>CedricVH</dc:creator>
      <dc:date>2006-11-16T15:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Programming an ON-OFF relay</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442181#M215818</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;A member of the LAVA forum has been able to solve my question, thank you for your help! The solution can be seen here:&lt;BR /&gt;http://forums.lavag.org/Programming-an-ON-OFF-relay-t4852.html&lt;BR /&gt;&lt;BR /&gt;A screenshot of the solution can be found in "testonoff.gif"&lt;BR /&gt;&lt;BR /&gt;The system has to run in "real-time" as it is meant to be a didactic
simulation. The problem was that I coupled my precision (dt of H(s)) with my
looptime! When I increased my precision, I also decreased my looptime
so everything had to run fast. In this solution, only the relay has to
run fast while the drawing can run at the standard 100ms rate.&lt;BR /&gt;&lt;BR /&gt;Now I can view the system in real-time with a CPU load of 50%&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Message Edited by CedricVH on &lt;SPAN class="date_text"&gt;11-16-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:22 AM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2006 16:22:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Programming-an-ON-OFF-relay/m-p/442181#M215818</guid>
      <dc:creator>CedricVH</dc:creator>
      <dc:date>2006-11-16T16:22:02Z</dc:date>
    </item>
  </channel>
</rss>

