For loop does not or will not stop according to the toggle switch

This is the VI I work with joint. The VI is a bit long, but the two loops on the left side are loops that have problems. When the program works and I hit the switch 'START of CYCLE' rocking the loop simply does not work. However, when I toggle switch on before the start of the program, the loop will run the way it is supposed to, but never shuts off when the switch is turned OFF.  Any help is appreciated. Thank you.

billko wrote:

James.Morris wrote:

Good, so as I was saying before the left of right data flow, so things on the right don't peut/don't do nothing until things on the left ends.

I've seen you say this twice now, and it is not true.  Data flow from the output of a node to the input of another.  This means "from left to right" because it was designed that way.  If you had two subVIs, 'A' and 'B', no cable together and 'B' to the right of 'A', it does NOT follow that 'A' will run before 'B '.  If, for some silly reason, you had 'B' exits on the left and the 'A' entries on the right, you could connect the outputs 'B' to 'A' and the data would be sent to the right left.

But I'm fairly certain that I have misunderstood the information you were trying to convey?  (It wouldn't be the first time, believe me!)

Ah, point taken, I'll have to adjust the way in which I explain the data flow, stream of best practices not only. It is difficult to describe the flow of data to a beginner without using the directions. I was just trying to convey that the Boolean value that it has a cable upwards is providing data for both the first structure of matter and the main While, loop which means they expect both for the info of the Boolean value. If he makes the request to wait for the user to click on the Boolean value, then the loop will wait too long.

I think that the data stream is one of the biggest problems new users seem to fight with and this thread is an example of this. EMART can make this code work, even if it's a mess, but I think it is obtained when the additions of code got on immediately to the point where he needs a little more experience help to understand how do to encorporate more functionality without messing up what already exists.

Tags: NI Software

Similar Questions

  • I upgraded to Keynote 6.0 and now have a new logo to Keynote 6.0 in my Dock and a Keynote 5.0 Logo in the Dock. Tried to drag the logo 5.0 on the dock does not work according to the instructions. Comments?

    I upgraded to Keynote 6.0 and now have a new logo to Keynote 6.0 in my Dock and a Keynote 5.0 Logo in the Dock. Tried to drag the logo 5.0 on the dock does not work according to the instructions. Comments?

    If you have any documents open in Keynote 5 then you will not be able to drag it to your Dock. IF a right-(control) - click the Keynote icon 5 shows Quit in the drop - down and then select Exit. Now you should be able to slide your dock.

    It is often necessary to drag it from the dock, drag the icon quite some distance from the dock (to what the REMOVAL appears on the icon).

    You can also right-(control) - click the icon select Options, and then, in select Options remove the dock.

  • While the loop does not stop when the two values are equal using equal to comparitor

    Hello world

    I have a really, really strange bug. I have a LabVIEW VI that change a chain on a power supply. I have a start and a stop voltage and use a while loop to increment the device. For example if I want to scan from 1, 2V to 2.2 V in 0.2 V incremements, the program will end when "The current tension" = "stop the tension." And it works very well!

    However, when I start - 3 V and want to stop to say-0.8 (new in 0.2 V incremements) the program does not stop when "The current tension" = "stop the tension." I checked with the probe close to what should be the end of the race and - 0.8 V goes both of the entries ' equal to ' comaprison operator, but that his can't trigger a real result.

    It's very strange for me. Espeically as if I'm going - 0.8 V to-2 V but decrement of-0.2 V, the program stops correctly!

    I am very confused!

    See you soon!

    Search on: comparison of floating-point numbers

    The second thread is particularly relevant. This discussion was 2009, but you can find that the same "bug" being reported to enter the end of the 1980s.

    Mike...

  • FOR loop does not update the local Variable

    I am newer to labview, and I can't wrap the head around why not a habit of local variable to update in the code if it updates on the dashboard. Anything im missing?

    Assume that you are talking about the local variable of the 'State of the cell. The terminal updates every 500ms in the small top loop, the local variable indicates simply that the indicator and thus updates also.

    The problem is "dataflow" and you need to familiarize yourself with the concept!

    Once the while loop starts, the local variable is reading and inside the loop begins. Most likely, the local variable is read before it is updated in the small loop, so most likely returns the value of a fade on the first iteration of the while loop. Now the small loop continues to go twice per second for about five seconds. Only after the loop FOR (and everything else inside the while loop) completed, the while loop will go to the next iteration, date on which the local variable is read once more, this time with the last value of the last for loop iteration of the previous iteration of the while loop.

    In summary, the local variable updates very well, it's just that the code does not read the new value around most of the time.

    Your VI is full also potential competition conditions caused by the over-use of the local variable. You need to respect the proper execution order by eliminating local variables.

    So what is the solution? Hard to say without knowing what the VI is supposed to do. Most likely, you will need to remove the inside OF the loop and use it outside while loop for everything.

  • parallel for loops does not

    Hello.

    I'm learning the multi - thread programming. To start, I use "parallel for loops" and I was surprised that it does not work. One - thread loop work a few times faster (depending on settings) that multi - thread. I don't know why, and it is my request to correct my Vi to work properly.

    Lenovo, G580, Windows 7, 64-bit computer

    Intel Core i7 3632QM
    Ivy Bridge
    Specification Intel (r) Core i7-3632QM CPU @ 2.20 GHz
    Package (platform ID) Socket 988 B rPGA (0x4)
    Number of hearts 4
    Number of threads 8

    LabView 2011.

    Altenbach says:

    Gibbon wrote:

    What was 'strange' behavior?  In "linia dluga" when inside the loop is on '1' of the "spreed up' between one and multi-fil is about 3 times, when I put it in '20' this grow to 6.2. It was strange form me, becourse I expect a similar value.

    A parallel FOR loop has an overhead for parallelization (split the problem, then go back the results, etc.). If the code is very fast, the overhead is proportionally larger. If the Subvi takes a long time to complete, the overhead of parallelization is insignificant. It is often not worthwhile to parallelize the loops with a very simple and fast code.

    Gibbon wrote:

    Altenbach - I have another question if you can help me - how did you "seconds relative high resolution." VI "? -I want to say how did you know that there is this 'vi '. And thanks a lot for your modyfications.

    You can find it in vi.lib\utilities. It is well known.

    Maybe not well known enough!  the 'Hidden gems' package adds to your palattes.  It has also been considered by a nugget of the community

  • While the loop does not stop within a structure of business

    Hi all

    I have a business structure that works an engine to a certain PWM when my metal detector does not give an amount greater than the threshold that is ' false '. The motor is controlled by a PI controller so a while loop is used inside the false state. When my metal detector exceeds the threshold I want the "true state" to perform but which does not occur. the entire program is a while loop which aims essentially to maintain the operation of the metal detector. How can I make the State of the switch works.

    Once you get the code is trapped inside the inside while loop, it will never be a Boolean wire change because change is outside. All you need is a loop that contains a structure of housing. Run your program with execution highlighting to get a better understanding of the flow of data.

  • For loop does not

    Hello world

    I try to use a simple loop for and it does not work. I have a group of drop-drop that I named Dropdown.A - Dropdown.F

    I am able to make a table using:

    var Dropdown = this.getField("Dropdown").getArray ();

    However when I try and loop on the table to help:

    for (i = 0; i < Dropdown.length; i ++) {}

    Console.println (dropdown [i]. (Name)

    }

    I get "Drop-down list [i] is not defined" so it seems that the i is never replaced by the correct when number one loop.

    We never seen this or know why this is happening?

    Thank you

    Mike

    This code works for me in an event of the button mouse up, so there is more than that, or I do not understand how you use.

  • My Thuderbird for mac does not delete messages from the server and can not find the setting in tools to do.

    According to the forum users, you go to tools-> account settings and there should be a box to "leave the message on the server" that I can uncheck, however, I don't see that my Thunderbird program for mac.

    You use the POP or IMAP protocol by e-mail? I guess that IMAP because you do not see the option.

  • iTunes does not stop after playing the last song on the playlist

    It was that iTunes has stopped playing after the last song in a playlist.

    I really liked it.

    Now, he travels the playlist, starting with the first song, after the last song is played.

    How can I disable this sort of iTunes for the iPhone goes back to stop playing after the last song?

    I can't see any preferences panel.

    You must disable the repetition. The only place to do it is on the "Now Playing" screen (view great work of the song).  Downstairs there are two arrows of recirculation, tap those until their origin is so more gray... he alternates song to repeat, repeat list, OFF.  Certainly, it is a horrible UI decision...

  • The menu system default language does not change according to the location that uses in-app

    Hello

    I have an emergency in application if you can reply me as soon as possible.

    In fact, I've implemented localization in application for Os 5.0 for 7.0.But, I extract some problems on specific devices so can you help me out for short.

    My problem: -.

    I use both languages in my application 1. Netherland and 2. English.

    Then 2 type of different scenario produced

    1. whenever the user change language of application at this time menu default language (Close, keyboard and Application Switch) no change. These are the ways that they change language according to the language of the camera. But this problem go get some specific device as 9850 for Os 7.0 and 9300 for Os 6.0.

    2 even conducted no user in another device like 9300 Os 5.0,8900 Os 5.0,9800 Os 6.0, 9900 Os 7.0 and Os 7.0 9320 ect... When this default menu (Close, Application Switch) changing the language according to the language of demand. These are the ways that they do not change language according to the language of the camera.

    Hello

    It's the Os.

    I confirm with the BlackBerry support team.

  • While the loop does not stop until 2 more clicks

    I must say that I'm really not familiar with LV, but Im learning.

    So why is that after I clicked on low stop, I had to click my OK button twice, then my program stopped. Why can't it stop immediately?

    Furthermore, if I want to do some of the dice to table, which wire do I missed?

    Thank you!

    Hi RawtoLV,

    You have a while loop in loop a while. When you run the other while the loop stops when you press the stop button, the inner circle while loop always executes. Since your OK button use latch release, what I noticed is that when you pressed the OK button, it quickly into position from true to false, which never stopped during the operation of loop (maybe because of the wait). Can I ask what are you actually doing with the structure of sequence?

    I would suggest using the event structure in place (http://zone.ni.com/reference/en-XX/help/371361K-01/glang/event_structure/):

    Here are some information about the structure of the event:

    http://www.NI.com/white-paper/3331/en/

    http://www.YouTube.com/watch?v=8eO64fo3Pho

    Warm greetings,

    Lennard.C

  • the loop does not stop until an exact number

    When I get the data via the shared variable table, the moment where I click on the 'Ok' button it opens 25 sheet of my workbook

    what I want, it's if my table has just 5 full rows of data, the moment I click 'Ok', only 5 sheet of my workbook opens.

    I think it's indexing related issue.if could someone help

    Thank you


  • Running Vista Home Premimum Service Pack 2. Why DEP now prevents Photoshop 7 launch when it still worked before? DEP to load the program exceptions does not work according to the instructions.

    Photoshop 7.0 version worked. Since the last round of updates, now DEP is prohibiting its launch. Following the instructions online to allow certain programs to be exempted from DEP is not no longer works. Program in the list do not use DEP profile but doesn't always open.

    Hello

    You can read these articles and check if that helps.

    Data Execution Prevention: Frequently asked questions: http://windows.microsoft.com/en-us/windows-vista/data-execution-prevention-frequently-asked-questions

    Change Data Execution Prevention settings: http://windows.microsoft.com/en-us/windows-vista/change-data-execution-prevention-settings

    What is Data Execution Prevention? : http://windows.microsoft.com/en-us/windows-vista/what-is-data-execution-prevention

    Why Windows close my program? : http://windows.microsoft.com/en-us/windows-vista/why-is-windows-closing-my-program

    Thank you.

  • For each does not properly in the XSLT file to two loops on a single node

    Hi all

    I'm transforming 2 inputs to a single target using XSLT. Both of the target entry of the same pattern and have the child element.
    In the XSLT, I gave this condition.
    "< xsl: for each select="$Variable1.payload/ns1:BookStore/ns1:Books ">
    < xsl: for-each select = "/ ns1:BookStore / ns1:Books" >
    "< xsl: if test="$Variable1.payload/ns1:BookStore/ns1:Books/ns3:BookId = ns3:Books / ns3:BookId ">

    My second for each does not work and in the target, I'm getting double elements. Help, please. Here are two xml source and xml desired target.
    1 XML source:

    < bookStore >
    < book >
    Name1 < name > < / name >
    author1 < author > < / author >
    < ID > 1 < / BookId >
    < quantity > 2 < / quantity >
    < price > < price / >
    < status > < / status >
    < book >
    < book >
    name2 < name > < / name >
    Author2 < author > < / author >
    < ID > 2 < / BookId >
    < quantity > 2 < / quantity >
    < price > < price / >
    < status > < / status >
    < book >
    < book >
    < name > NAME3 < / name >
    author of 3 < author > < / author >
    < ID > 3 < / BookId >
    < quantity > 2 < / quantity >
    < price > < price / >
    < status > < / status >
    < book >
    < / book >

    XML source 2:

    < bookStore >
    < book >
    < name > < / name >
    < author > < / author >
    < quantity > < / quantity >
    < ID > 1 < / BookId >
    < price > 100 < / price >
    < status > < / status >
    < book >
    < book >
    < name > < / name >
    < author > < / author >
    < quantity > < / quantity >
    < ID > 2 < / BookId >
    < price > 200 < / price >
    < status > NA < / status >
    < book >
    < book >
    < name > < / name >
    < author > < / author >
    < quantity > < / quantity >
    < ID > 3 < / BookId >
    < price > 300 < / price >
    < status > < / status >
    < book >
    < / book >

    Desired target XML:

    < bookStore >
    < book >
    Name1 < name > < / name >
    author1 < author > < / author >
    < ID > 1 < / BookId >
    < quantity > 2 < / quantity >
    < price > 100 < / price >
    < status > < / status >
    < book >
    < book >
    name2 < name > < / name >
    Author2 < author > < / author >
    < ID > 2 < / BookId >
    < quantity > 2 < / quantity >
    < price > 200 < / price >
    < status > NA < / status >
    < book >
    < book >
    < name > NAME3 < / name >
    author of 3 < author > < / author >
    < ID > 3 < / BookId >
    < quantity > 2 < / quantity >
    < price > 300 < / price >
    < status > < / status >
    < book >
    < / book >

    Thank you

    Hello

    It will not work like that... To do something like the following... Only one for each...

    
      
      
        ns1:Name
        ns1:Author
        ns1:BookId
        $Variable1.payload/ns1:BookStore/ns1:Books[ns1:BookId = $bookId]/Quantity
        $Variable1.payload/ns1:BookStore/ns1:Books[ns1:BookId = $bookId]/Price
        $Variable1.payload/ns1:BookStore/ns1:Books[ns1:BookId = $bookId]/Status
      
    
    

    I don't have to check the syntax, but you get the idea...

    I hope this helps...

    See you soon,.
    Vlad

  • Hi all, I bought apple phone I 5s recently is the power button / stop does not. Bought in the United States, but I was shifted to the India, the works of will to guarantee in India please help

    Hi all, I bought apple phone I 5s recently is the power button / stop does not. Bought in the United States, but I was shifted to the India, the works of will to guarantee in India please help

    Ask an authorized service provider regarding iPhones, a guarantee of a country may or may not be honored in another function where you take the device.

    (143868)

Maybe you are looking for