Missing dynamic user events across VIs

We have a sub-Vi Statemachine.vi, which has its own event structure with a 5ms time-out, everything enclosed into a loop.
This sub-VI is called repeatedly from the main application with command lists to execute. This can be a longer list or e.g. an empty list.
It turned out, that we can miss successfully sent events, despite the documented internal queues.
Placing the event structure into an added parallel executing, non-terminating loop in the sub-VI seems to help.
Is there a link to further informations about this behaviour? We are using a german LV 8.2.1.

Martin,
I don't know of a good document describing the use of the user event in the way the you and I are using them.
I've learned from bits and pieces lying around and my collegue. After using it for two years now I have a framework in which the use of user events is relatively easy.
I know this doesn't help you a lot, but I know that if get the hang of it, it will provide a good and usable architecture.
I hope the attachments helps you a bit. It is the way I define user event for inter process communication. It will get rid of a lot of wiring.
Kind regards,
André
Regards,
André
Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)
Attachments:
Event buffer.zip ‏13 KB

Similar Messages

  • Crashing LabVIEW with dynamic user events

    Hello,
    we are able to execute the attached sample with a german LV 8.2.1 on a Pentium 4 2.4 GHz PC with 1GB Ram and W2K SP4.
    However we seem to have problems on a faster machine with an english Windows XP Server but also LV 8.2.1. Could this please be verified?
    So start the test, first manualy load the "Button Menue 13.vi", then the "Button Wrapper 13.vi" and finally the "Button Receiver 13.vi".
    After this activate "Button Menue 13.vi" and let it run for a short while. After softly stopping "Button Menue 13.vi" with the local "Stop"-button, all VIs should indicated the identical amount of received dynamic user events.
    On our local PC we can run sucessfully and quickly to e.g. 10000 events and more.
    Attachments:
    ButtonTest13.zip ‏52 KB

    Hello,
    after disabling hyperthreading in the BIOS the english XP Professional and the examples now run nicely!  

  • Dynamic user events freeze user interface

    Hi all,
    I am having problem with dynamic user events.
    Dynamic user event is registered to the event structure, and many dynamic user events come in very fast, about every 30 ms. It freezes up the user interface, no response to mouse and keyboard, even after all user events finish execution.
    Any idea or work around?
    Thanks for any help.
    Anne

    Hi Anne,
    > Dynamic user event is registered to the event structure, and many dynamic user events come in very fast, about every 30 ms.
    The 30ms rate is not unreasonably fast as long as the processing for the event(s) can be completed in less than 30ms.
    What tasks are you doing in the User Event?
    For tasks that may take time to complete (like logging) you could queue up the data and send it to a consumer loop.
    > It freezes up the user interface, no response to mouse and keyboard, even after all user events finish execution.
    My *guess* here is that you got stuck in an event that never completed.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.

  • Dynamic user event

    Hello, I am a newbie regarding dynamic user events.
    Basically, I want to create a user event that triggers  an event structure in a subvi.
    To do this, I wire up a "create new user event" and then pass the refnum to my subvi "more info" as seen below.  But this piece of code get's stuck in the sub-vi and never leaves :[
    here is my subvi below:
    I'd greatly appreciate any help :]

    To stop your main vi you will need to provide a mechanism to stop your sub vi.
    I would use an additional boolean User Event to do this.
    (This could be shared among other subvis).
    When the (let's call it) Shutdown event is received, set your subvi while loop control terminal true.
    Note: When using this scheme in an exe file, if the subvi front panel is open and you shutdown the main vi, the subvi can remain open. This happened to me using LabVIEW 2010. I had to use a Front Panel Close Method to avoid this issue.
    When using the Front Panel Close Method you should first check if the front panel is open or not to avoid an error.
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.

  • Xcontrols and dynamic User Events

    Hi all,
    I'm trying to build a XControl with an Event Structure that accepts User Events generated by a separate parallel loop on the block diagram.
    A monitoring loop with its own Event Strucure on the block diagram seems to handle the User Events generated by my producer loop but the XControl seems to ignore the User Events.
    Example LabView 8.5.1 project is attached
    Any ideas?
    Attachments:
    XControl.zip ‏75 KB

    Hi Anne,
    > Dynamic user event is registered to the event structure, and many dynamic user events come in very fast, about every 30 ms.
    The 30ms rate is not unreasonably fast as long as the processing for the event(s) can be completed in less than 30ms.
    What tasks are you doing in the User Event?
    For tasks that may take time to complete (like logging) you could queue up the data and send it to a consumer loop.
    > It freezes up the user interface, no response to mouse and keyboard, even after all user events finish execution.
    My *guess* here is that you got stuck in an event that never completed.
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.

  • Triggering dynamic events across VIs

    Hi,
    I want a dynamic event triggered in one VI to run a case in another VI. Is this possible?
    If so, how do I pass the event references and the data associated with the event between the 2 VIs.
    Regards.

    Hi tdog,
    You could possibly use notifiers to pass the Event Registration Refnum from the VI creating the event to the other VI.
    1). Add into both VIs an Obtain Notifier, using the same name (eg. 'DynamicVINotifer')
    2). Use Send Notifier in the VI creating the event
    3). Use Wait on Notification in the receiving VI, wiring the output to the dynamic event tunnel
    Charlie Rodway
    Test Design Engineer
    Rolls-Royce Controls and Data Services Ltd

  • VISA Wait on Event User Event

    I have a Producer/Consumer program that uses an Event Structure to handle the UI button presses.  I want to be able to use the VISA wait on Event to read characters from the RS232 port.  So in my Event Structure I created a case for dynamic user events.
    I also create a while loop that has the VISA Enable Event and VISA Wait on Event in it. I enabled the "Serial Character" event only.  When I get this event I use the Create User Event.VI and Register for Events to get a Event Refnum
    How do I get the Event Refnum from this loop into my Producer loop?
    Solved!
    Go to Solution.

    Paul_Knight_Lockheed_Martin wrote:
    Here is the code
    No, that is not the code. That is one subVI and a picture. Where are you waiting for the VISA events? Where are you generating your user event? Based on the picture you are calling the Initialize_Controller_Communication and remaing in that code until the Stop buuton is pressed. You will not start your event structure in the producer loop until this VI completes. So, if you are not hitting the stop button to complete your initializtion it is no wonder you are never seeing your event structure run.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • AE user event error

    Have an AE which has errors:
    Init - registers dynamic user events and Runs VI.
    Write - Attempts to generate user event to write data to VI which is running (Error 1)
    Close - Attempts to retrieve control value (safety cluster_out) from running VI and then close (abort).
    The VI gets to run but the generate user event produces an error.  I can't figure out why and I doubt this is the proper way to be doing this.

    Hi Battler,
    I see that you've created the user events, but registering them involes the Register for Events VI, which is located in the same palette. It looks like a property node but has a satellite icon in the heading. It's very possible I'm missing something. Could you post your main and subVIs so I can take a look at them?
    Pardon the messy snippet.
    I have another question, too. It looks like you're closing the reference to your subVI in the init frame. Is there a reason this needs to be done?
    Verne D. // LabVIEW & SignalExpress Product Support Engineer // National Instruments

  • Event Handler/Cr​eate User Event bug

    This is a problem I've run into a few times on my system (Win2k) so I finally went back and reproduced it step by step since it wasn't too hard. It causes LabVIEW to crash and exit without saving.
    - Create an Event Handler
    - Place 'Register Events', wire output to dynamic event terminal
    - Place 'Create User Event', wire output to 'Register Events'/User Event
    - Place an Empty String Constant [""], wire to input of 'Create User Event'
    - Set empty string property -> Visible Items > Label = True
    - Rename label from "Empty String Constant" to other such as "Event"
    OR
    - Create a cluster constant with something in it
    OR
    - Place a boolean constant
    - Set boolean property -> Visible Items > Label = True
    - Name label something su
    ch as "Event"
    - 'Add Event Case...' to the Event Handler, select Dynamic / : User Event
    - Delete the constant wired to 'Create User Event'.
    - Place a constant of a different data type and wire it to the input of 'Create User Event'
    LabVIEW immediately disappears (all changes are lost) and this error is displayed:
    ================================
    LabVIEW.exe has generated errors and will be closed by
    Windows. You wlil need to restart the program.
    An error log is being created.
    ================================
    If there is a more appropriate place to post things of this nature that don’t really add to the discussion group, but need to be brought to the attention of NI, please post a URL or submittal method. Thanks...

    Thanks for the detailed request. We are aware of this exact issue, and the problem was actually fixed for LabVIEW 7.0 for Mac/Unix. Unfortunately, it did not get fixed for the initial release of LabVIEW 7.0 for Windows, but we have plans to include the fix in the first LabVIEW patch for 7.0.
    Also, the Discussion Forum is great for notifications of this kind. For future reference, you also have the options of emailing NI engineers directly, or calling us with suspected bug fixes, if you would like more direct communication.
    Thanks again, and have a great day!
    Liz Fausak
    Applications Engineer
    National Instruments
    www.ni.com/support

  • Making an array of different user events refnums?

    Hello all,
    I have a question about dynamic user events. I have 6 different users events which I create, and would like to put into an array. (Such that I can use them in a For loop laters, taking off one event per loop and assigning it to a control of a vi) So far I haven't found a way of doing that since if I just wire the user events refnums to an array I get broken wires. (Similarly if I wire them to a build cluster structure.)
    I think that you'll understand what I am trying to do if you look at my labview code in the attached vi.
    In the vi I create some user events, and then wire them to the control of two vi's which will communicate to each other using these events. In the code you will see 6 Invoke Node structures where I use the "Ctrl Val.set" to pass the events to the two vi's. Obviously this is the wrong why of doing things. Since if instead of having 6 events I had 100, then I would need to put 100 Invoke Node structures on the block diagram (making it very large compared to the size of my computer screen!). 
    So what I would like to do, is put the user events refnums into a array, then put the one Invoke node structure into a For loop, and index the array to assign the events to the vi's programmatically. 
    Is there anyway of doing this? Or is there an alternative (/ better way) to what I have done?
    (Baisically I have 2 vi's that run in parallel and communicate to each other using user events. I need to pass the events to both vi's, how do I do it in the minimum of mouse clicks, and minimum of screen space.)
    Thank you!
    Paul.
    Solved!
    Go to Solution.
    Attachments:
    CameraTempControllerRunner.vi ‏49 KB

    I haven't created any new messages since the forum changed over, so I'm not sure.  But check on the menu under Options on the upper right.  I think there is a way to undo your choice and put it on another.
    Kudo's have replaced the stars.  Anything that was 4 or 5 stars is now equivalent to a Kudo.  But with the old system, anything less than 5 stars was essentially a negative opinion in the ratings.  So to simplify the multiple shades of gray (1 through 4 stars essentially being some degree of a negative) and to just eliminate the negative aspect altogether, the Kudo system was born.
    I don't know if the "Accepted Solution" designation does anything to help the person whose solution was accepted, but having that designation helps people searching the forum because they have the same problem find the answer quicker.
    Message Edited by Ravens Fan on 10-06-2008 10:15 AM

  • Handling User Events in sub panel vis and main vis with same Event reference Number.

    Hi All, Iam trying to work to handle events in both subpanel vi and main vi.
    I have a main program, and 2 sub vi. I will load the sub VI in 2 sub panels in main vi. Each sub pael vi has controls on it.
    I have created 2 User events for 2 sub panels vi. One user event consits of a Cluster with 2 Booleans (x & Y) and Other User Event consists of cluster of 2 unsigned 8 Numbers (a & b). These are created and registered in the main Vi and event register refnum is passed to the subpanel vi from the main panel vi.
    I have Event structure in main panel and sub panel vis.
    In one sub panel vi, When the value of one boolean(i.e. X) in the clusters changes, the Events structure in sub panel vi should perform some operation in sub panel vi only. When the value of other boolean (i.e. Y) changes it should perform some operation in main vi. I will try to Generate user event with the x value and Y value changed based on the control clicks in the sub panel vi.
    The OTher panel vi should behave in the smae way when the a & b value changes.
    The "Generate User Event" is working fine some times and sometimes there in no event triggered in the sub panel vi or main vi.
    Please let me know what is the problem Ramesh.

    There is a lot of talking, but not much understanding.  It'd be better if you posted some example VI's of what you are trying to do so that the words will make sense.
    One thing I can tell you is that you don't want to have two event structures handle the same event reference number.  You want to have two event registrations with each one going to its own event structure.

  • User event or event structure time-out

    Hi,
    I have two VIs one is a producer, one consumer.
    The consumer VI is called programatically (i.e. not wired) when the producer VI is run
    Both have user interfaces using an event structure.
    I have a control on the producer that i wish to use to trigger an event in/pass a value to the consumer VI. I have implemented this in two ways, but am not sure which is the 'preffered solution'.
    Solution 1:
    Detect  control activation in the producer VI using event structure, load new value in to a global variable.
    Use the time out event case in the consumer VI to load the value from the global variable.
    Solution 2:
    Set up a user event in the producer VI, load the Event Registration Refnum in to a global variable, use the event structure to create a new event when the control value is changed by the user.
    Use  Event Registration Refnum global variable in the consumer VI to trigger the event structure (loaded once, when the VI is first loaded).
    Solution two means the time-out event case does not need to be active, meaning the consumer VI will be doing nothing except waiting for either the user event, or direct user interaction. It will also not have the potential time delay of up to 1 x the time-out value of the event structure. It does require a sequenced start of each VI for the Event Registration Refnum to be loaded in to the global variable before the global variable is read by the consumer VI.
    My end application will be utilising a number of consumer VIs and will require user interaction information from the producer to be passed to them. Which proposed structure would be the generally accepted better practice? 
    ...or if i've missed the best solution, where should i be looking? 
    Thanks,
    Blue 
    (xp, LV 8.6) 

    Example of Queue based function Globals.To store the events and data.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=240328#M240328
    Balaji PK (CLA)
    Ever tried. Ever failed. No matter. Try again. Fail again. Fail better
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    AI Queue.vi ‏30 KB
    DAQmx AI.vi ‏59 KB

  • LV 7.0 extremly unstable while working with user events during edit time

    hi
    i create and register several user events inside an initializing vi and then pass the registered events to the event structure using dynamic events in my top level vi. all works fine untill i do some changes to the registered events, e.g. changing names, datatypes or add/remove some events. when doing so my LV 7.0 chrases after opening the top level vi (exception error, no *.cpp errors). all changes i made are going to nowhere. i understand that after the changes i made the registered events in my init.vi-indicator dosn't match the events in my event structure, but i can't understand that LV chrashes.
    here are my questions:
    1. is it a known problem to LV 7.0?
    2. should i reinstall LV 7.0
    (i have LV 6.x and 7.0 on my machine)?
    3. is there a fix?
    thanks in advance
    greetings
    chris
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

    Hello Chris,
    I have been looking into your problem and have come across one possible known bug in LV 6.1 that may be showing itself in 7.0. If modifications are made to the typedef of a registered event the vi will crash. I was hoping that you could post a small piece of your code and instructions on how to reproduce the crash. This way I can see if this is the same bug, a programming error, or an installation error. I can then determine if there is still a bug that needs to be looked into by our research team.
    Thanks,
    Caroline
    National Instruments
    Thanks,
    Caroline Tipton
    Data Management Product Manager
    National Instruments

  • Multiple user events

    Hello every body
    i'm using user event to generate two events i do not understand why my programm doesn't work when i use two user events 
    Attachments:
    sous VI.vi ‏8 KB
    sous VI 1.vi ‏8 KB
    tset user event.vi ‏17 KB

    I don't understand why you are causing an event within the same loop.  None of that code makes sense.  In general, a dynamic event should be created and registered before the loop with the event structure and the event should be destroyed after the loop is complete.
    As far as your other VIs, you should use a feedback node or unregistered shift registers to hold your value for C instead of using a local variable.  Look up a Functional Global Variable.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to use "User Events" in different parts of an application

    Hi,
    "You programmatically can create and name your own events, called user events, to carry user-defined data. Like queues and notifiers, user events allow different parts of an application to communicate asynchronously. You can handle both user interface and programmatically generated user events in the same Event structure."
    What you read was part of labview 7.1 user manual ( Chapter 9 - pg.12 ). I've some problems with the underlined sentence. I hope someone can help me.
    When using Queues, the programmer may use a named queue everywhere in the application. there is no need to wire queue reference among VIs or using global variables to store queue reference. the name of the queue will be all that you need. I wonder if it is also possible with a event refnum that is the output of "Register for Event" node. As far as I've tested. the answer is Negative! I tried to copy-paste refnum in front panels and using the same name. but there is no connection between event refnums.
    LV User manual claims that user events can be used like queues, but it doesn't seem so.
    Does anybody have an idea?
    Best Regards.

    I didn't look at Damien Gray's presentation recently, but if I remember it correctly, it is on a much higher level than what I meant, because it refers to LARGE application. This is a very simple one.
    Using a functional global is not problematic CPU-wise, nor memory wise (unless you get into really big data structures, like hundreds of MBs), so you shouldn't be afraid to use it. I'm also not sure why you're afraid of the loop. The loop is only there to "hold" the USR. It only runs once. If you want, you can replace it with a for loop that runs once. I've recently learned that apparently, you can also get rid of the loop and use a local variable (look at the example called XY chart) instead of a USR. I don't think a local variable should have any more impact than a USR, but that needs to be tested. It can definitely be more convenient for some VIs where you don't have to wire the SR through the entire VI.
    Anyway, you will need to have an "obtain ref" VI which will hold a 1D array of names and a corresponding array of refs. Then, you search the array for the name, and if it finds the name, it extracts the correct reference. You will also need a way to input references and names into the array and possibly a way to empty the array. You may need to have 2 levels - the inner VI will be the LV2 VI and the parent will be the obtain ref\fill array\close VI. You will need some error handling as well - what happens if you search for a name and it can't be found and so on...
    Hope this helps.
    Try to take over the world!

Maybe you are looking for