<?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: Event structure not executing in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2953043#M851925</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/74523"&gt;@Hooovahh&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/75897"&gt;@crossrulz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have pretty much deemed shared variables evil in almost all aspects. &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is why I opened with "I am not a RIO expert" because all I know is from reading about them and a couple hands on sessions.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;They are not limited to RT.&amp;nbsp; I have used them in Windows and between desktop computers.&amp;nbsp; If you really want to get an earful, go ask Stephen Loftus-Mercer what he thinks about them.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Aug 2014 15:35:45 GMT</pubDate>
    <dc:creator>crossrulz</dc:creator>
    <dc:date>2014-08-14T15:35:45Z</dc:date>
    <item>
      <title>Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952081#M851708</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a linear stage that I am controlling with an open loop system using a stepper motor. &amp;nbsp;I want to run some tests to measure how far and how consistently the motor can move the stage. &amp;nbsp;The way my software works is that I give the motor a position (number of steps), then it runs until it reaches that position. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The motor homes itself, and then I want to implement an event&amp;nbsp;structure so that I can give different commands without having to rerun the program each time. &amp;nbsp;The three cases I would like to implement are:&amp;nbsp;&lt;BR /&gt;1) Giving the motor a new position to run to&lt;/P&gt;
&lt;P&gt;2) Telling the motor to home itself again&lt;/P&gt;
&lt;P&gt;3) Stopping the program at any time&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have watched tutorials on the event structure, and can't for the life of me figure out why it won't work. &amp;nbsp;The motor runs, homes itself, enters the while loop, and just stays there. &amp;nbsp;When I change the values, nothing happens. &amp;nbsp;Can anyone help me figure this out?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 20:47:27 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952081#M851708</guid>
      <dc:creator>Riche29</dc:creator>
      <dc:date>2014-08-13T20:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952095#M851712</link>
      <description>&lt;P&gt;Is highlight execution on the whole time? &amp;nbsp;Turn it on, then run the VI. &amp;nbsp;I'm saying this because it is possible it never finishes the Home subVI and never enters the while loop. &amp;nbsp;If it does keep highlight execution on and change the value of the Position control, see what happens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you are describing just can't be happening. &amp;nbsp;The event structure works as you expect. &amp;nbsp;When the Position value changes then the case is entered. &amp;nbsp;If it is in a case and you change the value again, depending on the settings it will either pile up events like a queue, or will not allow more UI events to be queued up.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 21:07:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952095#M851712</guid>
      <dc:creator>Hooovahh</dc:creator>
      <dc:date>2014-08-13T21:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952149#M851718</link>
      <description>&lt;P&gt;You need to show us your code (incl. subVIs). We cannot debug pictures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;What's up with the flat sequence structure. serves no purpose.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;How do you know the the loop inside the event structure ever completes?&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 15px;"&gt;It is typically better to do lenghty things (e.g. the inner while loop) outside the event structure in a parallel loop. Look at consumer/producer patterns and queues.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 13 Aug 2014 22:03:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952149#M851718</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2014-08-13T22:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952749#M851857</link>
      <description>&lt;P&gt;Thank you for the replies.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have&amp;nbsp;kept the highlight execution on the whole time, and it shows that home completes and the while loop is entered. &amp;nbsp;When I change the position, nothing happens; the event structure&amp;nbsp;is never entered, for any of the cases I try. &amp;nbsp;I am as baffled as you are.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've included my code, and all the relevant subVIs should be there. &amp;nbsp;The piece of code I am having trouble with is testDistances.vi. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;altenbach:&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The flat sequence is laid out like that when a new myRIO project is opened. &amp;nbsp;I just left it there.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;I haven't even reached the loop inside the event structure. &amp;nbsp;If I were to reach it, the motor would be running, and it would exit once the motor has reached the desired position (input to the Position control). &amp;nbsp;My "Run" subVI&amp;nbsp;returns false when the desired position is reached.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Thank you for this piece of advice. &amp;nbsp;I did read that this is a standard practice, but I really just wanted to get the event structure to work and got caught up in that before changing it.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;This wouldn't have to do with the fact that I'm running my software on a myRIO, and not my PC, would it?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;E&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 12:41:27 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952749#M851857</guid>
      <dc:creator>Riche29</dc:creator>
      <dc:date>2014-08-14T12:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952767#M851865</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/301068"&gt;@Riche29&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for the replies.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This wouldn't have to do with the fact that I'm running my software on a myRIO, and not my PC, would it?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, yes it would.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The myRIO is an embedded device and has no video output, and therefore doesn't have a concept of events based on user input. &amp;nbsp;I've never used a myRIO but I assumed it wouldn't even allow you to put the code on the myRIO if an event structure was being used, but I guess you can have user events so maybe that is why no error was thrown.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code runs as expect on Windows where I tested it. &amp;nbsp;I had to disable parts of the Home, and Run routine because I don't have the myDAQ or myRIO software installed but the event structure worked as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also for the Position Value change the control should be in the event structure, not just in the while loop. &amp;nbsp;If it isn't then you'll be reading the last value not the new one. &amp;nbsp;You were probably just making changes to test things because in the images you posted it was in the event structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 12:49:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952767#M851865</guid>
      <dc:creator>Hooovahh</dc:creator>
      <dc:date>2014-08-14T12:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952781#M851867</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Hooovahh wrote:
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The myRIO is an embedded device and has no video output, and therefore doesn't have a concept of events based on user input. &amp;nbsp;I've never used a myRIO but I assumed it wouldn't even allow you to put the code on the myRIO if an event structure was being used, but I guess you can have user events so maybe that is why no error was thrown. &lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually LabVIEW RT will allow you to use the Event Structure.&amp;nbsp; But since there is no actual front panel, events coming from the UI just won't happen.&amp;nbsp; I'll have to test it, but I'm pretty sure User Events will work.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 12:55:24 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952781#M851867</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2014-08-14T12:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952791#M851869</link>
      <description>&lt;P&gt;Okay, this is good to know. &amp;nbsp;So is it the case that I can't input new values into the front panel during run time and have them interact with the program? &amp;nbsp;It only uses the values I give it before I press run? &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Emma&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 13:02:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952791#M851869</guid>
      <dc:creator>Riche29</dc:creator>
      <dc:date>2014-08-14T13:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952817#M851878</link>
      <description>&lt;P&gt;If you are running through the LabVIEW IDE, then you can still change the values.&amp;nbsp; It just won't generate the event.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 13:14:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952817#M851878</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2014-08-14T13:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952875#M851889</link>
      <description>&lt;P&gt;Does this mean I would need to nix the event structure and poll for new data?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 13:52:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952875#M851889</guid>
      <dc:creator>Riche29</dc:creator>
      <dc:date>2014-08-14T13:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952893#M851894</link>
      <description>&lt;P&gt;Yep&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 14:01:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952893#M851894</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2014-08-14T14:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952945#M851901</link>
      <description>&lt;P&gt;Is there any way I can send data in real time between the myRIO and the program? &amp;nbsp;Is there a way I can have the user input values and have the program respond without having to stop and restart the program, or poll for changes? &amp;nbsp;You mentioned something about User Events earlier...&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 14:36:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952945#M851901</guid>
      <dc:creator>Riche29</dc:creator>
      <dc:date>2014-08-14T14:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952959#M851904</link>
      <description>&lt;P&gt;I will describe high level what I mean, and someone else can give the details (I haven't done tons of cRIO stuff yet)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So there exists a few ways to send data to a cRIO device like a myRIO. &amp;nbsp;Shared variables, RT FIFO, UDP, TCP etc... &amp;nbsp;The easiest seems to be shared variables and works well for small amounts of data like a value change or a boolean saying to do something. &amp;nbsp;&lt;A href="http://digital.ni.com/public.nsf/allkb/48D244EC86971D3986256BD4005CCC28" target="_blank"&gt;Here is an article&lt;/A&gt; talking about some options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Somewhere on the RT you will be polling looking for new data on that interface. &amp;nbsp;When you get data you can then act on it. &amp;nbsp;That can mean sending the data in a Queue to the part of the application (still on the RT) that needs it, or it can mean just using it right there. &amp;nbsp; A User Event is just a glorified Queue and works the same way. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Poll for new data, act on that data.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 14:42:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952959#M851904</guid>
      <dc:creator>Hooovahh</dc:creator>
      <dc:date>2014-08-14T14:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952981#M851907</link>
      <description>&lt;P&gt;The program is actually on the myRIO.&amp;nbsp; If you want to make another VI that runs on your desktop that can communicate with the myRIO, that is an option.&amp;nbsp; I would recommend using Network Streams to send the data down to the myRIO from your desktop.&amp;nbsp; It is a network connection after all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have pretty much deemed shared variables evil in almost all aspects.&amp;nbsp; Yes, they do have their place.&amp;nbsp; But they are way too easy to abuse since they are not expandable at all.&amp;nbsp; It's the same argument as local variables.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 14:53:15 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2952981#M851907</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2014-08-14T14:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2953005#M851913</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/75897"&gt;@crossrulz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have pretty much deemed shared variables evil in almost all aspects. &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is why I opened with "I am not a RIO expert" because all I know is from reading about them and a couple hands on sessions.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 15:09:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2953005#M851913</guid>
      <dc:creator>Hooovahh</dc:creator>
      <dc:date>2014-08-14T15:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Event structure not executing</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2953043#M851925</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/74523"&gt;@Hooovahh&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/75897"&gt;@crossrulz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have pretty much deemed shared variables evil in almost all aspects. &amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is why I opened with "I am not a RIO expert" because all I know is from reading about them and a couple hands on sessions.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;They are not limited to RT.&amp;nbsp; I have used them in Windows and between desktop computers.&amp;nbsp; If you really want to get an earful, go ask Stephen Loftus-Mercer what he thinks about them.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 15:35:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Event-structure-not-executing/m-p/2953043#M851925</guid>
      <dc:creator>crossrulz</dc:creator>
      <dc:date>2014-08-14T15:35:45Z</dc:date>
    </item>
  </channel>
</rss>

