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

Similar Messages

  • How to make a simple control value comparison a user event?

    Hey everyone,
    I am trying (with no luck) to figure out how to make an event out of a simple control comparison without having to put the controls inside a while loop to be polled or in the event structure.
    For example; how do I make an event when 'numerical control 1' equals 'numerical control 2'?
    I know that I could have these inside a while loop with the event structure and then wire the comparison to a boolean, then reference the boolean's value change event.  But rather, I would like to create an event for the comparison without the boolean and outside the while loop such that the loop doesn't have to run through the comparison each time, and doesn't have to poll the controls and bool.
    Thanks for the help

    Attached is a simple user event structure that I was thinking about.  Using this you can decouple the control from the comparison, it just works on valye comparisons.  Since it uses the event structure there is no polling and is very CPU friendly.  I have allowedfor the comparison to be linked to the "Value 1:value change event" and the compare button true event.  I hope this is what you were looking at.  Also since it is a user event which is dynamically registered you can register/unregister it at will durring execution making it a flexable event handler.  It might be alittle buggy because I have spent about 3 minutes developing it (particularry when passing values into the event structure there might be a state issue from the data flow so local variables are a better choice)
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA
    Attachments:
    CompareEventvi.vi ‏49 KB

  • Starting/Stopping a polling loop with a user event.

    I keep reading on this forum that placing a loop inside a user event structure is a bad idea because it disables other user events from triggering.  However, it seems like a good idea to be able to start and stop a loop from a user event (like a button being pressed or de-pressed) and it seems like a good idea to not have the loop waist CPU resources while it does not need to be running.
    So what are the solutions to this?  Is a notification the best approach?
    Attached is my solution.  Is there a more graceful approach to this problem?
    Aside: Why are boolean controls that are of the "Latched" mechanical action always pressed in after their event fires?  For instance, the stop button on the attached VI?  Shouldn't it be depressed after the user clicks on it because it is "Latch when released?"  I've always wired "false" constants to 'variables' of these controls after the event structure fires, but do not find this approach very graceful.
    -Nickerbocker
    LV 8.5
    Attachments:
    Wait for Notification for Polling Loop Test.vi ‏25 KB
    wait for notification for polling loop test.jpg ‏61 KB

    Nickerbocker wrote:
    If an error is generated on the first itteration, then the loop is terminated with that error line.  Right?
    Wrong! The loop cannot terminate until everything in it has terminated. RIght now it will stall at the event structure no matter what until an event occurs. At this time it is sufficient to get the error piped through the event structure. If you are worried about an error in creating the notifier (anything that happens before the loop starts), you shold place your entire later code inside a case structure wired to the error so the loops don't even start.
    Nickerbocker wrote:
    Can multiple event structures exist in the same block diagram?  For some reason I was under the impression that there could only be one event structure that fires at one time.  If that structure was in execution then no other Event Structures could fire....  if my information is wrong, then I like your solution.  If it is right, then I don't like your solution .
    Your information is wrong again. You can have as many event structures as you want, and all is well as long as all event structures can execute in parallel. So make sure they are in independent loops.
    (If you would place two event structures in the same loop, both must trigger for the loop to complete the iteration, probably something that does not make a lot of sense. So don't do that!).
    LabVIEW Champion . Do more with less code and in less time .

  • Using an Event Structure to sense selection of a ring control

    LabVIEW version 6.1. Windows 2000. I am trying to develop a robust approach to sensing when the operator presses the lighted boolean push button to initialize a VI procedure. Presently I am using an User Event Structure. I have tried triggering on a 'value change', and 'mouse up'. Either one works properly the first time, then hangs on the second invocation of the button, with the push button LED light on - with no action - the event fails to trigger?

    In article <[email protected]>,
    new_user wrote:
    > Hi,
    >
    > Yes I will gladly post my VI.There are (2) block diagrams. The
    > 'setpoint' ring controls should invoke the upper block diagram in the
    > event of a selection.
    > The lower block diagram should be invoked when the 'Initialize
    > Displays' push button is pressed. It is turned off upon successful VI
    > execution.
    > Both are exhibiting the same symptom - only first time execution?
    Well they aren't in a loop so they are both wating for an event. Each
    one will fire once and then exit. There should be only one event
    structure and it should be inside a while loop. The loop should
    terminate when the stop button is pushed
    and fires the stop button value
    changed event.
    So, make the bottom event one of the events in the top structure and put
    the whole thing in a while loop. Make a stop button and make another
    event case for the stop button value change, wire the new value property
    to the loop stop terminal.
    Also you are using the value of the INIT button before it changes (ie
    the old value). That value is read before the value change and passed
    into the event loop. Move the init button to inside the event structure
    value change for the init button.
    Get rid of the local variable in the lower sequence structure in the
    init event case. There is no need for it. In fact get rid of the
    sequence structure entirely it is not necessary to force a sequence on
    those actions which should be optimized by the compiler.
    -Scott

  • Multiple "generate user event" in event loop

    Hello.
    1.)  I am wondering if you can user a "generate user event" into an event loop to create a quasi-state machine.
    For example create an event loop with the events "event a", "event b," "event c," and so on.   The in "event a" put in a function to generate a user event to call "event b".  Then "event b" will call "event c" and so on.
    2.)  If this is possible, then can u put multiple generate user events into a single event loop and have it queue the generate user events up.  For example have the "event 1" case use the "generate user event" 3 times (generating "event 7" "event 8" and "event 9.") to call the next three future event cases in that order?
    Thanks
    Charlie C.

    Of course it is possible, easiest with simply writing signaling properties. (See attached examples, LabVIEW 7.1).
    You have to be very careful that you don't create trigger loops, e.g. event A triggers Event B, which triggers Event A ... ad infinitum! :0
    Example "Multievents": event 1 triggers event 2, which triggers event 3.
    Example Multievents2": event 1 triggers events 2-3-2-stop in sequence.
    Message Edited by altenbach on 09-28-2005 01:26 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    MultiEvents.vi ‏57 KB
    MultiEvents2.vi ‏72 KB

  • The wait operation time out

    Dear all,
    I am facing one problem with my user pc "The wait operation time out"
    ERROR= 
    Aconnection was successfully established with the server. but then an error occurred during the pre-loging handshake. (provided , SSL providing error-0 , The wait operation time out microsoft SQL server error- 258.
    my user-pc use windows 7 and connect VPN by using "Sonic-wall" we connect successfully and get my remote server IP ping reply but when try to access remote server database that time I am getting this error
    At the same time using same network and id can connect the server from vpn and access database from other
    system.
    please help me sort it out this issue. 
    thanks 
    sajal 

    Hi Sajal,
    It is possible that remote machine(server) is up but please check whether database server is up or not.
    Please contact database administrator to know the status of database. This will help you to know the cause.
    If database is down you cannot connect it.

  • 504 PROXY TIME OUT. The connection time out

    Hi
    one of our users is facing  504 proxy time out. The connection time out 
    using our ITS link.  what would be the possible solutions to reduce this kind of error.  
    Regards 
    MA.Sreenivasan

    Hello,
    If only a particular user is facing this problem, check with the user on what she/he is doing.
    if everyone is facing, have a look at ITS timeout parameters.
    ~rfcTimeOut
    ~userTimeout
    Regards,
    Siddhesh

  • I am using many events structures in my applicatio​n,but i am getting caught in my problems ,can any body tell me abt events programmin​g on time out

    i have extensive gui application ,i am using events ,but i am caught,i want to konw abt events ,there pros and cons,time out ,how to program in time out

    It is unclear as to exactly what you are asking. The event structure is very handy for monitoring front panel activity and performing tasks accordingly. The default event in the event structure is the timeout. In order to set the timeout you just wire the amount of time before timeout (in ms) to the timeout terminal of the structure. You may have tasks that you want to perform at timeout or you may just have an empty case. I strongly suggest using a timeout and putting the case structure in a while loop in order to keep monitoring the events until the loop exit condition has been met.

  • Event Structure in Timed Loop in real time cannot work

    I am a new user for LabVIEW. And I met a problem which really frastre me!!! Hope someone can help me out. Thanks in advance!
    I simply want to use event structure under timed loop, which is extrmely important in my design.
    However, this works very good in my computer (without connect to FPGA).
    Once I connect it to FPGA, then I can run it still but there is no response!
    My file is attached. Please somebody helps me!
    Looking forward to your answers!
    Solved!
    Go to Solution.
    Attachments:
    Test for Timed Loop.vi ‏9 KB

    The FPGA runs headless. Event structures are not going to work. What you need to do is have an application on your host where the user presses a button, changes a value, etc. That event should send a message via TCP/IP to the code running in the real time environment. Then the real time environment should set a control on the FPGA to the value you want.
    In general, real time programming with FPGA has multiple layers.
    1) Host code-> handles user interactions and communicates them to real time code via TCP,UDP, etc. Displays data to user sent from the RT controller.
    2) Real time code->runs headlessly. Handles messages from Host code, processes FPGA data, communicates with FPGA much like the host code communicates with the real time code
    3) FPGA -> does acquistion and passes it via FIFO to the RT
    The first thing you need to do is understand the architecture and how all these pieces of the puzzle work together before throwing things down on a diagram.
    CLA, LabVIEW Versions 2010-2013

  • VI containing Event Structure will not receive front panel events in LabVIEW Real-Time.

    Hi again, I'm working in my first UI (attached VI).
    It works when running directly from PC. It doesn't when running from cRIO, there's the message "VI containing Event Structure will not receive front panel events in LabVIEW Real-Time". I've been reading and I found that "Event structures on RT targets do not support events associated with user interface objects, such as VI panels or controls. For example, associating the Value Change event with a control does not work. RT targets support only user events".
    Is that the problem? If it is, how can I create Mouse Up, Mouse Enter, Value Change (or other user interface events) user events?
    If I run my VI in FPGA mode should it run?
    Attachments:
    HMI.vi ‏33 KB

    Since it looks like you are new to the whole RT and machine control, I recommend giving this a good read: NI LabVIEW for CompactRIO Developer's Guide
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Run-Time Menu and Event Structure~~HELP~~

    Hi, brothers,
    I'm new user for LabVIEW. Use the version of LabVIEW is 8.6
    One problem describe as below:
    Can Run-Time Menu and Event Structure exist simultaneously?
    Without Event Structure, Run-Time Menu works well, but Run-Time Menu works abnormally.after adding Event Structure,
    How do I modify the problem?
    Thank you for your help.
    Attached is the program.
    Attachments:
    PC_Adjustment.zip ‏44 KB

    Yes they can coexist, but not how you did it.
    Every iteration of the while loop you wait for an event in the event structure, and you look if the user has selected anything from the menu.
    To get this working you should add an event for <this VI>\Menu Selection (User):
    Ton
    PS you should add a stop button, the only way you can stop the VI is hitting the 'emergency stop' button, with hardware connected (like you have) this is not the adviced routine
    Message Edited by TonP on 09-26-2008 07:34 AM
    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:
    Main_BD.png ‏5 KB

  • How to run the two events at the same time by using event structure

    In my project, I have to run two stepper motor which can run both forward and reverse direction by changing the control in front panel so I am using event structure. In front panel I gave two separate controls for both stepper motor such as forward,reverse and stop. I would like to do motor1 will rotate alone, motor2 will rotate alone and both motor will rotate at the same time when user click the control in front panel. My doubt is how to run a motor2 while motor1 is running at the same time please tell me the suggestion for this problem
    Attachments:
    motor.png ‏192 KB

    How do you control your motors?
    Most motion control systems do supply two modes:
    a) position based motion: The motion axis has a positioning system (most often some kind of encoder system) which enables the motion control to know where the axis is currently located. Passing the target location to the controller will result in the axis to move to that location. This is, for most applications, the recommended approach. It does require some sort of motion controller device.
    b) direction based motion: This essentially tells the periphery device for the motor to move at a certain speed into a certain direction. As it does not stop at a dedicated location, it induces great risks for many applications if there are no kill- and/or end-switches. Depending on the setup, this can be either done with motion controllers or pure by software control (e.g. "controlling" the voltage level for the motor).
    If you go for a), there is not much preventing parallelism as you request.
    Option b) depends on the setup. If you have a control loop in the software itself, you have to move to an architecture like the producer/consumer. Please note that this does not incorporate any security measures for the external devices.
    hope this helps,
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • LabVIEW Event Structure only accept user action?

    Hi All.
    For example, Event Struture responses to a 'BOOL Control' such as someone press the button.
    But, if I use property node to change Bool control status, Event Struture can not accept such a action?
    Why?
    Any solution for monitor variables and controls change which is not caused by user actions.
    *The best Chinese farmer*

    You can use the value signaling property node, if you want to go down the property node route. The best way would really be using user defined events and wire these events to the dynamic event terminal on the border of the event structure. You can check out the examples that ship with LabVIEW to see the VIs that you would need to accomplish this task.
    Hope this helps.

  • HT5129 I have 30+ iPhoto Libraries, so every time I open one, iphoto wants to copy the 3 events I had out there when MobileMe shut down. Those 3 events are saved in the appropriate iPhoto libraries. Wish I had deleted them on MobileMe! How do I turn this

    I have 30+ iPhoto Libraries, so every time I open one, iPhoto wants to copy the 3 events I had out there when MobileMe shut down. Those 3 events are already saved in the appropriate iPhoto libraries. Wish I had deleted them on MobileMe! How do I turn this process off?

    As Larry mentioned I use a different DAM (digital asset management) appliclation, Media Pro 1. For other possible DAM apps visit  The DAM Forum which is for professional photographers.  There the various apps are discussed along with workflows.  If nothing else you'll get some good information on managing digital "negatives".
    Media Pro lets you manage the folder organization of your photos and write metadata, keywords, titles, and other metadata directly back to the files.  No matter what app you go with have a backup plan in place to keep current backups of your source photos on separate hard drives.

  • User interfaces and event structures

    I am just learning to use event structures to improve operation of front panels.  At the moment, I am working on a tab strucrture we use to montinor/set program paramters.  VArious parametera are displayed on each tab as controls (not indicators) and are constanly updated sice they can be modified elsewhere by other pieces of code.  We controls are normally disabled via a property node so they behave more like indicators and the values are updated by writing to a local variable (I know this is evil but it works in this case).  There is a boolean on each tab that toggles between "monitoring" and "changing" modes (or states).  When toggles to "changing" (or setting) parameters the monitoring activities are suspended and the control are enabbled.  After making the desired changes the controls are either read and the changes implimented or get rest based on some other boolean controls, the parameters controls are then disables and monitoring resumes.  The issue is that many users fing the need to toggle between "monitorsing" and "changing" modes to be confusing.  I want to replace this switch with an event.  If the user clicks on any of the parameters controls in a tab, I want to go into changing mode rather than using the "monitoring"/"changing" boolean control.  All other asspects are handled as before.  My problem is than if I use a mousedown event to go into "changing" mode and the user clicks on several parameters to shift the keyboard focus to edit more than one parameter, these subsequent mose clciks get processed as new events when change mode is exited.  This means that as soon as it returns to "monitoring" mode it jumps immeadiately back to "changing" mode.  How should I structure the events to avoid this problem?
    Thanks,
    --Lee

    Lee,
    Instead of using a "mouse down" event, use a "value change" event for each
    of the controls. Then your program can switch to the "changing" mode
    whenever the value of the control is actually changed.
    TJW
    "Lee Robertson" <[email protected]> wrote in message
    news:[email protected]...
    >I am just learning to use event structures to improve operation of front
    >panels.&nbsp; At the moment, I am working on a tab strucrture we use to
    >montinor/set program paramters.&nbsp; VArious parametera are displayed on
    >each tab as controls (not indicators) and are constanly updated sice they
    >can be modified elsewhere by other pieces of code.&nbsp; We controls are
    >normally disabled via a property node so they behave more like indicators
    >and the values are updated by writing to a local variable (I know this is
    >evil but it works in this case).&nbsp; There is a boolean on each tab that
    >toggles between "monitoring" and "changing" modes (or states).&nbsp; When
    >toggles to "changing" (or setting) parameters the monitoring activities are
    >suspended and the control are enabbled.&nbsp; After making the desired
    >changes the controls are either read and the changes implimented or get
    >rest based on some other boolean controls, the parameters controls are then
    >disables and monitoring resumes.&nbsp; The issue is that many users fing
    >the need to toggle between "monitorsing" and "changing" modes to be
    >confusing.&nbsp; I want to replace this switch with an event.&nbsp; If the
    >user clicks on any of the parameters controls in a tab, I want to go into
    >changing mode rather than using the "monitoring"/"changing" boolean
    >control.&nbsp; All other asspects are handled as before.&nbsp; My problem
    >is than if I use a mousedown event to go into "changing" mode and the user
    >clicks on several parameters to shift the keyboard focus to edit more than
    >one parameter, these subsequent mose clciks get processed as new events
    >when change mode is exited.&nbsp; This means that as soon as it returns to
    >"monitoring" mode it jumps immeadiately back to "changing" mode.&nbsp; How
    >should I structure the events to avoid this problem?
    > &nbsp;
    > Thanks,
    > &nbsp;
    > --Lee

Maybe you are looking for

  • PGI Accounting Document

    Hi, After PGI, material document gets trigger, but in material document, when I click on "Accounting Document", system give me following message: Material document does not include an accounting document Do let me know any settings to create accounti

  • "WRITE CODE FOR ME"

    SALAM COMPUTER SIR, I AM STUDENT OF COMPUTER SOFTWARE ENGINEERING .PLEASE HELP ME ABOUT I SEND YOU PICTURE OF MY PROJECT.PLEASE YOU MADE CODING FOR THE PICTURE IN JAVA LANGUAGE.PLEASE YOU GIVE ME SOURCE CODE OF THIS PROJECT PICTURE IN JAVA LANGUAGE.M

  • ~ I AM NEEDING HELP PLEASE ~

    HI, MY NAME IS JOE AND I HAVE BEEN TRYING TO GET MY IPOD TO WORK FOR ABOUT A MONTH KNOW. MY OLD IPOD STARTED MESSING UP, SO I SENT A NEW ONE IN AND APPLE SENT ME A BRAND NEW BLACK 2GB IPOD. IT IS HAVING THE SAME PROBLEM AS THE OTHER IPOD HAD. WHEN I

  • New learner

    Hello Frnds I am Alnoor, new user, having just completed my Masters in Accounting, can any one could help me how  to go about SAP FI/Assets accounting as well as SAP HR modules.  where I can find useful resources and its limks. plz guide me as to how

  • Drop Ship : Service Item

    Hi Guru's Please let me know whether Dropship process can be done for the Service item's Requirement need to create Quote for Service item, then followed by Order and follow the drop ship process. Thank you in advance. Regards Nikal