maneuverability while loop in Subvi

I have a Subvi, which contains currently a while loop.  The while loop is responsible of sequentially illuminant a grouping of the LEDs continuously.  This is desirable as the Subvi.  (if there is a better way to do it without some time I'd buy some loop)

Secondly, I have a main vi using the event structures.  To make things allows generic, say the user can select the grouping LED by selecting the 1st and the LED to light of editting text fields last two in primary vi.  After the user enters the values of LED in the two fields, he clicks OK, the range is sent to the Subvi and the Subvi begins to control sequential lighting of the LEDs.  This work is great!

Here is where I have the problem.  Now, the user wishes to change the range of LED and send them to the Subvi.  Nothing happens because the Subvi is stuck in it's while loop.

What is the best way to handle this. ?. It is Kick my ass now and a simple example would be wonderful!

Thank you

Mike

Robert Cole's beaten me suddenly punches, but here's an example of its solution.

Tags: NI Software

Similar Questions

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

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

  • Control and Simulation in a loop / while loop with TCP/IP reading / writing of synchronization

    Hello, I have a problem with reading TCP/IP and written in two loops. The problem is NOT to get the two loops to read and write to and from the other. This has been accomplished. My problem is when I run control and the loop simulation on my laptop and the while on a RTOS remote on the controller on-Board of LabVIEW in a remote PXI chassis, the while loop the remote system running on four 4 times faster than the loop control and simulation on my laptop. In other words, for each iteration of the loop control and simulation on my laptop, there are 4 four iterations of the while loop on the remote system. I need to know how to get a degree of kinship (1:1) with these iterations of the loop. When I run a longer simulation in real time, say 10 seconds, the control and Simulation loop begins to slow, i.e. the simulation time slows down until it is no longer in real time and the "Late Finish"? Parameter is set to true and the LED lights and continues to stay lit. At this point, the system destabilizes due to what I believe is being well sampling rate too discreet and I have to end the simulation. How can I get a ratio of one to one between the loops and also to avoid slowing the loops causing destabilization?

    To give an overview of my application, I implement a control system in a network, seen in "image2.png". This is achieved using my laptop as a subsystem 1. Reference signals are generated from the laptop and the error signal is produced. Control measures taken and the control signals are sent via TCP/IP to the remote system. Position feedback is returned, and the process repeats. My system has Core I7 Procs w / 3 GB of RAM, up to 1 GB/s speed via ethernet and LabVIEW 2011 installed with all necessary modules and networking tools. The attached VI Custom_Wireless_Controller works on my laptop. The remote system I'm working on that has the 7830 NI R Series with FPGA card. OTN runs on the PXI chassis with an enbedded controller that has networking capabilities of up to 100 MB/s via ethernet. I use the FPGA for the acquisition of data and apply control signals to my plant. The plant is the PCE twist connected to the FPGA through the cable of the ECP - RIO of NOR. Subsystem 2 is this side of the CNE. The FPGA collects position, he sends to the controller via the network, receives signals from the network drive and writes signals to the plant power amplifier that operates the plant. This process is repeated and the VI and is titled Custom_Wireless_Plant.

    I appreciate the help really and look forward for her and for any question!

    Well, the first step is to understand what you have set up right now. Your control and Simulation loop on the side of the controller is configured as 'Runga Kutta 4' and you have a loop timed on the other side. In addition, you have the primitives of TCP/IP on the control and the Simulation diagram and means he will perform (a message) on the size of each minor step, which in your case is 4.

    So, you have two options:

    1. replace the Solver side controller Runga Kutta 1 (this must synchronize loops)

    2. hold RK 4, but create a Subvi around two primitives of TCP/IP and configure from the VI to run than the major (continuous) step-size. If you do it right, you should see a 'C' on the upper right part of the VI you have created.

    Please let me know if what I said is not clear...

  • Can not on the button while loop

    Hi all... hoping to get a few design tips as I am very, very new to LabVIEW. I got a project that someone else had started and I've encountered a problem that I don't know how to solve.

    I'm using LabVIEW version 8.0.1 and I think my problem has to do with the help of DAQmx in a while loop. In "Working.vi" (including the Sub - VI 'Temp data to CSV.vi'), I copied - and stuck the while loop in a vacuum VI for testing. In this VI, with nothing else, it works - slowly, but it works.

    In the real VI, I can see the data of temperature updated every 4 seconds, so I know that the program is not frozen or something like that. However, by pressing the button "Return to main Menu" does nothing - the image of the button does not show that it is to be depressed, regardless of how many times you click or click and hold the button. I've attached a screenshot of the while loop inside the real VI; I prefer not to fix the real VI (especially because it contains references to many of the Subvi, and it is not currently contained within a LAW degree).

    I'm this coding the wrong way? I have the feeling that it might be caused by my settings DAQmx (continuous samples, 2 samples to read, 250 mHz). The very low rate would be the cause? Is there a better way to have readings of temperature taken every 4 seconds (approximately)?

    You have your case of event the value "lock the front panel" until full?  If so, then no other presses the button will be recognized until the ongoing case event complete.

    It is never a good idea to have a code in an event business that takes a long time to run.  It will make your UI seems to lag or even functional.  Any time I see someone with a while loop inside a case of the event, I'm afraid.  (By the way, I am also concerned all nodes comments hovering over the structure of your event?  What are doing?  Why some operate on the default data?)

    In general, events should take is no longer running then what ordinary person could be expected until they feel like the user interface is delayed.  Perhaps at the top of 1-2 seconds.  You should look at a model of design of producer/consumer with events.  The structure of your event should respond to UI events, then pass orders by a queue path to the part of your program that does the real work.

  • 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

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

  • do not shutdown of while loop

    Hello

    I'm LabVIEW and motion controller software OR hardware PCI-7332/UMI-7774 and control a stepper motor.

    My question is:

    When flipping enc = 5 whereas the loop stops

    but with the rest of the value of 20 to 500.

    Why isn't rest zero.

    When the indicator test installation is checked

    the while loop does not stop.

    Please see the attached code.

    Thank you

    The rest would have to do with what happens inside the Subvi, which was not included. The output value of is not stop to an exact multiple of 4095. The question is why that is the case.

    Mike...

  • stop a while loop in slot - VI

    Hello

    I have a Subvi, which has a while loop and it is in my main vi in a sequence structure, I want to stop the loop inside the Subvi using a Boolean value in primary vi.

    I tried global variable, but it has not worked since the stop in my main vi botton is not updated when the program is running...

    could you please help me?

    I appreciate any ideas

    Thank you

    Darya

    As a general rule, avoid using Structures of the sequence.  The reason being that they are violating data streams.  If you can control the flow of data with threads, it is the most effective way to make your program work.  The idea to get rid of your sequence structures is therefore to make an another Subvi to your expectation that also has an error and output error.  Then, you can use the cluster of error to force execution.

    And while loops inside the subVIs is a common beginner problem.  If you do not order when the loop ends based on a front panel of the mainVI control, then the loop must be in the main VI.

    I hope it's a good summary of what was said.

  • Code Golf: stop two while loops with guaranteed ratio iteration

    Proposal

    In the vein of the tradition of Perl, I would like to see if there is any interest to solve a few puzzles programming in LabVIEW. Can someone post a problem and define the rules to solve.

    Here's a question for beginning/intermediate to sharpen your "palette".

    Description

    With a user action, how you would stop two while loops such as the relationship between iterations is the still the same? Concrete to view this situation is to take action: both instruments use the same source of synchronization to take measures, but second divides the clock down so that it is a little slower than the first whole factor. For example, if the slower instrument is four times slower, then at the end of the VI, the slower instrument takes 100 measures the fastest instrument took 400.

    Rules

    • You can use vi.lib
    • You cannot include any other subVIs
    • Your solution should pass for loop1 interval as low as 25 ms

    Model (joint in LabVIEW 2009)

     

    If people are interested in this, then we will find a way to improve future problems. Please post your suggestions and criticisms, but only if you also post a presentation ;-)

    MacNorth wrote:

    [..]

    If we choose the first suggestions, the VI has yet to recover the data at different speeds. You can dedicate a loop for each instrument to disassociate a jitter and latency introduced by their connectivity or the inner workings. This adds a margin of safety when there is a conflict of thread and the pilot. You can also implement a simple counting as altenbach loop and renounce the multiloop complexity.
    [..]

    It is a very good point. But I wanted to make sure, you should / need to discuss the benefits, but also the disadvantages of the design. Implementation of an application is most often a process of 'special cases '. If a framework/design for a single application model does not necessarily correspond to another application.

    Designs are always strongly according to the requirements and constraints. What gives here designs will result in educational services, of course, but not necessarily as reference models for specific applications.

    Advantage of simple loop:

    • No synchronization between several loops required
    • Can easily implement any whole factor between services (quotent & function remains for a case structure

    Disadvantage of simple loop:

    • Take advantage of the multi core systems (at least not much)
    • Can easily run out of the time constraints (material not "not responding" enough, fast manipulation of data takes too long,...)
    • Code will accumulate within the structures of the case, where the readability could suff

    The advantage of multiple loops:

    • See essentially the disadvantages of single loop (several loops solve those)

    Disadvantage of multiple loops:

    • More complex, especially for the sync switch (not beginner friendly, requires a more/better design)
    • May contain easily questions source such as race conditions and locks

    A little side note:

    Even if the equipment works different acquisition rate, this does not necessarily that the software must use different rates for data extraction. You can use the same model of an hour, but get X times more values for the task faster than the slower running. The 'only' thing to care of are the sizes of buffers and bottlenecks in the data transfer.

    MacNorth wrote:

    [..] The best advice published OR shutter multiple while loops (https://www.google.com/search?q=labview+stop+multiple+while+loops) are laughable (and the 'solution' in my model). [..]

    No, it's not laughable. For many applications, this approach to shutter at the same time several loops running is OK. The constraint: only for simple parallel running loops.

    More complex loops (producer/consumer and similar) with the more complex data relationship ships require more valiant approaches such as queues, declaring events or user.

    My 5 cents only,

    Norbert

  • Why the execution time increases with a while loop, but not with "run continuously?

    Hi all

    I have a problem of severe weather that I don't know how to fix it because I don't know exactly where it comes from.

    I order two RF switches via a data acquisition card (NI USB-6008). One job at the same time can be selected on each switch. Basically, the VI created for this feature (by a colleague) resets all the outputs of acquisition data and active then those desired. It has three entrances, two chain simp0le controls and a cluster table, that contains the list of all the outputs and some practical information to know what is connected (specific to my application).

    I use this VI in a complex application, and I have some problems with the execution time, which increased whenever I said the VI, so I did a test VI (TimeTesting.vi) to determine where the problem came. In this special VI I record the execution time in a csv file to analyze then with excel.

    After several tries, I found that if I run this criterion VI with the while loop, execution on every cycle time increases, but if I remove the while loop and use the funtionnality "Continuous run", the execution time remains the same. In my high level application, I have while loops and events, and so the runtime increases too.

    I someone could explain to me why execution time increases and how can we avoid this? I have attached my VI test and the necessary subVIs, as well as an image of a graph that shows the execution time with a while loop and «run permanently»

    Thanks a lot for your help!

    Your SetReset_DO VI creates a channel whenever it is called.  And that you never delete a task.

    When running continuously, that it's as if it only runs once and LabVIEW has internal mechanisms to close references that will not be used again.  When a VI is used as a Subvi, LV does not know if she will be called again, and lacks these things until the first level VI stops. You have a memory leak.

    Just as you open and close your file outside the loop for, create your channel out of the loop.

    Lynn

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

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

  • run a while loop in separate vi, minimize the window flashing

    My apologies in advance for not including a VI; I cannot give it, cannot even provide screenshots.

    I have a state machine base with a cluster of Boolean values that are analyzed in the 'default' State, the scan index = true determining the next State. All other States to return to the default state. The State of 'stop' stop the loop with a Boolean constant = True, located inside the structure case wired to the time entry conditional loop (all States have a Boolean constant False wired to it). Apart from the cases

    statement, the wire connected to the conditional entry is connected to a Boolean indicator, ' Stop, in really. The time delay within the State of the machine while loop is currently set at 100 ms.

    In addition to the 'State' shift register, the state machine has a "boolean" shift register. All States, except one, feeds the value passed the Boolean value through to the next State (i.e. wired directly from left to right the structure of the case). The exception is the State which inverts the Boolean value, with the output of the inverter transferred to the State following and also connected to a Boolean flag, 'Show the State', the

    indicator outside the case statement but inside the while loop. All other States wire just the previous state of the Boolean value through the following State, unchanged.

    In addition to the State of the machine while loop, I have a parallel while loop (scourge of the LV forums). All entered conditional loop is connected to a local variable to 'stop, really. " A True/False case in this while loop structure contains a Subvi in the case of True value. The Boolean value of entry to the case statement is connected to a local variable for 'Show status'. The Subvi, which is in the real case is to display the State of the

    user.

    The Subvi which provides status through its frontage runs a script in python via a 'comand prompt"vi. The necessary update to the python command send is ~ 1/second. Within the Sub - VI is a 1 second delay time after execution of the code.

    It works but I'm doing some improvements with minimal impact on what I have.

    Two cases of VI properties that relate to the conduct of the State Subvi (floating or default, modal does not at all):

    1. with "Firm when previously closed" selected, the window switches VI (via the main switch VI) open and closed but when it is open there is the a second window flash that could cause seizures in some users.

    2. with "closes when previously closed" deselected, the window remains open and it is difficult to tell the difference between the running state and is not running. In addition, the Subvi window will not be reduced for this option.

    Is there a little invasive change, I have the code in force to stop a second flash described in #1 above and activate / deactivate the Subvi status window?

    Thank you

    Jeff


  • DLL slows parrellel while loop

    Hello

    I am changing a VI I wrote, to work with another piece of equipment. Communication tends to work directly through labVIEW. My new equipment provided with a driver/dll library and now I have many layers before reaching the material (LabVIEW-> driver-> software-> the measuring equipment). I have some time this account down to run alongside my Subvi who manages my method of measurement of the loop. As I put in place the screw that call DLLs that count - while loop slows down in the same frequency, I'm calling the dll. I've changed the "Run in the user interface thread" setting to the "Run in any thread" option in the call library function node. In fact, which got rid of my problem about 90%. But my meter still comes in a few seconds at the end. I wonder in what sense the crux of library function call delayed a seemingly parallel thread?

    Any suggestion on the place where to continue searching for a fix?

    Welcome them

    / Lorenz

    It is hard to tell what might work without knowing your DLL and what he actually did, but I see something in your loop that will force LabVIEW to toggle the user interface thread! The property node to update the text of the start_method th button will ALWAYS force a change of context for the UI thread. If you can avoid this really should not be possible for the DLL block your loop more. At least try to not update this property if it needs to be changed with regard to the previous value and not at each iteration of the loop.

    A guess is that the DLL actually interfaces to ActiveX code somehow. LabVIEW initializes its ActiveX environment to run in the UI thread, because it is the only safe thread system in LabVIEW to perform many threaded ActiveX components or when the data marshaling is involved. If your DLL tries also to connect to an ActiveX interface, it will be forced to go the UI thread that explains how to access the property in your loop can get delayed.

    And another problem you have is the moment of software. count you down the loop increments of 10 ms, but Windows will be hardpressured for hard real-time performance. While you are not using the "wait until the next ms Multiple" to take account of some jitter, if the loop is blocked for more than 10 ms through an external resource, you will actually jump an interval.

    Better would be to calculate the time elapsed directly reading the timer tick before entering the loop, then use the output of graduation of timer her to "wait until the next ms Multiple" to calculate the difference. Dividing this difference by 10, and then adding your counter value initial this result would give you the same value that you feed your VI calculation, but what about the real system clock, not a counter loop running asynchronously with questionable interval.

Maybe you are looking for

  • Slow parallel with DAQ loops

    Hello guys,. I decided to make new thread on very strange problem with the DAQ assistant in one of my loop. There is something wrong with my deffinatelly program, but I have no idea what it is. So I think that my program is really usual and often use

  • Error code: 80072EFE (cannot install will want to)

    Whenever my computer tried to update for the last week, I get a message that says: "Windows could not search for new updates. Code 80072EFE. I discovered it means "Error_Internet_Connection_Aborted. The computer has not found something wrong with the

  • How can I reinstall canonprinter toolbar?

    How can I reinstall the toolbar from canon that I deleted by mistake.

  • Creative Suite Design Premium 5.5 does not install Acrobat Professional 10

    Computer of my daughter crashed and I am trying to reinstall Creative Suite 5.5 Design Premium on my Dell T7910 dual processor. While Photoshop has been installed, Acrobat Professional 10 was not and I get an Exit Code: 6, 0 fatal errors, 3 errors, 0

  • SQL QUERY: operator relational invalid

    Hi friends,I created classic report and create the checkbox for the market and create a filter on the box.Select I.SBU_CODE, I.MKT_CODE, $m.name, MKT_NAME, D.DIV_NAME,SUM (DECODE (I.INVOICE_TYPE, 'C', (-1 * NVL(I.GROSS_AMT,0)), NVL(I.GROSS_AMT,0))) C