Structure of the event inside while loop

I'm still fairly new to Labview and this may seem a simple question.  I'm doing a Subvi to display, edit, and create configuration files.  I use a ListBox to list all sections of a config file and structure of the event to update the values in each section, when they are clicked.  The problem is that the structure of the event seems to be a break the while loop so that the buttons do not work until the event has executed.  What I would like is the while loop to run continuously and the event to run only when I click in the listbox control.  I hope this makes sense.  There is a peak in the diagram below. Thank you

There are a number of issues with your code that could cause problems:

  1. You must use the FP. Open method to open the front panel of a VI and of the public Service. Close method to close. I don't remember exactly the problem, but starting with the 7 worm nor indicated that these methods were the preferred way to perform these tasks.
  2. Based on what seems to be the code, the event for the control of Presets of wood should be a change the value - not a mouse down event. After changing the type of event, use the event data NewVal to drive the indexer table index entry.
  3. The buttons Ok and cancel them should be handled in their own events to change the value. The value change event Cancel would exit the loop, while passing the output error (which indicates that cancel was pressed) and default values for the other 4 outputs. The change of the value Ok event would leave the loop by passing the values that the operator had concluded the 4 controls on the front panel.
  4. An event of timeout with a very short time (1 msec) would stop loop if an error has occurred, or the output of the gate AND is set to true.
  5. The wait function is not necessary, as is the case outside the loop structure.

Mike...

Tags: NI Software

Similar Questions

  • get the structure of the event inside the while loop to wait for event occurs before the execution

    Hello

    I have a small problem, when I raise an event using a value change button, which works very well.  The problem is that the VI does not wait for me raise an event and instead runs the same event again, even if I have not pressed the button to start again.  The mechanical action of the button switch is released is.

    I was wondering how you get the structure of the event to wait for a user event, after that he executed the first time.

    James.Morris wrote:

    There is no reason that the event should be raised twice as much that the only way that it fires in your code is by the user by clicking on 'Hall measure only'.

    Oh yes, there is, and I deserve a kudo for this one.  Mechanical action on the button is set on the switch until published, so click to generate an event, on the bottom and on the square, attached is an example.

    My boy has my students hate this question, and to be honest, I hated it.  When never would you do that intentionally?  Honestly?  Anyway to change the button back to normal (as default latch when released) and move the terminal button in the structure of the event where it is managed and it will work as usual.

  • Structure of the event in timed loop

    Quick question on the structures of timed loops\event

    What is a good or a bad idea to use structures of event call loops - as opposed to while loops. ?  I guess I like the idea of call loops - because you can prioritize them - so if there are some important things you need priority of 100% in the background - but for the user interface, you can configure it to run slower\or run to a different priority level.

    I just wanted to check it is not a reason why I shouldn't do that - since all the examples don't do that.

    JP

    I don't think it's a good idea. Your timed loop can stop waiting for an event. There is no advantage of placing the structure of the event in a timed loop. It is possible to assign priorities to other objects outside of the call loops. For example, you can the priorities given to subVIs. I'm reasonably sure that the structure of the event can work at other priorities if you do not the activities of the user interface. Maybe someone of NOR can confirm this.

    But the goal of a timed loop is to have a deterministic periodic job. The structure of the event must be used for asynchronous events. The two disagree with them if they are in the same spot.

  • How to manage the structure of the event with two loops

    I have a question about the structure of the user event with 2 buttons?

    key 1: START LOGGING DATA

    key 2: STOP LOGGING DATA

    How do I control my

    structure of the event so that it will work? because now that the loop is save data... I can't stop the loop, when I clicked on buttons.

    super_saiyans wrote:

    the problem with moving it is that I don't have control of the DATA RECORD STARTING?

    Of course, you do.  When you get your press conference button, you say your state machine to move to the State of logging.  You must also make sure that you return to visit the State to wait for the event to check out the events of the stop button.

  • Several loops in the structure of the event

    Hello

    I am writing a program that uses data from an aerial camera to control a robot differentially articulated around a track. I'm new to LabVIEW and I have a question to get the structure of the event and while loops to work as I want. My code currently has three while loops, running in parallel, to treat the image in the necessary data, one to use the data to locate the robot and the last to issue commands to the robot. I'm trying to add in a Subvi calibration that will recalibrate the camera early upward, and whenever the user clicks on the calibration button. Basically, I want to stop/pause the three while the curls then run the Subvi, then start the loops up using up-to-date data of the Subvi.

    I thought that a structure of the event would be the best way to do this, but I can't seem to make it work properly. I have provided a fake version of the main VI. If someone could point me in the right direction on how to do it and also if anyone knows a good place for the tutorials for this sort of thing that would be great.

    Thanks in advance

    ~ Nick

    Thanks BowenM,

    I'll look in producer/consumer architecture and see if I can make it work.

    ~ Nick

  • LabVIEW 2012 while the structure of the event does not stop

    I am LabVIEW 2012.

    An example of a while loop with the structure of the event inside can not be stopped with the stop key, Boolean.  Something wrong?

    Please see the attached VI.

    Thank you.

    Yes, something is wrong. You must add one for the event in order to detect a change in value on the stop button.

    The thing is now your structure for the event rest waiting for one of the event which she handles and ight now, it handles the "close panel" event, the 'timeout' event is too manipulated, but since you do not have anything related to the terminal of timeout (top left of the structure of the event) the timeout is - 1. So, when you run the VI the while loop is stuck in the first iteration and is waiting for a sign nearby, the stop button will only take into account after that same structure intercepts an event; I think it's because LabVIEW will execute the code related to the Terminal stop of the while until after the rest of the code that he has completed execution of the loop.

    Hope this helps

  • by using a structure of the event to restore a Boolean control with change in value for the menu ring

    I'm trying to get two Boolean buttons to reset when the value of a ring menu.  For this I use a structure of event defined to execute with a ring value change.  However I have another code that should be run while the structure of the event expected to change value.  I place my structure of the event inside the while loop buttons reset as expected but my other code is not run (except when the value of change). If I place it outside the loop the rest of functions code as expected, but the buttons do not reset.  Any help you offer is much appreciated.

    Hello

    ADD TIME OUT EVEN AND GIVE DELAY OF 100 MS.

    Adds the case-application-timeout event

  • Structure of the event without user interface

    I tried a quick and effective solution for a structure of event that is not a case of timeout and is part of a vi that has no user interface, but I have sent configuration data to the structure of the event.

    Let me be more clear: I have a camera that generates several events taken by a loop with the structure of the event inside.

    The provider of the camera give me this example of Labview code with all the events I'm interested and how they are implemented. I should mention that when you write a command of camera that a response to an event, but when you connect first to the camera there are more than 100 events generated by the latter, or when you download camera there are also several events. When there is no communication to the camera, the structure of the example event is inactive. The example includes a user interface to change settings and the program responds very well.

    I have to integrate this camera in great demand in which camera photo will be configured in a pragmatic way with number of the type of user interface in the example given by the manufacturer of the device.  First, I tried to design a loop with timeout cases in which a queue can send the data to the device setting configuration. Everything is good until the download when code needs to hold events in a certain way; in my case, an event is taken another goes to the time-out period and so on. After two sets of 100 images download, during the third round Labview gets blocked (Labview not responding) and I have to kill Labview. I got designer of the camera that if camera events are not taken they are kept on a pile and when the battery is full causes the Labview locked.

    Maybe I give too many details, but the question is: how to communicate with a struct event that is not a case of timeout and does not part of a user interface vi (it doesn't have a sign in my application)?

    Oops... Sorry about that.  I've attached an example what I'm talking about here.

    -Austin

  • How to stop the While loop in the Structure of the event with the same button?

    Hello

    I have a problem. I want to use a single control to activate an event in a structure of the event and the same control to end a while loop in this case.

    It is possible to use 2 controls to do this, but I need to be alone.

    Thank you

    You should NEVER place while loops inside the case of the event, and it is never necessary to do. Think about it: all you have to do is spin the code. You can easily use the outside while loop for everything. Simply place the code of the loop internal (without the inner loop) inside the case of delay and manipulate the time-out period between a pending finished and the infinite (-1), depending on the State of the Boolean value.

    A very simple example (LV 8.0)

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

  • Synchronization of 2 loops while one with a structure of the event.

    Hi fellow users of LabVIEW

    I try to incorporate a structure of the event in my current exisiting VI to Save certain values of control as shown in this post

    http://forums.NI.com/T5/LabVIEW/using-the-quot-make-current-values-default-quot-as-a-control-on/TD-p...

    It's the VI that I use as model with my exisiting VI.

    http://forums.NI.com/NI/attachments/NI/170/547715/1/defaults%20Demo.LLB

    In case the 'stop, change the value' I use in the main VI and a 'real' constant instead of Boolean control of wire structure. While the loops are not connected. The table that I use in my exisiting VI (another while loop) is indexed and unbundled to be used here.

    The work combined well screw and it gives me the results, my question is, in the long run it will give me issues. Do I still need to synchronize?

    Thanks for all the help.

    There's no problem because loop additional lower with the structure of the event.

    Personally, I worry about the top loop. Why so complicated? Why so much duplicate code? Why all these hidden indicators serve as local variables?

    Why don't simply place you the table in the entire cluster in a shift register and the index and ungroup by name wharever value, that you need to access. No hidden local variables or indicators.

  • How to stop a while loop structure in the event of a main vi

    Hello;

    Sorry for my English

    I have to stop to a Subvi my main VI, the Subvi contains a while loop and an event structure, so I need to stop this loop while I tried directly from my main vi, global variable, but it did not work

    any help please or example!

    How about something like this (solution see attachment) using a user event.

    Explore the User Interface--> range of events and dialogue. To display the dynamic event of the terminals in the structure of the event just right click and select 'display the dynamic event posts '.

  • Event case + while loop (the controls inside the loop will not be updated)

    Ok. I don't know what I'm doing wrong.

    But when I press Start, I can't move the slider control.

    All the obvious errors here?

    Bob123456 wrote:

    But when I press Start, I can't move the slider control.

    Your event is set to lock the front until the end of the event. This means that you are in a bind, because the event cannot be completed until the button is pressed, which can happen because the FP is locked.

    Quick "bandaid fix" would be to uncheck this option in the configuration of the event. Not recommended!

    You should never place interactive code within the structures of the event. Restructure your code accordingly. See state machines, for example.

  • stop the loop inside while loop

    Hi all

    Is there a way to stop a loop within a while loop? Error-free program will stop running when you press the stop button, but I want to while loop continues to run in and only for the loop stops when the condition is met.

    Thank you!

    Hi TayAus 1.

    If you want to run the execution once? Maybe something like below? The code inside the structure of events can only run when the event source is triggered. For example, the code in the digital works only when it detects a change in the numerical value (just an example).

    When the button is selected, it should raise the event to stop as shown below:

    If you want to create the event source, create the structure of the event > right-click on the frame and select edit events dealing with this... > This should open Edit events.

    The example below is that I put the event source for the change in the value of x and x 2.

    So when x or x 2 value is changed, executes the code in the sous-schema event shown below.

    Warm greetings,

    Lennard.C

Maybe you are looking for

  • Passage of a US power to a source of the UK on Satellite M35X-S149

    I have returned from living in the United States and have a Satellite M35X-S149 laptop. As it was purchased in the United States, it has a power supply that runs a US plug two pins and the power cable no that a two way drive joining in the battery. I

  • How to extract deleted the file from itunes backup iPhone photos

    I bought an iPhone 16G 6 s two months ago and the storage is in short lately. So I deleted a large number of items than the iPhone, especially for photos and videos. But now, I realized there were 3 important photos deleted by mistake. Luckliy, I bac

  • WMP600N and Windows7

    Hi all... I can't connect my wmp600n PCI card to the WAG160n router I have windows7 final version... it connect but do not work having problems... .but at the site already have Windows 7 Driver here http://www.linksysbycisco.com/US/en/support/WMP600N

  • How to fill out the customer type when you submit a form?

    How to fill out the customer type when you submit a form?

  • Event Dispatching Thread

    HelloI'm a beginning student of java and I have trouble understanding how to manage the event Dispatching Thread. I have read many things on the internet; but I have not found anything that it be written in Italian (my language), so I'm afraid I did