Dynamic event multiple loops

I'm trying to see if I can use one Dynamic User Event to control multiple Event Structures. It seems that sometimes once a dynamic event occurs and its "interrupt" is answered by an event case, other VIs only have a short amount of time (<50ms) to reach their event case state for accepting this event otherwise the event seems to be cleared and the other VIs are oblivious that the event even occured.
My Question: Is it possible to use one dynamic event to control multiple Event Structures reliably?
A previous post somewhat speaks of this issue but does not provide a solution or anything insightful.
http://forums.ni.com/ni/board/message?board.id=170&message.id=223495&query.id=135563#M223495
I've included an example of my issue
Attachments:
DynamicUE.zip ‏61 KB

Thanks to both of you. I found the answer to my question in the second posted link. "the common, correct use case is to have one Event structure per dynamic event registration". I tested this out with the previous attachment by registering the User Event refnum from the ESTOP functional global to another Event Registration node. I then ran this refnum to the top loop. (instread of the top loop sharing the registration refnum with the middle loop). Now I can put a delay of 2000+ ms and not even miss an event. cooool. This will probably NOT be my final solution but its good to know in the future.
Most likely I am going to design each of my main VIs to have a main while loop with a User Event Structure listening for dynamic events. Associated with each of these VIs will be a functional global which contains its User Event Refnum and Registration Refnum. This functional global will act as a gateway into the associated VI for other VIs/Subvis to use. This will follow the "one Event structure per dynamic event registration" rule while keeping my API organized and allowing room for scalability by simply adding more functional globals in the future.
Just putting this info out there for other users.
Thanks again,
Craig

Similar Messages

  • Generate dynamic event of producer loop in multiple consumer loop

    I have one producer loop which used event case to interface with FP controls and 5 consumer loops
    If I have to use the fifth consumer loop to generate dynamic event which send to event case in produer loop. 
    I have to wire register event with dynamic event terminal in producer loop . Also I need to wire user event to consumer loop (at the bottom of screen window) which is far away from producer loop. It is hard to wire them. 
    Is there any other method to let many consumer loop to communicate with one producer loop through dynamic event (the same user event)?

    I like to use an Action Engine to hold control my Event Reference.  Then anybody can send the event commands.
    You may also want to look at the VIs I recently submitted for OpenG here.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Dynamic Events Problem

    I am fairly new to LabVIEW and I am trying to make a GUI that uses
    events to pass messages between three separate event loops, GUI,
    Messaging and Logging. GUI controls the state of the other two event
    loops by generating control events and using semaphores. While the
    messaging semaphore is released by the GUI, Messaging generates
    messages and raises them as events. Some message events are handled by
    the GUI event loop and others by the Logging event loop. Logging, once
    it receives a 'logging ON' control event dynamically registers for
    certain message events and logs the message events it handles to file.
    When Logging receives a 'logging OFF' control event, it dynamically
    unregisters the message events. The logging control events are
    registered for the life of the Logging event loop.
    I have created a cut-down version of my GUI that exhibits the same
    problem. The problem is that after I have turned Logging on and off
    once, it no longer responds to logging control events from the GUI.
    Even though the GUI is still generating the events. I have looked at
    the dynamic logging example in LabVIEW and thought I did the same sort
    of thing but I just can't get it to work that way. The only way I got
    it working was by creating a clean event registration with all events
    each time I want to change the event registration. This is how I have
    done it in the example file and it works. But I don't want to use this
    method, I don't want to have to re-register the control events each
    time I unregister/register message events.
    If anyone knows what I'm doing wrong please edit the example vis and post them back.
    Notes for the example:
    Files are LabVIEW 7.1.1
    Just open the front panels for all the vis before running the GUI vi.
    The Display vi just does the same thing as the logging vi.
    Run the GUI vi and turn on Messaging then turn Logging on and off a few times.
    The example works, but if you wire the event registration refnum
    input when doing dynamic event registration, Logging will only turn on
    and off once, then no longer respond to log control events... what's
    going on?

    I can't tell you how to solve you problems - without code this is always quite tricky.
    But in case you want to log messages to a log file, have a look at this thread
    http://forums.ni.com/ni/board/message?board.id=170&message.id=172117&view=by_date_ascending&page=1
     where I posted a logging-library.
    Maybe it is a useful help for you.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • Dynamic Event (Notifier) Missed

    In my application, I have a notifier registered as a "user event". There are three event structures, each within a while loop; in each event structure this notifier event is registered as "dynamic event". In two structures, the timeout is set to "-1" (infinite). In the third stcructure, the timeout is set to 5 ms; the timeout case takes 500 ms to complete (e.g. using "Wait ms"). An additional event structure fires this notifier event.
    What happens is that the two structures with infinite timeout catch this event (I think), but the structure with a short timeout and long-executing timeout case misses it. If I make the timeout long and the timeout case execute fast, this structure also catches the event. It looks like during the execution of the timeout case the event is unregistered.
    An example VI is attached.
    Is it a bug or am I doing something wrong?
    Thanks,
    Sergey Liberman
    Message Edited by Cepera on 02-12-2010 10:29 PM
    Solved!
    Go to Solution.
    Attachments:
    NotifierTest.vi ‏17 KB

    You are right of course. I forgot that events do not broadcast. A corrected VI is attached. It works fine now. Thanks!
    Attachments:
    NotifierTest2.vi ‏19 KB

  • Front panel locks with event structure loop and another while loop

    Hi,
    Why is the front panel locking after changing the value of the "boolean switch" twice? This problem disappears if I uncheck the "lock front panel" option in the event case. However I don't understand why that is the case since the event structure loop has already finished executing.
    thanks

    Do you really want the event handling to stop after detecting the first event? If so then as Christian says the event structure will cause the front panel to lock. What you can do is dynamically register and unregister the events. You right click on the event structure and enable "Show Dynamic Event Terminals" Then  you can programatically register and unregister events.
    Here is your vi modified to do that.
    Edit: Just in case - right click on the control and create a reference. When selecting the source of the event in the structure look under the dynamic section.
    =====================
    LabVIEW 2012
    Attachments:
    event structure test.vi ‏13 KB

  • Continous dynamic event loss

    Hello,
    we are experiencing a continous dynamic event loss.
    The test-main-VI is Button Menue 15.vi, all received and generated counts should be the same.
    Button Menue 14.vi is included as a "not really doing some real work" example, an seems to be running flawlessly also on the customer machine. But if we replace the sleep with some larger loops then we easily can see a big difference.
    On the customer machine the continous loss can be seen quite easily, here we have to run about 12000 cycles so see a small difference,
    We are using a german LabView 8.2.1.
    Attachments:
    ButtonTest.zip ‏106 KB

    You splitted the Event Registration refnum:
    This is a no-no, have a look at this post (and the rest of the thread)
    In order to solve your problem you should NOT share the Event Registration Refnum in the sub-vi but create a new one:
    If I run that code I have no problem  and seeing no missed events.
    Viel Spass
    Ton
    Message Edited by TonP on 09-17-2007 05:45 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Button Menue 20.png ‏1 KB
    Button Wrapper 20.png ‏5 KB

  • RT: Dynamic Event possible without polling?

    RT Targets only support dynamic events as seen in this demo:
    http://digital.ni.com/public.nsf/allkb/42B70D2D0C4B568586256E2F0051441D?OpenDocument
    the example uses: "Generate User Event" to fire an event.
    The event is fired within an While Loop where two inputs are compared (polling the input all the time....)
    I would like to generate an Event on a change of a variable without having to poll.
    Is this possible?
    thanks a lot
    thomas

    Hi Thomas,
    you can use shared variables and LabVIEW DSC on your RT target without polling but otherwise there's no possibility to avoid polling completely.
    Here are some interesting links on this issue:
    "Installing LabVIEW DSC, SQL, or MSDE on a Real-Time Target": http://digital.ni.com/public.nsf/allkb/52CC76196A480C6C86256F8900592A25 
    This page contains also other interesting links on this issue!
    http://digital.ni.com/manuals.nsf/websearch/12BCE84BAF96E2AE862574330022EC46 
    "Using the LabVIEW Shared Variable": http://zone.ni.com/devzone/cda/tut/p/id/4679 
    "Using Shared Variable Events on Real-Time Targets": http://digital.ni.com/public.nsf/websearch/3AE325EECD9A17AD862570BA00625088?OpenDocument 
    The DSC features of the shared variable are limited to use on Windows targets, however you can host variables on a Windows machine and reference them on a real-time target. Another option is to create two sets of shared variables, one set hosted on the Windows side and one on the RT side, with each variable on the Windows set bound to the corresponding variable on the RT side. This would allow you for example to log data on a variable, but have it hosted on the RT side with no network dependency on the RT side to the Windows side.
    I hope these informations help you!
    Best regards
    Suse
    Certified LabVIEW Developer (CLD)

  • What are the Dynamic Events avaliable in the LabView 6.1 Event Structure?

    I recieved LabView 6.1 recently and I am working with the Event Structure, and I'm trying to figure out what Dynamic Events are avaliable in the event structure, and how to access them. If you don't understand what I'm talking about, open a new VI in LabView 6.1 and drop an event structure on the diagram. Add an event and look at the dialog box that appears on the screen, specifically the Event Sources section. The third option in this area of the screen is "grayed out" but reads "Dynamic". I'm curious what these events are, and how I access them. I'm running WinNT 4 SP6.
    Thanks,
    Chris Davis

    I believe this is part of a feature which is not yet present in LabVIEW 6.1, but may be present in a future release.

  • Resetting a variable in an event structure (dynamic event)

    I'm working on moving an event structure into a sub VI. This means I have to register dynamic events. 
    The event structure is handling some button clicks. The state of the button (mechanical action = latch when released) resets itself automatically as long as the variable is placed within the value change case.  Leaving the button in this case is not possible when the event structure is put in a sub VI and the variable is located in the parent VI.  How do I make sure the button unlatches after clicking on it?  I have attached an example where all the code is in one VI (the local variable must be moved outside the event structure in order for it to be moved into a sub VI).  Any ideas?
    If you open the VI and run it, you can click Start which will cause the counter to start incrementing.  The button only unlatches as long as the variable is located in the value change case.
    (Btw, how do you put images inline in a post?)
    Rob
    LV2011,LV2012,LV2013
    Attachments:
    img.png ‏18 KB
    main.vi ‏17 KB

    Race conditions are the primary reason not to do that. But since your treating your variable as a latch, I doubt your using the value you read from it anywhere, and in that case it can't create a race condition. There's also the possibility that the control's reference could become invalid. But since this is a sub VI of the control's VI that can't happen (even if it could you can check the error out of the value property node to see when it happens and deal with it).
    I'm not sure about the flickering, Since I can't seem to duplicate it with a simple test case on my machine. It might related to whatever else you're doing in the event apart from reseting the value to false.

  • 2012 Dynamic Event Registration Array of Controls

    In upgrading to LV2012, I have discoverd what may be a bug, or at least an incompatability between 2011 and 2012 with respect dynamic event registration of an array of controls as opposed to individual control references.
    This bit of code worked in 2011 but doesn't in 2012, with error 1 generated at the reg events block when run in 2012. I have been in contact with technical support, but haven't yet heard their take on this.
    Any thoughts.
    Solved!
    Go to Solution.
    Attachments:
    Top Application.png ‏13 KB
    SubVI.png ‏23 KB

    I've got the bug too -- it appears this bug is present when arrays of control refs are connected to the ConPane. Link to cross-post on LAVA about the original problem. As Patrick@Vision mentions above, one workaround is to ensure that the array of control refs is no longer on the ConPane by collapsing the Register for Events node onto the caller.
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • Dynamic event with global variable (vi)

    I have registered a dynamic event to fire when a control in a global vi value changes. All works fine when I open the global vi and change the value of the control manually. When I have another vi modify the value of the global, the dynamic event does not fire.
    I have tried leaving the front panel of the global vi open and observed the value being changed...
    Any help appreciated...

    Hi,
    Please refer to the following document that explains why programmatic changes to the global doesn't get detected.
    Event Structure Does Not Capture the Value Changed Event...
    I hope this helps.
    Sincerely,
    Feroz
    National Instruments

  • Are you ever required to wire the dynamic event terminals through an event case?

    I remember some time ago, I ran into an issue while using an event case where my program was not functioning properly until, on a whim, I wired the dynamic event through that event case... now the reason I'm asking this in a general sense is because I don't remember what particular code I had this issue with and I could have been failing to update a shift register or something.
    In code I'm currently writing, I'm simply passing the dynamic event wire in a shift reg.  I was just wondering if there's any difference between wiring it through the event cases or simply passing it to the output shift register (without passing through the event cases)...
    any info appreciated!
    Thx
    -pat

    You do not have to wire it through. You don't need a shift register for references since the value will be the same for each iteration. In fact using a shift register is probably what caused issues. You probably updated it with the default value somewhere.
    =====================
    LabVIEW 2012

  • Multiple loop in one loop

    Dear experts,
    Please find the code below.This is text variable customer exit.Can u ple help me to put these multiple loops into one loop.Do u suggest this code is ok?
    Appreciate your help.
    WHEN 'ZSTXTPE01AA'or 'ZSTXT0FISCPER305AA'or 'ZSTXT0FISCYEAR01AA'
    INCLUDE Z_VARIABLES_TEXT
    DATA: vtype i,
          fisper i,
          fisyear i
    IF I_STEP=2.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0VTYPE01AA'
    vtype=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCPER305AA'
    fisper=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCYEAR01AB'
    fisyear=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Rgds
    ACE

    LOOP AT I_T_VAR_RANGE INTO loc_var_range
    WHERE VNAM IN('ZS0VTYPE01AA', 'ZS0FISCPER305AA','ZS0FISCYEAR01AB')
    vtype=LOC_VAR_RANGE-LOW.
    endloop.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    try the above code
    also
    What u r doing inside ur loop endloop?

  • Multiple loops in one loop for text variables

    Dear experts,
    Please find the code below.This is text variable customer exit.Can u ple help me to put these multiple loops into one loop.Do u suggest this code is ok?
    Appreciate your help.
    WHEN 'ZSTXTPE01AA'or 'ZSTXT0FISCPER305AA'or 'ZSTXT0FISCYEAR01AA'
    INCLUDE Z_VARIABLES_TEXT
    DATA: vtype i,
          fisper i,
          fisyear i
    IF I_STEP=2.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0VTYPE01AA'
    vtype=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= vtype.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCPER305AA'
    fisper=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisper.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    LOOP AT I_T_VAR_RANGE INTO loc_var_range WHERE VNAM='ZS0FISCYEAR01AB'
    fisyear=LOC_VAR_RANGE-LOW
    ENDLOOP.
    CLEAR L_S_RANGE.
    L_S_RANGE-LOW= fisyear.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Rgds
    ACE

    Hi ACE BW,
    You can try to use the SELECT statement and then include the LOOP inside it.
    Thanks,
    Daniel

  • Dynamic events in PD/OM infotypes.

    Hi, I want to know if it's possible to implement dynamic events in OM/PD info like PA info (tableT588Z). If not, other solutions?
    Thanks for answers.

    I don't think so there is any concept of dynamic events in OM.... it's not required....and also not possible i guess....!!!!

Maybe you are looking for

  • How can I share a gift card on multiple devices under the same Apple id

    how can I use the same gift card on multiple devices using the same Apple ID?

  • TRACK AS ASSET

    Hello All Fixed Asset Users Guide stated that one of the conditions for asset invoice line distributions to be imported is that "The Track As Asset check box is checked. (It is automatically checked if the account is an Asset account)" The problem is

  • How to change the color of the text field of form

    Hi , Is there any way to change the color of the text field of the form........ Thnx in advance ....... Cheers, Eman

  • Delete database with lost initdb.ora

    Hi guys. How can i delete database with lost init file? I just want to recreate the database (with out any recovery or restoring process) 1. I can't start it because i don't have init. 2. I can't drop database because i can't start. 3. I can't recrea

  • Import of RAW (nef) from camera to organiser

    I have been using PSE7 and PSE8 for a long time without problems. Now I have installed the PSE9 and as usually I wanted to import my raw(nef) photos directly from the camera to the organiser, but this was not possible, it says: unsupported file forma