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

Tags: NI Software

Similar Questions

  • Use the same graphical display of data from the different cases of event Structure

    Hello

    I would like one graph to view the input data and modified by one of the two cases of different event structure.  So if the event 1 is selected by the user, the data would be entered by the code contained in 1 case and then introduced in a waveform to display chart.  If the event case 2 is selected, similar data would enter the 2 cases but then displayed by the same graphic waveform , as in case 1.  I don't know if there is a way to do this... it seems that each case of the event would need its own array of waveform, but it becomes quickly heavy regarding the graphical interface for the multiple cases of event.

    Advice would be greatly appreciated!

    Thank you

    Mike

    You are allowed to put the business structures in the case of timeout.

  • Cases of event structure do not work (probably façade is disabled

    Please find the attached VI, I tried the update feature and inlcude a new code. And it ends in a non-responsive event structure.

    Is this a bug (related to the definition of property of "Windows run in a transparent manner") or am I missing something...?

    You have your events to lock the front until full.  If you have a keydown event, the structure of the event 2nd he also captures and locks the front panel.  You might think that you have a timeout, but this loop does not receive the value of timeout until the first so that the loop ends.  Your second loop depends on the completion of the first loop.

    If you do not hit the combination just with a keydown event (or leave of mouse or mouse enter and other events that would lock the front) which causes also this first loop to stop.  You have locked your program.

    As Mike said, have 2 structures of event on a diagram when you do not understand how to work the event structures.

    I recommend reading warnings and recommendations when using events in LabVIEW.    This document has a little more items that I think should be mentioned.  But it's a good start.

  • Reading of RS232 event structure

    Hello

    I use the Write.vi to read RS232 attached as a starting point and do RS232 - help.vi him. successfully, the original written 1 posts, then wait a little, then reads 1 message. What I'm trying to do is to be able to read several messages. So I would write 1 message and I would read 1, 2 or 3 messages back or however many messages to ever come back, I guess that.

    Here is how I modified the original vi to get where I am now:

    I tried to add a structure of the event around half 'read' RS232 program. My structure of event triggers when the bytes to read the changes, this value can range from 0 to several bytes to be read, or muliple bytes to read 0. Up to half of the time I would trigger and not need, so I then added the accession of case which only works when the bytes to read the value is not 0, which means that it must be something waiting to be read whenever the program inserts this box. (I hope that's clear).

    At the moment, my program will not read and I don't know why. Through the program of first base, I can read and write properly. (I just hooked pins 2 and 3 on my cable so I read everything I write for testing purposes). So I know that the problem is spoil me the 2nd joint program

    Any help would be appreciated! Thank you.

    EDIT: I added 2 .jpgs incase you are on an different labview version.

    Better.

    But I don't think that permutation of the structure of the event for the structure of the case actually has really helped what.  In fact he madet worse.  You had the case of locking Panel event before the value until the end of the event.  But with the structure of the event within the structure of the case, there is a chance that the structure of the event will never run and therefore the façade will be locked up forever.

    1. you want to only 1 VISA close.

    2. event structure has been set.  I also added an event for writing switch is restored.  So now, it'll write if you change the channel or when you turn the switch to True.  (Note, you will not be able to always send the same string as in the original example because you must press the power button or change the channel.

    3. I used the structure of the event to stop the loop of both Scripture by trigger on the event that the button is pressed.

    4. I don't know what you mean by a «black» read

  • Which situations give an event structure do not capture a Boolean value changes?

    LabVIEW 9 x 86

    Windows 7 x 64

    I have an event structure that works very well.  It has 5 cases, each triggered by a change in value of various indicators.

    I added another case of event, I'm trying to raise the case of the event with the express control "Out of time", I made a deal to raise when the Boolean value "out of time".  The structure of the event does not run when the value changes.

    In addition, once figured out how to make this indicator to trigger structure of the event, I would like to only trigger when the value goes from 0 to 1 and not from 1 to 0

    Search the forums for "event to change value" and "value traffic".

    The value (I guess you have on the structure of your event, bar header you seems to miss information.) the change is triggered only when the user enters new data in a control, or you write a new value programmatically by using the Value property node (signaling).  Completed just by a program written for a local variable, or do not ' value' property node.

    To trigger that in a sense, you can put the code in the event of a case within a case structure so that it runs only when it it True (or False, if that's what it takes.)

  • 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

  • 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.

  • 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

  • How to merge the event structures?

    I have a program of VI script that reads a text file of records and displays a structure of the event.  It works very well because it creates all the controls and indicators I need associated with the defined registry and code backend (i.e. the structure of the event).

    After I generated all this code, I copy and paste in the main VI I develop.  Everything works very well.  The only problem is that there are 100 text files from separate registry.  This means that I end up with 100 separate event structures.  Although it works, it takes a lot of space and I prefer to combine them.  However, each event structure has anywhere from 15 to 75 entries, so to do this manually is not an option.

    Is it possible to selectively merge the event automatically structures?

    I guess I could write a labview scripting routine that could get a reference to the structure of the event in VI, then merge... but part of the problem there is that there are a handful of structures of event I want to separate them just because they are not associated with the set of registers, that I mentioned.


  • Event structure/state machine

    Here's the scenario.

    I use the buttons controlled by the user in an event structure to control a state machine. Currently, I have a different State for each button. However, 4 or 5 of these buttons could ideally correspond to the State, which is what I would like to get... Each of these 4 or 5 buttons causes flow data and the results are stored in a table, but listened data are different for each button! Therefore, if each of those 4 or 5 buttons caused the same condition occur how I could decipher what button was pushed? Ideally, I would have 4 or 5 different paintings once all the buttons are out of the same State.

    Is there anyway that I can achieve this?

    Hi the shots.

    you have access to the refnum of the element inside the event. With the Ref, you can simply get the name or any other property of the control to distinguish them.

    Mike

  • Structure of the event in the event structure

    Is it possible that I can have a structure of the event, which is in another structure of the event? When I run the code, I can't use other buttons. (See chart for details)

    Do not put the event structures in the structures of the event! There is never any reason to do so.

    Redefine architecture your code in a correct state machine.

    (By default, events lock the façade until the event ends and if you raise the event internal or external, first of all, the other event can never fire because the current event can never accomplish or is inaccessible by data stream.)

  • mouse event structure entrance decoration

    I want one of my events in my event structure to detect my mouse entering a specific decoration that surrounds a control. I used the property pane to find what decoration is # but now I don't know how to call this specific décor as one of my events.

    The goal is that I want the user to have pushed a button to make a data folder before hitting to start generating data. I need the user to get an error message that they did not create the folder if they get even close to the Start button. I don't want to get the error after what they already hit early, because my Start button is linked to the data to a network variable that will get the ready message even if my host program has generated an error.

    Decorations of the façade are not the type of objects that can be associated with events.

    I think you have several options.

    1. follow the mouse move event and to compare the coordinates of the mouse with a few constants that you set that based on the location of the decoration.  This seems to be a large number of polling stations.

    2. not to associate your button start a dependent shared variable in the network.  When you press the Start button, make your comparison, if that's OK, and if not, the error.  If it is allowed, activate another hidden Boot button that is associated with your shared variable.

    3. use the mouse down? event on the Start button.  If you find that it is not a valid time press the button, ignore the event.

    4. use the event mouse input on on the button itself.

    5. use the event mouse entry on another button, which is located behind the actual button.  It could be transparent, or disabled, or disabled and greyed.

    6. If the button get press, the program automatically creates the folder for them instead to raise a dialog box and forcing them to manually.

    I think #6 or #2 would be the best option.  As a user, I would find it quite annoying that whenever I swept the mouse over an area of the screen especially involuntarily to have a pop up dialog box.

  • Output of the application using the event structures

    Hello

    In my project I used event structure that works well.

    Now I want to exit (close) demand when I press the EXIT button on the front.

    Here, I joined my project as an indication.

    Concerning

    Hari

    Hi thinnker,

    You must change the configuration of node Sub VI for this... This, then it will open whenever you call...

  • The quit event structure works when I switch the cdaq to crio

    I changed my structure of producer of written consumer 2009 for use crio in 2010 and my event structure enough work. The event source is the same.

    Panel controls raise no events on targets in real time as the cRIO, as these systems have not really accessible facades by the user.  When they do not display a façade, it runs on the separate development of the cRIO system; LabVIEW just give a homogeneous appearance.

  • 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.

Maybe you are looking for