Event Structure hangs VI

I am using Tab Controls in my VI, and want to reset some Button
Controls (using property nodes) when the tab controls change value. So
i have tried to use an event structure which contains a FALSE constant
wired to the VALUE property of several Button Controls. It works just
fine, the only problem is that i cant operate any buttons or stop the
VI from the stop button. It seems like the event structure hangs the vi.
I guess there is a simple solution to this problem, but i cant find it and i am getting desperate... Please help!
Attachments:
event.jpg ‏29 KB

Hello Vatoloco,
I can't give a short (correct) answer but:
The vi structure will always get every event. If you have selected to 'lock front panel until event structure done' (as is by default) for this event it means that :
The front panel is unresponsive until the event has executed
This is a tricky thing because if the event structue isn't executing, it locks the front panel. A quick check for this is to deselect this option.
If that works you have to redesign your vi. Have a look at the design patterns that ship with labview. Or you could look with high-lite executing where your VI 'is' when you change the tab control.
Ton
PS For a more correct post, search this forum with a broader timespan (let's say 12 months or so) you're not the only one!
Message Edited by TonP on 04-21-2006 01:43 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!

Similar Messages

  • Event structure will hang if i click the button fast

    i trying to debug the program, and i realise that the event structure will hang the program is if i click the button that event structure detecting fast,
    it will hang and stopped there...
    is this a bug or what?
    even i place a time delay in it also no use...
    the event is mouse down for button

    Hi AxE,
    I apologize for the oversight. Please find the attached VIs (now converted to LV 7.0). Apart from changing the "mouse down" event to "value change", I have also changed the mechanical action of booleans to "latch when pressed" . This would change the value of the button only during the duration it is pressed. As soon as it is released, the value of the button will revert back to its default value('false' in our case) so we dont need to change the value of the button inside the event case.
    Windows.cpp error in Line 2978 has indeed been reported to National Instruments. The LabVIEW R&D team is investigating the error.
    Regards,
    Ankita A.
    National Instruments
    Attachments:
    AxE's_TDS_420A_Application_Test.vi ‏155 KB
    CallWF.vi ‏20 KB
    RecordWindow.vi ‏182 KB

  • Can I use Event structures in a subVI?

    Hi,
    I have a subVI (ProvaEv1.vi) that use an event structure inside. But when I use it in a VI (ProvaVI.vi) the event structure in the subVI doesn't catch the events.
    I tried to insert the event structure in a while loop but it doesn't work too.
    Could you help me?
    Thanks Ius
    Attachments:
    ProvaVI.vi ‏11 KB
    ProvaEv1.vi ‏15 KB

    "iusn" <[email protected]> wrote in message news:[email protected]...
    Thanks to all for your answers!
    Wiebe! I tried to do as you suggested but I am not able to link the Event Reference Number inside te SubVI with the Event Register Number of the Register for Event in Main VI. There is e class conflict. Another question: how the SubVI can know the structure of the Register event outside?My aim was to create a modular structure but it seems very difficult, wath do you think about these problems?
    The broken wire is related to your question. The event structure inside the sub vi knows about the events you register in the main, because the reference wire/control has a "strong" type. It contains information about the registered events. That is also why the wire is broken. You have to register all events, then create an indicator/control of the output. Use that control in the subvi. You have to do this every time the events change (you might use a type def if you use the control a lot).
    Usually, the events that you would want to put inside subvi's are those related to user interface objects. I've had this a lot. You make a nice interface, but it's not reuseable, because the events are mixed with all the other events. Only solotion is to manually add the needed event cases in your program, and copy the code.
    Even if you can put the events in a sub vi, I'd expect hanging vi's when more subvi's are registered for the same event. It's hard to tell without trying. So it's not a real solution either.
    Like Chrisger suggested, the event callback might help a little, but they are tricky, and actually ment for this (they are intended for activex callbacks).
    Perhaps you should look at XControls (if you use 8.2). It would be more work to replace your code to XControls, but once you're done, you have reusable code.. Haven't worked with them jet, but they are invented for this problem...
    Regards,
    Wiebe.
    I have already create my application using event structure just in Main VI but it seems very complicate to read and keep update, I would have wanted to give modularity to my application.
    Thanks Ius
    SubVIEventMain.vi:
    http://forums.ni.com/attachments/ni/170/203225/1/SubVIEventMain.vi
    SubVIEvent.vi:
    http://forums.ni.com/attachments/ni/170/203225/2/SubVIEvent.vi

  • Event structure freezing when short delay inserted

    Well, the simple stuff in LabVIEW I can do, but I'm still struggling to get my head around the concept of "Events" and how LabVIEW handles them. If I only have one type of event (i.e., pushing a button out of several on the UI, or reading a serial input and handling it programatically), I think I'm good. But my application requires me to be able to handle either of these at the front panel.
    Going through the LV Knowledgebase got me this link (it's a little old - LV8.6, but seemed to handle the basics), from which I downloaded "events.vi" (attached). My situation is a little different, so I modified it a bit to "EventExperiment.vi" (also attached) to have a bare-bones template I could use for my application. If I run it as shown, it seems to run fine (with a serial input, the "1" and "2" lights turn off, but the Bytes at Serial Input indicator always shows "0" and the "Serial Indicator" light never lights - I am assuming that these change and revert too quickly to see in the UI). My concerns with my VI are:
    If you add a short delay in the processing of the serial input event (say 1 second delay in that event case, or even a 1 second delay subVI after the serial flush connected through the error line), the VI accepts no further UI input after the first serial event.
    If you add an error wire through all the events subVIs (whether you merge this wire with the one going through the serial subVIs, the program just hangs up.
    And, one little bothering thing is that the original "events.vi" takes three presses on the "stop" button to close. I'm figuring here that it's because of those local variables being passed between loops, but it hasn't been enough of a bother to worry about.
    Your help is greatly appreciated,
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ
    Attachments:
    events.vi ‏24 KB
    EventExperiment.vi ‏25 KB

    Well, I thought I'd add a final post for some closure to this one.
    To summarize what I was trying to accomplish: I wanted to have some kind of an event structure where you could use both regular User Events (button pushes, numerical control changes, etc.) and an outside (non-keyboard/mouse/touchscreen) event, like a serial character coming into a COM port, to initiate an action. This was to eliminate a loop where the computer would be polling the COM port continually at a pretty fast rate. (I must have read a hundred times in the past month that you don't want to run a While loop for polling if you can help it.)
    It turns out (after a couple of confusing days, I talked with the NI service engineers) that you can't do this. In order to detect a character at a COM port, you have to be polling the port periodically with a Read and look for a change in the bytes available or another parameter. You can do this through a timed loop separate from your Event loop or through a Timeout event case inside the loop, like Don_Phillips suggested.
    However, I believe I'll go the separate loop route, since my head's actually more comfortable with it than the Timeout route.
    Thanks, folks, for your help,
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Event structure: have one event trigger another event

    I have an event structure with two events. I want the finalization of the first event to trigger the second event. Both events are triggered by a boolean value change, say "boolean 1" and "boolean 2". Can I have a local variable of boolean 2 inside event 1. By changing its value, it should trigger event 2. However, this doesn't seem to be working. (see attached example)
    any help?
    Solved!
    Go to Solution.
    Attachments:
    test.vi ‏9 KB

    Tim's reply is the answer you are looking for.
    I would like suggest that you create a sub-VI that doesw the work in the second event you want to fire so tht rather than resorting to having one event trigger another, you can simply use the sub-VI that does the work in event_2 after the sub-VI that does the work for event_1.
    If you decide to stick one event triggering another, please clearly document the sceme in BOTH events. What you want to avoid is latter deciding event_1 should be triggered by Event_2 and the next thing you know, your app hangs.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Multiple Event Structures - LV8.0

    So why does this program hang?  I know that it is best to use one event structre but why?  It seems for a simple application that this should work.
    Matt
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
    Attachments:
    multipleEventDiagams.vi ‏15 KB

    That certainly explains the hanging you saw. Remember that Event Structures by default will lock the front panel until the event case for a given event occurs. So in your VI, if you press Button 2 once, then you terminate the bottom loop. But the event structure is STILL registered for the Button 2 event. So when you press Button 2 again, the front panel gets locked, because the bottom event structure will never get to execute again (its loop has been terminated).
    You could have fixed this (I realize it all boiled down to a mis-wired connection) by unchecking the check box in the Edit Events dialog for your Button 2 Value Change event case that says "Lock Front panel until...".
    Hope this explains this, even though you've solved it!
    Jarrod S.
    National Instruments

  • Trigger Event Structure in SubVI

    Here's my goal.  I have a VI that sets two analog outputs which in turn control a power supply.  One output controls voltage while the other controls Current Limit.  I created a VI which uses an event structure so that when the voltage or current limit is changed, the analog outputs are adjusted accordingly. 
    Now, I'd like to turn that into a SubVI and have it running in the background while my main VI runs.  I'd like to be able to go into the subVI and change those values at certain locations within the main VI.  I tried just using the subVI with register events, but it hangs because it is waiting for the subVI to finish before continuing.  I tried using the Run VI methond with "wait until done" set to false, but then I don't see how to trigger my events because I can't link my mainVI to the events that need to be triggered.  I can set the control using Control Value Set, but that doesn't do anything for my event structure and thus stuck again. 
    Maybe the event structure isn't the best way to do what I'm seeking.  But I don't want to set all this up in my Main VI because it just adds too much complications and I already have the VI working by itself and just want to turn it into a subVI.
    Thanks.

    You could either get a reference to the SubVI and find the specific control like the attached picture, or you could pull the SubVI out of the main loop.  If the SubVI is necessary for data flow, you are almost certainly going to have a hang up if you don't call it by reference.
    edit - Another, probably less popular, option would be to have the subvi running in a parallel loop and have locals take data from the control loop and write to the command loop.  You'd have to be careful to only have one local writer, though.
    Message Edited by JeffOverton on 01-30-2008 02:39 PM
    =============
    XP SP2, LV 8.2
    CLAD

  • Event structure inside a case structure

    Hi,
    I've got a problem w/ my porgram, and managed to boil it down to this
    simple example.  The program basically hangs if you change the
    Numeric value when the boolean is false.  I don't understand
    why.  I suspect it has to do with the way event structures are
    treated, but if someone cou please explain this I'd be greatful.
    Also, now imagine I have 7 numeric controls, handled by 7 cases in that
    event structure, and I actually want to do things in response to the
    value change for each.  Can someone suggest an elegant way to do
    that?  I thought what I had here was a good design, but apparently
    not.
    Bjorn
    (I'm using labview 7.1)
    Attachments:
    EventInCase.vi ‏24 KB

    It is generally a bad idea to place event structures into cases. Events structures need to be able to breathe.
    Maybe you can redesign your program and place the case structure inside the event structure, for example? (Also have a look at the online help for the event structure, especially the link "caveats and recommendations for using events ".)
    Detailed analysis:
    Your event case for the numeric is set to "lock front panel until event completes".  If you change the numeric while the case is false, the evet structure cannot execute, so the front panel locks forever. The observed behavior is as expected. All clear?
    In addition, if the case is false, the main loop spins at nearly infinite rate, consuming all available CPU. Place a small wait to be more cosiderate to everything else running on your rig.
    LabVIEW Champion . Do more with less code and in less time .

  • Event structure in sequence structure troubles

    Hello, for class I have to write a simple LabView calculator but I'm having some issues. This is my first taste of labview so I know the code isn't the best but I just would like to know what's causing my hang up. I have two similar event structures with in a sequence structure. When I run it it goes through one loop of the while loop and then hangs, I tried stepping through it but can't figure out where it goes. If I don't have the second event structure it works more or less fine. Been working on this all day and hit this wall. Thanks.
    Attachments:
    lab1_3_try.vi ‏132 KB

    You cannot have two event structures like that. Event structures queue up events, even if they cannot react to them because of dataflow. Your second event structure will also queue up all the events, but cannot execute them because it is not in the dataflow. In addition, your events are configured to lock the front panel until the event completes, and since some events can never complete, your panel is locked up forever.
    Don't duplicate code twice, just keep state (A or B) in a shift register and do everything in a single event structure in a single loop.
    What prevents you from hooking up the numeric terminals and buttons? Try to eliminate all these local variables keep the data in a shift register instead. Place each button terminal inside it's assiciated event and make them latch action. Now you can use "value changed" events instead of "mouse down".
    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

  • Can you share FP Controls between different Event Structures

    I'm creating a program that will either read real-time data from an VNA on the GPIB bus, or read a saved s2p (Agilent) file and analyze it. The FP consists of 5 graphs, and various controls which handle events like printing, changing filters, or exiting. on the BD I have a case structure controlled by an operator selection pop-up. I tried using the same FP controls in the event structures I have setup in each case, as only one event structure would ever be executing at any given time, but the program doesn't seem to like it ast run-time. I've worked around the issue by creating "duplicate" controls and using the property setting to make them visible/disabled, etc., but the is seriously congesting my BD.
    Anyone know a way to share controls with seperate event structures?

    It sounds like the root problem is the overall structure of your program. I highly recommend that you check out the Queued Message Handler project template in LabVIEW 2012, that will show you how to utilize a single event structure and pass events to a consumer loop. If you program is too large to consider an architecture change at this stage of the game, then there is a workaround for your problem.
    What is most likely happening is that you have the event structures all set to lock the front panel until the event completes. However the case structure that you have wrapped around these event structures is causing all but one of these event structures to be unreachable thus preventing you from handling the event. Again, as I stated above, the "RIGHT WAY" to fix this is to select a better program structure but the "kluge work-around" fix is this: Dynamically register for the value change event on all of the controls you are trying to trap events for. Dynamic events can be deregistered and re-registered at run time. This will allow only the event structure in the active owning case structure to be registered for the events, thus no other event structures will get in your way.
    Disclaimer: This advice is given based on very minimal information and a great deal of speculation and may not be correct. Please include your code if you need further assistance.
    Charles Chickering
    Architecture is art with rules.
    ...and the rules are more like guidelines

  • Daqmx "Done" event not triggering event structure

    I would like the user to be able to abort my daqmx task by pressing a button.
    I am attempting to use the method in this VI:
    https://decibel.ni.com/content/docs/DOC-15815
    It utilizes an event structure with the daqmx Control Task VI to abort.
    The example VI above works for me, on my system with my USB-6356 device, as expected.
    When I attempt to incorporate the same method into my VI it does not--despite having an identical arrangement, so far as I can tell.
    I believe that my problem lies with the event structure, and the dynamic registration.  I am unfamiliar with this and must be using it incorrectly.
    I have attached my VI, though it is cumbersome.  The code which I am struggling with is in the "Acquire" case.  As far as I can tell, I am doing exactly the same this in this particular case as in the example mentioned.  Yet in the example, the event structure completes, or aborts, whatever you want to call it, right after the "Wait Until Done" VI executes.  In my own VI, the "Wait Until Done" and "Clear Task" VIs execute, but the event structure does not register it.
    Here are my specific questions: is there anything extra or special that one must do in order for the Task to properly trigger a "Done" event and pass through the event structure?  At what point is the daqmx task "Done"? 
    thanks,
    Matt
    Attachments:
    BoomTubeMain.vi ‏175 KB

    natasftw,
    My event structure is identical to theirs; what you are seeing are the two different cases that exist in the event structure.  In both the example and the VI, there is a <task out>: Done and a "Dynamic Event": Value Change.  In the dynamic event case, I have my abort button and relevant code--this I believe is the code you were referring to, which you thought I was missing...  Regarding my multiple event structures, they should operate completely independently as they respond to different events.

  • Stop execution of a loop in an event structure

    I tried searching the forums to avoid posting a duplicate, but most I could not open most of the vi's as they were higher version.
    I put in a dummy while loop in an event structire i intend to use. Once I start executing the while loop, I am not able to stop it using a control for some reason from the fornt panel control.
    I am not able to change the vale of the Stop control at all. I tried creating a seperate event for STOP, and I still could not stop the program when the While loop was executing.
    I imagine I am missing something really small. I would appreciate your feedback on this.
    Thanks,
    Nevil
    Solved!
    Go to Solution.
    Attachments:
    FrontPanel.vi ‏34 KB

    Right click on the event structure and choose "Edit Events" for the case that is giving you trouble.
    Be sure the checkbox to lock the front panel is unchecked.
    I suspect yours is checked, so your front panel is locked out until the event completes, thus you can never stop your loop.

  • Event structure in Sub VI

    Hello ,
     I have a developed a program which captures video and user can save images out of it. I have used .NET reference to handle the video part, and the VI is attached in this post. Now i have to make this VI as a sub VI and running this from Main VI. I tried creating event structure in Main VI which i used in sub VI , still i could not suceed. Kindly assist me in this regard
    Solved!
    Go to Solution.
    Attachments:
    Webcam-Control-Projekt-mit-Reference-Design-2013_original.zip ‏286 KB

    Hello Michael,
     I have attached a model in which Main VI calls the Sub VI using Event Structure. Two events can occur in Main VI and their corresponding event Structure is called in Sub VI using Register events. When i run this VI the out put is fine some times but other times i need to trigger event many times before i can see its effect in Sub VI, my doubt is that Register events are reliable, whenever (during the execution of LV) if event occurs will surely its code in the sub Vi gets executed?
    also I have put a indictor(numeric) in the SUb VI which i connect back to Main VI, when i run, i can see the result only in the sub VI not in the main VI.how to see in Main VI?
    I have used the this model (which is attached ) to implement my project(which i already mentioned) . one switch for starting the video and other for recording the image. The video is getting started with out any trouble, but imgae is recorded only few times when i press the button which is for image recording, most of the time second event fails to get executed. Also there are difference in output when i run with and without "Highlight execution", why this happens, is this because of Reg events?
     any more info if required let me know, i will provide.
    Attachments:
    Main_sub_VI.zip ‏18 KB

  • How to make Vi file as input file in Event structure?

    Hiii All..
    i got problems when to construct a event structure. The file input  (vi format) doesnt have source of wire connection to conect the wire (shift register) .For your information the vi that i create only contain simple mathematical equation.
    I already study the New Event Handler Example. but the file input for that example (acquire data.vi) have a source of connection. anyone can help me? 
    thank you very much
    [email protected]
    Solved!
    Go to Solution.
    Attachments:
    TOTAL.vi ‏18 KB

    Well, in your subVI you do need to wire up some inputs and outputs to your connector panel.  As I said, a basic LabVIEW skill that you will find in the tutorials.
    You have a number of inputs to your subVI.  More than you would want to attach to a connector panel.  You should perhaps use a cluster to group them together.
    To get you started, here are the steps to connect a control or indicator to the connector panel.
    1.  Open subVI.
    2. Right click on icon at upper right.  Show Connector.
    3.  Hover over a block you want to be a connector terminal, it will change to a spool of wire.  Click.
    4.  Go to the control or indicator on the front panel that you want to associate it with.  Click again.
    5.  Repeat as needed for other controls and indicators and save your subVI.  Now the subVI instance in your main VI can have wires connected to it.
    You should plan your connector panel so that controls are on the left side of the panel, and indicators on the right.  This will allow data to "flow into" and "flow out of" the subVI in a normal looking left to right orientation.

Maybe you are looking for

  • Mini displayport to DVI adapter inadequate

    Naively I thought that all DVI adapters were create equal and until I found otherwise I assumed that Apple's adapter would just work. The problem is that I just wanted a DVI adapter that would work with any DVI device out there, little did I know tha

  • Outlook 2010 - Strange email bounce back issue.

    Hello,    I have a user who's emails are getting rejected by some mail servers.  We are on Exchange 2007, and the user is using Outlook 2010.  The strange thing is, I and many other users on the same server can send to the same address no problem.   

  • Itunes reopens after quit

    Hello, brand new on the forum/discussions. It is really annoying whenever I quit iTunes, it automatically opens itself again. I then wait, quit it again and then goes away. Not really demanding answers, but wanted to let the main guys know about this

  • How to print checks cretaed manually

    hi i have done payment using f-53. i created checks using fch5, i want to know how to print them .

  • Re[2]: Polymorphism - retrieving type information from thed

    To add to Inderjyot's comments there is an excellent white paper at Scott Ambler's web site on mapping objects to relational databases. The web site is: www.ambysoft.com. This white paper is at www.ambysoft.com/mappingObjects.pdf /\/\ark /\/ichols Te