<?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 Triggering events in a sub-VI in LabVIEW</title>
    <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/446823#M217536</link>
    <description>I am trying to incorporate a subVI with event handling into a main VI.&amp;nbsp; Changing values on the main front panel does not elicit changes in the values of the controls in the subVI to which the main controls are wired.&amp;nbsp; I have attached a simple example to demonstrate my problem.&lt;BR /&gt;&lt;BR /&gt;In these VI's, the subVI works independently with three different event cases handling 4 different events.&amp;nbsp; When this sub is placed in the Main Message VI, it loses functionality because the events in the Main VI do not cause the same events in the subVI, which is what I intuitively thought.&amp;nbsp; (You will be able to use the subVI independently, but the main VI will not act and you will have to use the stop sign to break it).&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;This example is redundant, I know.&amp;nbsp; And I know of a help file and an example of dynamically registering events, however, I can't make heads nor tails of it.&amp;nbsp; Dynamically registering events seem to work in the opposite way, where the event handler is in the main VI and changes in the subVI elicit event handling in that frame.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Any ideas?&amp;nbsp; Am I completely wrong in my conception?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Brad&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 28 Nov 2006 20:22:17 GMT</pubDate>
    <dc:creator>CFAMS Brad</dc:creator>
    <dc:date>2006-11-28T20:22:17Z</dc:date>
    <item>
      <title>Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/446823#M217536</link>
      <description>I am trying to incorporate a subVI with event handling into a main VI.&amp;nbsp; Changing values on the main front panel does not elicit changes in the values of the controls in the subVI to which the main controls are wired.&amp;nbsp; I have attached a simple example to demonstrate my problem.&lt;BR /&gt;&lt;BR /&gt;In these VI's, the subVI works independently with three different event cases handling 4 different events.&amp;nbsp; When this sub is placed in the Main Message VI, it loses functionality because the events in the Main VI do not cause the same events in the subVI, which is what I intuitively thought.&amp;nbsp; (You will be able to use the subVI independently, but the main VI will not act and you will have to use the stop sign to break it).&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;This example is redundant, I know.&amp;nbsp; And I know of a help file and an example of dynamically registering events, however, I can't make heads nor tails of it.&amp;nbsp; Dynamically registering events seem to work in the opposite way, where the event handler is in the main VI and changes in the subVI elicit event handling in that frame.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Any ideas?&amp;nbsp; Am I completely wrong in my conception?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Brad&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Nov 2006 20:22:17 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/446823#M217536</guid>
      <dc:creator>CFAMS Brad</dc:creator>
      <dc:date>2006-11-28T20:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/447496#M217776</link>
      <description>&lt;FONT face="Arial" size="3"&gt;Hi Brad,&lt;BR /&gt;&lt;BR /&gt;Your assumptions are correct regarding events with subVIs and TopLevel VIs.&amp;nbsp; Successfully detecting an event in a SubVI from a top-level VI requires some more work and can be done with LV 7.0 and higher. I will try to talk it out on how to do it:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="noindex"&gt;&lt;SPAN style="font-size: 9pt;"&gt;The link between
the VIs is a reference to the front panel object that will trigger the
event. To detect a front panel event that occurs in a SubVI from
Top-level VI, do the following:&lt;BR /&gt;&lt;BR /&gt;In the SubVI, do the following: &lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;LI&gt;Place a control reference function on the front panel for all the events to be monitored.&lt;/LI&gt;&lt;LI&gt;Place a "register for event" function on the block diagram. &lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;
Register all the events to be monitored by connecting all the control
references to the register for event function and select the event to
be monitored&lt;/LI&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;LI&gt;&lt;SPAN style="font-size: 9pt;"&gt;Enable the dynamic event terminal on the event structure by clicking on the structure and selecting &lt;B&gt;"Show Dynamic Event Terminal "&lt;/B&gt;. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 9pt;"&gt;Connect the register for event function to the Dynamic Event Terminal
and edit the event handled by each case. Make sure you select the
control and event to be monitored under dynamic source.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 9pt;"&gt;Place "unregister event" function after the
event struture and wire it to the output of the dynamic event terminal
to unregister the event.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 9pt;"&gt;The front panel event will now be selectable as a dynamic event.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/SPAN&gt;&lt;BR /&gt;In the Top level VI, do the following:&lt;BR /&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="noindex"&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;BR /&gt;&lt;B&gt; &lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;LI&gt;&lt;SPAN class="noindex"&gt;&lt;SPAN style="font-size: 9pt;"&gt;Create a reference to the front panel Control in A. To do this, right click on the control and naviagete to&lt;B&gt; "Create»Reference"&lt;/B&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt;"&gt;&lt;LI&gt;&lt;SPAN class="noindex"&gt;&lt;SPAN style="font-size: 9pt;"&gt;Place the subVI created in 1 onto the Top-Level VI.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="noindex"&gt;&lt;SPAN style="font-size: 9pt;"&gt;Pass
the reference from A to B. Connect the control reference to the
corresponding control-reference input created in SubVI. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/SPAN&gt;&lt;BR /&gt;I have attached two screenshots on how to do this.&amp;nbsp; Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Nadim Rajabi&lt;BR /&gt;Applications Engineering&lt;BR /&gt;National Instruments&lt;BR /&gt;&lt;/FONT&gt;</description>
      <pubDate>Wed, 29 Nov 2006 19:57:53 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/447496#M217776</guid>
      <dc:creator>Nadim R</dc:creator>
      <dc:date>2006-11-29T19:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/447499#M217778</link>
      <description>Sorry bout that.&amp;nbsp; Here are the pictures.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Nadim&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Nov 2006 19:59:26 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/447499#M217778</guid>
      <dc:creator>Nadim R</dc:creator>
      <dc:date>2006-11-29T19:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/448754#M218246</link>
      <description>Thank you, Nadim.&lt;BR /&gt;&lt;BR /&gt;there are two things I don't understand here.&amp;nbsp; 1) Why do you create the control references in the main VI and not the subVI?&amp;nbsp; Where do you generate the control reference refnums seen in the subVI in order to recognize the specific controls referred to?&amp;nbsp; 2)&amp;nbsp; How do you change the tunnel into the event structure into a satellite icon thingy?&amp;nbsp; I have not had this occur automatically nor has it appeared as an option.&amp;nbsp; Although, I doubt it is called a satellite icon thingy, so I wouldn't recognize it if it hit me in the head.&lt;BR /&gt;&lt;BR /&gt;Brad&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Dec 2006 18:27:26 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/448754#M218246</guid>
      <dc:creator>CFAMS Brad</dc:creator>
      <dc:date>2006-12-01T18:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/448763#M218253</link>
      <description>OK, the answer the 2nd question was obvious.&amp;nbsp; Now I should rephrase the first questions.&amp;nbsp; 1)&amp;nbsp; Why wire the control reference and not simply the control to the subVI icon?&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Brad&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Dec 2006 18:46:04 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/448763#M218253</guid>
      <dc:creator>CFAMS Brad</dc:creator>
      <dc:date>2006-12-01T18:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/448772#M218255</link>
      <description>OK, now I've answered my own questions and I still have a VI-subVI combo that doesn't perform.&lt;BR /&gt;&lt;BR /&gt;I've attached them here, can you check if I've wired them up correctly?&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Dec 2006 18:57:41 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/448772#M218255</guid>
      <dc:creator>CFAMS Brad</dc:creator>
      <dc:date>2006-12-01T18:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/448873#M218306</link>
      <description>Hey,&lt;BR /&gt;&lt;BR /&gt;I believe you are selecting value change and not dynamic value change.&amp;nbsp; Notice the brackets &amp;lt;&amp;nbsp; &amp;gt;&amp;nbsp; in the event case are missing in your application.&amp;nbsp; I have attached my VI's to this discussion forum.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Nadim&lt;BR /&gt;Applications Engineering &lt;BR /&gt;National Instruments&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Dec 2006 22:19:18 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/448873#M218306</guid>
      <dc:creator>Nadim R</dc:creator>
      <dc:date>2006-12-01T22:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/450927#M219117</link>
      <description>Thank you for your insight, Nadim.&amp;nbsp; I have a working VI, but of course there are peculiarities that relate to my lack of understanding of the event structure.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I have attached the main and sub here, it is sort of a chat emulation for example purposes.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I needed to put in a timeout case in the subVI event structure in order to have the VI react to the "Send" value change without having to register another event afterwards.&amp;nbsp; I am not sure why this needs to be done, or how it should best be done.&amp;nbsp; Now for instance, the "Message is being typed..." constant only appears for the length of the time out while the user mouses over the message text control.&amp;nbsp; Is there a way to dynamically control timeout lengths?&amp;nbsp; I.e. make it -1 after the mouse over event but almost instantaneous after the send message and stop value change events?&lt;BR /&gt;&lt;BR /&gt;These questions relate to my real application where a value change in any of a number controls initiates a subVI that writes a waveform onto an NI card.&amp;nbsp; This needs to happen instantaneously, once, when the value is changed.&amp;nbsp; It does not need to happen every time the main VI iterates its while loop.&amp;nbsp; The subVI cannot hang the main VI up while it waits to pass values through the sub, either.&amp;nbsp; So this is why I am asking these questions abou the simple VI's posted below.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Brad&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 07 Dec 2006 13:39:02 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/450927#M219117</guid>
      <dc:creator>CFAMS Brad</dc:creator>
      <dc:date>2006-12-07T13:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/451822#M219484</link>
      <description>Hi Brad,&lt;BR /&gt;&lt;BR /&gt;The timeout on the Event Structure works like this-&amp;nbsp; The event structure will wait for a dynamic change.&amp;nbsp; If no change has occurred before the timeout, then the event structure will implement what is inside the timeout case.&amp;nbsp; To dynamically control your timeout, wire a numeric control to the timeout.&amp;nbsp; Create a local variable from the numeric control and copy it to each structure case.&amp;nbsp;&amp;nbsp; Change the local variables to write and wire your value to them.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regads,&lt;BR /&gt;&lt;BR /&gt;Nadim&lt;BR /&gt;Applications Engineering&lt;BR /&gt;National Instruments&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 08 Dec 2006 21:45:41 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/451822#M219484</guid>
      <dc:creator>Nadim R</dc:creator>
      <dc:date>2006-12-08T21:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/790992#M361272</link>
      <description>&lt;P&gt;Hi Brad&lt;/P&gt;&lt;P&gt;&amp;nbsp;Can you pls convert all these attachments to LV 7.1&amp;nbsp; because I want to know what's&amp;nbsp;happening as I also experienced the same problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regard &lt;/P&gt;&lt;P&gt;Clement&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2008 09:14:46 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/790992#M361272</guid>
      <dc:creator>astroboy</dc:creator>
      <dc:date>2008-10-13T09:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/791001#M361276</link>
      <description>&lt;P&gt;Hi Nadim &lt;/P&gt;&lt;P&gt;I would like to know how to treat controls&amp;nbsp; in the subvi as refernum without opening subvi during running because I need to register them as events for dynamic events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clement&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2008 09:31:56 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/791001#M361276</guid>
      <dc:creator>astroboy</dc:creator>
      <dc:date>2008-10-13T09:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering events in a sub-VI</title>
      <link>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/791942#M361647</link>
      <description>&lt;P&gt;Dear &lt;SPAN class="noindex"&gt;Clement,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the VIs saved for LV 7.1. I believe by looking at these VIs you should find the answers to your questions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To duplicate the behavior in the above VIs: in your subVI, create control refnums, and designate an appropriate VI server class for each. Specify terminals on the connector pane for each control reference. Pass references from each control in your main application to these references in the subVI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~Nate&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2008 14:50:29 GMT</pubDate>
      <guid>https://forums.ni.com/t5/LabVIEW/Triggering-events-in-a-sub-VI/m-p/791942#M361647</guid>
      <dc:creator>Nate.H</dc:creator>
      <dc:date>2008-10-14T14:50:29Z</dc:date>
    </item>
  </channel>
</rss>

