Stop correctly with While loop

Hello

I can't stop the information that moves in stages with a while loop I created (see below). I joined the program (LabView 8.5) for reference, just in case.

Currently, whenever I press the stop button designated for the control of the scene, the stages will not stop until the last part of the scene movement pattern is complented (in this case part 7 of the stacked sequence). Now, I have tried various things, but it was the best I could do to make the stage stop at all. (all other attempts resulted in a clumsy scene movement afetr the boss or not at all stop). Any ideas on what I can do? I'm positive that comes to a while loop on the stacking sequence was probably not a good idea. I also stacked sequences are usually wrong (or it seems) but I it is rather tedious otherwise.

Thanks for the help, Amend sorry if this question seems pretty basic, I haven't used LabVIEW much until last week.

It's one of the reasons why the stacked sequences should be avoided at all costs!   They can ALWAYS be replaced by a state machine with several advantages.  No. 1 among the benefits to replace a sequence of stacked with a state machine is the ability to STOP a stacked sequence between state transitions should complete each picture before stopping.

Tags: NI Software

Similar Questions

  • Stopping at two while loops, running with queuing

    Hi all

    I'm using labview 8.2.

    I have two while loops in my code (called the main loop and the other average loop - seen on the screenshot file).  I just want to stop both the while loop at the same time (it's ok it the average loop takes a bit longer).  I use global variables to stop (as I have tried the local one, but I don't think that LabView sees in the middle of the subroutine).

    Please give me some suggestions on this.

    Is attached a screenshot and my labview code

    Using a ' functional global' is almost identical with a "global" variable Indeed, before the existence of "global variables", a functional overall, it is how people have this feature.

    The usual way to stop a loop containing a "wait for queue ' is to destroy the queue and use the error on the terminal of the 'expectation of queue' directly in the terminal of the judgment. In this way, you don't have to queue up some kind of end the command to stop it.

    Add a queue to destroy after the stops 'main while loop. Delete the global variable and the error from the stop "waiting in the queue" in the loop "average" it is wire terminal.

    General advice, always try to avoid using local and global variables.

  • Need help with while loop and shift registers

    I have a broad set of data and required to read data at maybe 200 samples at a time to process these samples through my VI and have add and concatenate a file separate lvm.  The part where I am confused is the shift registers. How can I limit the number of samples read in an iteration? How do the while loop to stop when all data are read in?

    I have attached my diagram, there may be something wrong with my technique?

    This will give you an idea.  There are a lot of other (probably more effective) methods.  It is a basic solution, quick and dirty to help you grasp the overall concept.

  • 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

  • Updated entries on day of a Subvi with while loop

    Hi there guys! It's my first serious experience with LabVIEW, so the question may seem trivial to you, but it's not obvious to me how to solve this problem. So I do an installation that integrates a number of flow regulators, a temperature regulator, DAQ, some taps and a mass spectrometer basic tasks. All these must be automated using LabVIEW. I started by doing a VI for each separate task is going very well. Now I need to combine the latter in an experience of master VI, and of course I run into trouble.

    The problem is that I want of course to control this experiences with some selected buttons/dials/what is on the face before of the main VI. However, each of these VI runs a while loop in which fact acquisition of continuous/data communication / whatever. Of course, I want to change settings online. If I just naively tie them at the entrance to the Subvi these will be read only when the Subvi is started, not during each iteration of the while loop.

    I added a very basic example of the problem, so we are all on the same page. The main VI has a button, the State which should update something in the Subvi. However once the Subvi is started it takes control of the execution and the hand-VI seems to be ignored (appears to hang) even if the program has a lot of spare time to read the buttons and put on day of admission. What is the official solution for this kind of problem? My experience in programming that I prefer to keep the intact Subvi, so I can use it as a reusable standard library. Of course a similar question can requested the sub - VI output which will be updated only once the execution is completed (which is never during normal operation).

    PS. I'm using LABView 8.6 on XP

    The best way to set up a BT program must initialize first your settings, and then launch a while loop where you communicate/aquire data or whatever, then after the while loop is finished close and clean up your references.

    Inside the while loop, you can place your code in many of the screws and it is possible to run those in parallel, but I defenetly does not recommend the use of loops in slot face, especially without having to open the front panel or a stop test.

    If your code is completely executed up to your Sub - VI, the main.vi will wait for the sub - Vi ends before continuing the code.

  • Stop the multiple while loops in the acquisition of Vision

    Hi, I want to close multiple while loops with a STOP. I use the software for the Acquisition of the Vision for the recording of multiple cameras and I would like to finish this record from all cameras simultaneously. I don't know how to do this since I am knew to LABView. I would add my VI here and maybe someone can help me.  Thank you!

    A local variable should be sufficient for your application. Read the following article:

    Parallel stop, while loops in LabVIEW with a stop switch

  • Subvi with while loop + event structure works is not in multi tab VI

    Hi all

    I'm developing an interface for the control of a prober using Labview 2012, and I'm stuck with a question.

    First I provide you with a simplified version of my VI control interface and the sub - VI used to generate and manage the mappings of wafer.

    The VI is composed of several tabs: Prober initialization, manipulation of Wafer, Wafer map, status, error.

    The sub - VI can:

    1 / initialize the grid to display the map (Subvi Init grid not provided here)

    2 / coordinates XY for import a txt file (Subvi Wafer map Import)

    3 / view contact information and the index of the sector under the cursor

    4 / and what position die is double clicked and the Boolean 'Edit Wafer map' is true, then the user can change the State (color) of the matrix between die on platelets and selected Die

    My question:

    If I use the sub - VI by itself, it works fine. However, when I use it as a Subvi in the 'Wafer map' tab, the plan does not rise and I can use any features incorporated into the Subvi.

    I suspect that the while loop + structure of the event of sub - VI the bottleneck here.

    However I do not know which way to go, that's why I'd be happy to have some advice and help here.

    Thank you.

    Florian

    The question arises because your hand loop 'for' cycles of 33 times.  In the loop of 32, appears your Subvi and execution is passed to your Subvi.  During this time your main VI expected Subvi in the end, she never does.  You could spend your Subvi out of the main loop of the program and run in a separate process, in order to pass data using queues, but you have to find a way to close the Subvi (i.e. a queue).  By moving the Subvi on the main process, it is independent and you can do what you want to do with the events and others.

  • Problems with opening the file with while loop

    Hello everyone,

    It is probably a quick question, but I know how to open data files in Labview. The attached code works if you enter a file from the folder on the front panel button. However, if the path is empty and you press the run (arrow) button, a dialog box appears and asks you the file.

    I select the file, but the dialog box keeps coming back. I think it has something to do with my while loop. Can someone tell me where I'm wrong?

    Thank you!

    TheLT


  • problem with while loop graph y Gráfica

    Hola

    Estoy realizando UN programa or UN contador cada vez as recibe UN 1, el contador to con resetea a button Reset o autoamticamente cada cierto tiempo (el don't reset por tiempo're para cuando hace mucho tiempo no to recibe una Señal 1 is resetea el contador)

    I made UN programa hace eso, pero cuando entered el resets del tiempo contador is ahi, nunca sale is asi Señal cambie has 1.

    y mi otra duda are not con the graphic grafica, results quisiera show los datos del contador with the actual date, initiates use las propiedades del chart pero no works... no self if alguien me can help put con problemas

    Gracias

    Herica M

    PD: estoy utilizando LBV9.0

    How dice crows, need leer los slideshows you mismo you of the account of that are what you are doing wrong.

    Aqui el annex you VI con unos cambios para as haga lo that I think quieres hacer, pero comentarios puse if tienes dudas me questions.

    Para lo grafica en las propiedades del eje X, seleccionas as el tiempo absoluto sea dato, y luego con UN nodo propiedad Escalin grafica puedes hacer al eje X shift para as sea the actual date.

    Decree No. presidential Te perfect use el foro en Español, TR o lo going poner Aquí, hacerlo in Frances.

    http://forums.NI.com/NI/Board?Board.ID=6170

  • While loop stops unexpectedly

    Hello world

    I have a problem with while loops.

    Im trying to write a program that allows me to control the temperature of a hot plate, using as a starting point one of the examples in LabVIEW (basic series writing and reading). So basically the program sends an order asking the real temperature of the heating plate and it then reads a response with the State, then the user writes a temperature (the sub - VI creates the command that is sent to the cooking plate), then he reads a confirmation response. the while loop is to monitor the temperature and change it if necessary

    Sometimes it works for about 30 seconds and sometimes for a few minutes, and then everything stops playback, I don't get the error messages, it stops just a response.

    The hot plate is a pro H550 MS7 and im using a USB to RS232 converter

    PD, I'm pretty new using labVIEW, sorry for my bad English.

    Greetings and thanks for the help

    Bob_Schor wrote:

    Found the manual.  Here is a summary (edition - in fact, it is essentially all of the manual, just condensed and without 'images'):

    • The statement format: prefix, Instruction, data frame, Checksum
    • Command: Prefix is 0xFE
    • Answer: The prefix is 0xFD
    • Add at least 50 msec between pairs of bytes
    • Data frame, send high and low bytes
    • Checksum = sum of the instructions, the frame data, but not prefix
    • Commands and responses seem to be mainly sequences of 6 bytes

    OK, this helps a lot.

    The first issue with the OP code: turn off the stop character.  The protocol uses binary communication protocols.  The stop character is only useful for communications ASCII protocols.  Nor if he was being a 0x0A in data, VISA Read stop reading right there because it's the stop character and it is enabled by default.

    Second, always do not have need of the bytes to the Port.  You know what you send and you know what should be the answer.  Therefore, suffice to say the VISA of reading to read the required number of bytes.  If your delay is long enough, you do also not waiting for him by saying the VISA must read the number of bytes to read.

  • Error with parallel while loops

    Hello

    I need to connect 6 different instruments gpib. I am using parallel loops, but the problem is when I try to open 2 or 3 Subvi simultaneously (the intstrument drivers), I just open one because of everything in a loop to run the Subvi. The program should be able to open all the Sub - VI independently.

    Can give you some ideas?

    Thank you

    A. Castillo

    Look at the detailed help for functions to notify.  Then follow the links to the examples included with LV

    Another problem that you have, whether you use your curls greedy or reporting or another technique, is to know how to stop your hand while loop.  All the subVIs must be called before the loop stops.  This is the fundamental paradigm of LV

    You will probably need to rethink your primary architecture to something that will actually do what you want.  Plan and design before your departure from the coding.  Note requirements for the program and determine which parts are dependent on othrer parts, then select a program architecture that can meet the requirements.

    Lynn

  • Can someone tell me what's wrong with my loop of consumer queue or producer?

    A Labview engineer helped me with the overall structure of my program, made necessary by the rapid sampling rate data and post-processing requirements. He recommended the producer/consumer, loop and using one of the example (Cont CQI graph - int clk voltage) files to actual data acquisition. So I put the loop on foot and spend my two channels of data acq past in the loop of the producer. However, nothing is get picked up in the loop of consumer and none of my data gets displayed there.

    Someone wants to take a look and let me know what I am doing wrong?

    It seems that the only time where you have to write the data in the queue (in the loop of the producer), when you stop the DAQ while loop or the acquisition of data generates an error.

    You may need to place the element from the queue node in the data acquisition while loop.

  • How to create a control of time for the while loop?

    Hi all

    I want to control my time running of the loop. In other words, I want to stop everything in the execution of the loop after a time (in ms) that is defined by the user. For example user defines Control Panel for 5 seconds before a while loop runs and stops after 5 seconds.

    I don't know is it possible with the while loop. I managed with the timed loop, but this must be wrong with my application. Y at - it of the other loops for timed control if it is not possible with while loop? There is also a simple loop with .vi random number (0-1) as an attachment.

    Best regards

    Jick

    Hi again,

    I managed to solve my problem right after I posted my first message. I did it with the passage of time and the register shift (for the elapsed time of reset).

    Thanks for your replies anyway!

    Best R

    Jick

  • Stop in a timed loop

    Hello

    I have a while loop with a stop in it function. There is also a function to wait for 60 seconds to slow the while loop.

    The problem is that when I press stop in the while loop, it must wait to stop due to the function of synchronization. How can I get what I press stop and have the while loop immediately end.

    The .vi is attached showing everything, function and timer.

    Try this for you are going to get

    Ken

  • While loop inside a timed loop

    Hello world!
    I use:
    -LV 7.1 + real-time;
    -compactFieldpoint;

    When I put some time, I noticed a strange behavior, loop inside a timed loop.  Let's fix loop timed with these settings:

    -Clock 1 kHz
    -1 ms period (Yes, I know it's short...)
    -offset 0 ms
    -Stage 0
    -Take the period of absence (ON) and maintain initial Phase (ON);
    -Timeout:-1.

    So, inside the loo, I put a traditional while loop, waiting (for example) an event will occur, and if this event doesn't happen, my cFP-2020 crashes! I mean, it becomes inaccessible for the debugger, and also, if I run a ping at his address, after a few cycles it becomes inaccessible as ping!

    Obviously, that statement of code lock the fieldPoint, because if I remove the inside while loop all work.

    I know that with 1ms duration, timed loop always the finishing of the delay, but I put the scrapping period missed and timeout-1.
      
    It seems to me that sometimes timed loop add overload heavi programs, I all so that the loop according to the tasks, even if my application has be in real-time!

    Tips welcome! Good day!

    Graziano

    Thank you very much for your answer!
    I'll test the entire application and then look for the best practice... but I still think I'll replace it timed with while loops loops...

    Good day!

    Graziano

Maybe you are looking for

  • Photo & Avatar

    The company "Photo & Avatar" confuses me. I have been unable to replace the profile of the shadow in the field above with an image - see below. The leaves do not appear among the avatars and I can't go from here. The image isn't quite what I want - u

  • iCloud do not synchronize documents between computers

    I have a MacBook Pro and Macbook Air.  I bought extra storage for ICloud.  My MacBookPro documents do not appear in the Documents of MacBook Air.  Is there a way to fix this please. concerning Max

  • SMU-6556 - how to control the rise in digital lines (hsdio) time

    Hello Is it possible to control the rise in digital lines SMU-6556 time? Even in a low frequency 10 kHz signal rise time is 2ns. TKS,

  • E4200 V1 1.05 firmware https vs http...

    I decided to try to activate http and https. With https if. Using the latest version of Firefox, btw. Why is it so extremely slow in the firmware with gui? Once I disable https and return to the default setting of the http protocol. Gui firmware move

  • Computer constantly disconnects / reconnect to the wireless network

    original title: vista renamed wirelessnetwork House and now computer laptop will constantly disconnect and then reconnect a few more seconds later Every since rename home network wireless computer laptop under vista constantly disconnects and reconne