Two loops of event Structure: hang

Hello

I have a wired problem when I try to use two loops with two event structures (see VI below).

The problem is that you can stop the measurement and close the VI with X but not to stop it only with STOP button: this would lock the façade.

Here my (rather long and perhaps not quite understandable) description of VI:

A structure must respond on the user interface and the other a certain action. The first uses only user events: change value button START, PANEL NARROW? and the value enum STATE changes. The second event structure uses those registered dynamically: start the event user & user close event. Action when the STATE changes from button should always be done. When you press start the startup user event disables the START button and activates a loop in the second structure that should make continuous measurement. Now, we can always change the STATUS button and information (this works). The measurement loop should stop if the STOP button is true. Later START is enabled again and we should be able to press START again. It does not work as the front panel is locked. Curiously the last implemented user action works very well: by pressing X of VI, the PANEL CLOSE? is called in the first loop and should stop the two loops: If the measurement loop is running, STOP is True first, stop the loop measurement. Then a secondary structure event waits until the JUDGMENT is again set to False. If the measure is not in the process of running the first loop stops. In both cases, the event close user is sent to the second loop, successfully stop.

I'm really confused, because I have no idea what is wrong. I would greatly appreciate any help on this.

Best regards

Daniel

Thank you very much! This solves the problem. I did not understand that structures of events queued events even if they are not "active".

(Finally there is even no need one notifier, you can just change the value of the real STOP button and will raise the event close user, comapare attached, work VI)

Thanks again,

Daniel

Tags: NI Software

Similar Questions

  • While loops and event structures

    Is there a problem using more then one While loop with an internal structure of the event, in a single VI?

    In my (only a partially attached printscreen) VI there is more then 2 all in curls with a structure internal even who controls a different devices.

    Event structures are being controlled by a box structure.

    From time to time the VI gets stuck and resetting local variables.

    Hello

    Using two while the loop is not a problem, it depends on how you structure the code.

    Generally, we use two while loop for Producure-consumer, master - slave structure type of applications. Try to use the structure of State machine inside while loops, see standard state machine examples in the palette of NOR find example.

  • LabVIEW measures two loops (cycle of Charge and discharge) of writing to a file

    Hey,.

    I was wondering if it is possible to write measures Labview two loops (stacked sequence Structure) in a single file. Currently, he prepares the loading of data in a single file and discharge data in a single file. I have to every time the data for the chart of the charge and discharge cycles combine and sometimes there are about 50 cycles and by copying and pasting is time consuming.

    I'll try to upload my vi a little

    Hi basketball.

    I thought you loops run in parallel. In your case, you can simply use the same path for your files. Change the option to 'apend to the file. After these changes, the two loops must write to the same file.

    Mike

  • event structure and while loop iteration

    Hello

    It took me time to identify the problem I have, but I think I've nailed it and need help to solve.

    I am right to say that a while loop that contains a structure of the event will travel only once and then wait for another event to occur before a loop again?

    The question I have is that I need mark to a timestamp of a data acquisition driver (DataTaker) value, and whenever he changes the Labview event structure would take care of the rest of the incoming data.

    So is there a way to make everything in continuous loop on questioning my value of timestamps from my Datataker driver so that I can create an event Value (Signaling) for the Structure of the event to take care of?

    Thank you

    Richard

    Two options.

    1 put the stuff event to query a regular base in its own while loop that runs in parallel to the loop containing the structure of the event.

    2 put the stuff that you need mark in the case of delay of the structure of the event and a thread time-out value in the upper left corner of the structure.  Now, if no event to occur in this time, the structure of the event will run the case of timeout and the loop will iterate again.  The only problem with this method is that the case of timeout to run irregularly, or never at all if it turns out that events come more frequently than the timeout value.

  • generate the event user triggers two events structure

    Hello

    I would like to generate a while a user event that triggers events in two or more loops loop event.

    I have attached a non-fonctionnel project VI, so easier to show what I would understand.

    My experience is that user generated event cause that a case of Structure of the event, not both. Why? What if I want the two loops of the event that will be raised? How can you make with the user event?

    Maybe someone could explain this a bit deeper?

    Thank you very much!

    Kind regards

    PS. : new problem with forum upload file...

    So here's the VI in my dropbox:

    https://DL.dropboxusercontent.com/u/8148153/draft_to_show.VI

    Classic mistake.

    You need TWO 'register for events', the output of each class to a separate structure of the event.  Then it won't work.

  • Control of the event: how to stop the race while loop within a structure of the event

    Hello

    I have some problems with control of a while loop inside a structure of the event (see annex VI).

    I have 3 buttons (the "Start measurement, stop, exit the program"). When a measure is running, it should be possible to stop the measure by clicking on "Stop the measure", but it does not work.

    Someone at - it an idea?

    Thank you very much and best regards,

    Michael

    Hi Michael,

    create a process parallel to your measurement. You can use the design model "producer/consumer with vents. You'll find it with «File-> new...» ».

    Another possibility would be to remove the "lock frontpanel" sign, in the case of event start measurement.

    Mike

  • How to control a VI (with a while loop and a structure of the event) from an another VI

    Hello

    I have the main VI which I want to be driven from an another VI. But I can't do that and I don't know what is happening.

    For example: VI main, I have a while loop with a structure of the event, there is a Boolean controller controlling a Boolean LED, which is inside the structure of the event. And the other VI, there is just a Boolean controller and functions of applications to open the main VI.

    How can I control the Boolean LED in VI main, changing the State of the Boolean controller in an another VI?

    Thank you.

    There are different options, but depending on what you want to do. For this example I can't give you a specific solution.

    I do not understand why you do what you do. Why do you call your 'principle VI' dynamically? What is the advantage to do? There are also other ways to call a VI dynamically, based on real cases (for example the method "call and forget", etc...).

    In you principle VI, control you Boolean ("THATCHER") is not the case of corresponding event. This is not usually a good practice, keep it inside.

    Also, why you try to communicate with the caller and callee VI through such a way to twist? There are better ways to do it.

    In one of my projects, I use the user event to launch orders in case of case of appellant VI.

    some Associates more readings for you:

    http://www.notatamelion.com/2015/03/23/how-to-make-dynamic-subvis/

    http://forums.NI.com/T5/LabVIEW/Dr-Damien-s-development-event-structures-III-communicating-with/m-p/...

  • Loops Parallels and Structure of the event

    Hello

    Is attached a valid way to the use of the structure of the event?  I keep hearing that the case of the event should include control of the event.  Can the control be placed elsewhere?  For example, if I have 2 loops, I placed a structure of the event in the 1st loop and control associated with the event in the 2nd loop, is there a potential problem?  It is true that no matter where a Boolean with a value change is read, the Ministry of value in the event structure will be fired?  See attachment.

    This screenshot you posted should work for you fine.

    The main reason that you hear the case of the event should contain the control for the event is so that the control is read and for locking of Boolean values, gets reset when the case of events runs.

    Here since the first parallel loop runs (assuming nothing else in the loop causes the loop to get blocked), the stop button will read and reset.  The value change event will always be raised in the upper structure of event loop.

  • Produce data of a loop with a structure of the event

    I'm relatively new to Labview programming (as discussed in my program below). I found a vi online which collects data from an analog USB card to 9237 bridge. The upper part of the vi is which collects the data. The original place the output into a chart, but I changed it to a digital indicator.

    The lower part, trying to get the operator to use the start, stop, buttons to interact with the system to reset. I used an event structure to do this. It all works well, except the event that the value of the load of data (from the loop above) cells. I want to follow up on the new value continuously, but is only once. All other features work fine. Can someone explain how I would best accomplish this?

    Any help would be apprciated.

    Why do you use a queue to pass data to a loop at the other?  The reason why it doesn't work once, it is the lower loop will wait until an event has occurred.

    I would eliminate the queue.  Wire the Total in a property for the total value (signalling) node.  That will trigger the occurrence for Total: change value event.

    Don't read property nodes in the upper loop when you have indicators and the son here to read from.

  • Is it OK to trigger 2 loops of event out of the same control?

    I have two circuits of event that will trigger when the user click on the Exit button. Is this ok to trigger the two loops off the coast of the same order? It works fine, but I don't know if there could be a problem. Please see below. Thank you!

    sfrosty wrote:

    Perhaps another point I have wired 50ms to the timer of the event MENU structure and want any delay in the structure of the MAIN Event. Not sure if it is a valid argument.

    Why?  You do something else in this loop?

    I recommend spending your menu commands in your main event loop.  You'll thank yourself later.

  • Update an indicator of in while loop with event driven programs

    I'm trying to update a chart shared by several events within a Structure of the event. I would like a change in value of a button (NOPE or OK buttons in the attached example images) causes the structure of the event causes a switch between the various outputs for the chart. In the example attached, clicking the OK button will send the graph random matrices, while clicking on the button NOPE will send constant tables to the curve.

    As the process within the structure of the event is underway, I use a while loop within each of the different events in the event Structure. So there is a structure of the event, and each event have while loops in them which should update the chart outside the structure of the event (see attached images).

    This does not update the graph, the graph remains static instead, why is this? How can I configure it to work as I described above?

    In my view, a question is: How can I use the same stop button in both inside while loops. In the example images, I have two that are different, one for each of the different events.

    Thank you!


  • Event Structure Weirdness

    Last night, SAP posted an interesting question on his blog (The Daily CLAD).

    In short, we create a dynamic event, enter it and generate two events with the data being 1 and 2.  Then we travel a structure of the event that is registered for the dynamic event.  Inside of the event is another structure of event which is also on the dynamic event inside a loop set FOR to run twice.  The data of the event was autoindexed and went straight to the final output.  Now logic would state that the output should be {1,2}.  But when I run it, I get {1,1}.  I thought it was really strange.  So of course, I got to play.

    I changed the buckle FOR to run 3 times.  Oh, it is here and waiting for another event.  If it is to see two events, as it should be.  It's just that for the second event data is not transmitted correctly.

    But let's play others.  I put another LOOP around the external event structure and did run twice.  He does not see the second event at all (that is to say, is there and waiting for another event on the second iteration).  Why not?  It is registered for it?  He saw the first event?  Why wouldn't it the second event in its queue?

    Now if I remove the inside OF the loop and let my loop FOR external, everything works perfectly as I expect.

    Now, it becomes even more strange.  I added a button and changing the value for the button of my external event structure (the two structures event with loops to go twice).  The structure of the external event is also ignorant of my button value change event.

    OR, what the #* $& @* is happening here?

    The problem is not with nested structures event, but with the shared record refnum. An event record refnum should belong only to a single event structure. As soon as share you, you get undefined behavior. It could work very well, he might behave in a totally random way.

    Example of David is wrong for the same reason. He may have worked when he ran, but it is not something that must be invoked. The structure of substantive event should have a separate record node.

  • event structure vs case structure

    I am developing LabVIEW: tool of control and vision. Front Panel has a lot of buttons, each button will execute a single or a group of the screws.

    I found that:

    1. event structure is good for digital change. i.e. the user change a corordinate and motors are moved.

    2. the structure cases is suitbale where such that use click "run MTF", a case structure is executed to calculate MTF.

    I tried to use the structured event to pick up button click but it isn't reliable workign, such as the user clicks too quickly and LabVIEW does not record events or LabVIEW records the event even twice

    However, I have a number of clicks functional structures. My block diagram will be uncontrollable.

    Any idea/tip/trick be greatly appreciate!

    -best

    If you understand how LabVIEW works and understand the principle of data flow, what I'm going to say the will of sense.

    The idea of a Structure of the event, it's that he's sitting there, don't take no time CPU until an event (usually a change in a Front Panel control) takes place.  Then he does everything you ask in its event arguments.  The trick is to do almost nothing in the structure of the event, but to say another loop, running in parallel, to do something.

    The key here idea is you have two loops, running in parallel, independently, at their own pace.  One, the event loop, waiting for an 'event '.  When it happens it it "sends a message" to another loop (or loops) that make treatment (which may take some time) as defined by the event loop.  The point is that it is very fast to send him the message (which is usually done via a queue), so the event loop is able to respond much more quickly that the user can push buttons on a façade.

    However, when the hands of loop event off the Message 'go do this task' another loop, the task may take longer.  If the tasks are put in a queue and then they get finished, the next task is running.  The key thing here is that the two loops, the loop «Ask» (events) and the loop ' Do ', run indepedently and at their own speed, nor dependent on the other.

    Bob Schor

  • How to raise events from within an event to an another event-structure

    Hello

    I have two events-structures (struct1 struct2) that are running on the same parallel of time in a loop.

    Currently there is a keydown event in struct1, so when I press a button, then the corresponding event runs in struct1.

    STRUCT2 is used to execute a custom-Petite runtime menu entries.

    What I want to do is to choose a menu entry (which runs a struct2 event) and the of inside this event I want to trigger an event in struct1 (means simulates keypress?).

    Is this possible?

    Thanks for the help

    Use the event to the button, not the keydown event.

    Then in the second structure of the event, use the Value property (signs) of the ok button to trigger the value Change event.

    Felix

  • Event structure vs business structure?

    I'm developing an application that can be fairly entered user based... a lot of command buttons Boolean to do different things.

    In the past, I was able to avoid the event structures "change value" and went instead with a while loop, stacked sequence and series of structures of the case. After, I decided that it was a terrible idea. This time, I intend to build an array from a Boolean, convert it to a number and feed it in to a unique business structure. This will give me the ability to add cases for different combinations of the Boolean being pressed.

    I guess the question is: what is the best way to do something like that?  Does have advantages over the other?

    Edit: I was not clear.  I would like to a comparison between the method of structure of event 'change of value', and just feeding into a table-> structure of the case.  I also fear that with the bool-> structure table affair I'll run problems where I find myself with too much control variable and the value of the resultant becomes ugly number very quickly. The application has several buttons... then, finally, save, load, several different configure configuration buttons etc.

    Thank you!

    Aalenox wrote:

    I guess I could do two separate loops running simultaneously.

    ^ ^ ^ THIS!

    Search for architecture producer consumer

Maybe you are looking for

  • How to remove the photo album.

    Hello world I am using 1.0.1 Photos and I would like to know how to delete an album.  Can I delete photos without any problems, but I would be you want to remove the albums that I is no longer necessary. Your help would be appreciated.  Thank you. PA

  • Equium M40X: Need XP drivers for card reader and Lan

    I reinstalled xp on my laptop and came on the Toshiba site for drivers, but I can't find a card reader and the LAN does not seem to work. Any ideas where I can find these drivers.

  • Wireless network problem

    When I start my Dell laptop that is running Windows XP, it will not connect to wireless (Intel PROSet).  When I try to connect to my network, I get the message "another application is controlling the wireless card." If I disable the wireless computer

  • Calculate age with date of birth only? OBIEE

    I would like to calculate age based on DOB.  I get a syntax error.  Not familiar with the proper syntax of PL/SQL for nesting of IF/THEN statements.  Any help would be fantastic:@{Current_Date} = current Date"Employee personal attributes. "" Date of

  • How can I change the name on the screen of Windows 8 start?

    Just set up the new computer with Windows 8. Spent a ridiculous amount of time to change the name of the profile at the top right of the home screen... Have tried many scenarios found via this forum, google search, etc... all to nothing does not. Spe