How the entry changes with each iteration of the while loop

Hello

can anyone explain (clarify) to know how or what contribution will be fed like the d block of adaptive filtering for the first, second entry (n) and remaining iterations of the while loop as shown in the picture as an attachment...

As I need to feed the e (n) out of the while loop as input d (n) to the Adaptive block for the first iteration for the next iteration of the previous output e (n) of the block Adaptive must be fed back as input (n) d and other x (n) of entry form the DAQmx.

Thank you.

You have a shift register on the edge of the loop, so for the first iteration, the input (n) d will get everything that feeds the shift register on the left of the outside. After that the adaptive filtering performed, e (n) is injected in the shift to the right, register to be read from the shift register on the left on the next iteration. And so on. This seems pretty much what you want.

PatanGova wrote:

As I need to feed the e (n) out of the while loop as input d (n) to the Adaptive block for the first iteration for the next iteration of the previous output e (n) of the block Adaptive must be fed back as input (n) d and other x (n) of entry form the DAQmx.

If you need retain the value in calls, use a node that is initialized in the world of feedback to feed out of the while loop at the entrance.

Tags: NI Software

Similar Questions

  • Work with each iteration on my db

    Hi my process should work with each iteration on my database, so I write some time initially, but now IM hinking t that it won't work. If I need that my process with al my data I need to do?

    Thank you

    I do not have you problem entirely. Can you explain a little more

    Thank you
    Brijesh Kumar Singh

  • How to add the unique element (inside the while loop) to itself

    I have only digital output element that is in the while loop. Its value changes in each time the loop iteration. If lets say I want to adds the values of the ten first in iterations of the loop of this variable.  How can I do that.

    See attach image for more precision.

    Thank you

    JK

    Hi Joseph,.

    THINK THE STREAM!

    As the values are stored in the son and the shift registers (and NOT in any kind of variables), you must use these fundamentals of LabVIEW:

  • 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

  • URGENT::opening multiple files - i have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    bbmChatDB of public database;

    public static FileConnection fconnRead = null;
    public static String fileReadData = "";
    public static InputStream is = null;
    data Byte [] = null;
    DataInputStream is = null;

    Here is my code...

    I have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    try {}

    FileConnection fc = Connector.open("file:///store/home/user/documents/BSM/") (FileConnection); "

    If (fc.exists ()) {}

    Enumeration e = fc.list ();

    While (e.hasMoreElements ()) {}

    System.out.println ("files are:" + (String) e.nextElement ());

    play this file
    StringBuffer stringBuff = new StringBuffer();
    try {}
    System.out.println ("opening file")-;
    System.out.println ("file name is:" + (String) e.nextElement ());
    fconnRead = Connector.open("file:///store/home/user/documents/BSM/(String)e.nextElement(),Connector.READ_WRITE) (FileConnection);
    System.out.println ("data length")-;
    If (fconnRead.exists ()) {}
    is = fconnRead.openDataInputStream ();
    data = IOUtilities.streamToBytes (is);
    Ddd = new String string (data);
    fileReadData = ddd.toString ();
    System.out.println ("length of data:" + fileReadData.length ());
    System.out.println ("read data :" + fileReadData);

    }

    } catch (IOException ee) {}
    ee.printStackTrace ();
    System.out.println ("Exception in the read data :")
    + ee.getMessage ());
    }

    }
    }

    } catch (IOException e) {}

    e.printStackTrace ();
    }

    {Finally

    try {}
    If (is! = null) {}
    is. Close();
    }
    System.out.println ("is closed...");
    } catch (IOException e1) {}

    E1. PrintStackTrace();
    }

    If (fconnRead! = null) {}
    try {}
    fconnRead.close ();
    } catch (Exception e) {}
    System.out.println (try ());
    }

    }

    }

    You can recode this treatment so that it uses only:

    e.nextElement ())

    Once a loop iteration.

    Directly at the start saying something like:

    String fileName = e.nextElement ());

    and use fileName everywhere in your loop.

    Also be aware that printStackTrace() will do nothing in your situation, it only works if you catch Throwable.  So make sure you something output all your catches exception and also have a catch (Throwable t) to catch the things you miss, as follows:

    {} catch (Throwable t)

    t.printStackTrace ();

    System.out.println ("Eception exception:" + t.toString ());

    }

    I think your code is thrown an exception and you don't see it.

  • How I WRITE VISA to 2 devices of a while loop?

    Hello

    I have developed a fairly complex vi that reads data from two sensors and controls SERIES written to two engine controllers.  The idea is to send the engine controls more or less "simultaneously", and they are generally not the same commands.  The two motor controls are determined by the sensor input with each iteration of the WHILE loop and subsequently sent to the VISA WRITE motor controller.  I was getting an errors and failures with the vi, then, we decided to break up and test the components individually.  In the original vi, I had two sets of VISA OPEN, WRITE, NEAR wired inside the WHILE loop and he sent two orders for both engines successfully.

    The test code I have attached here, "simple VISA speed controller rev1.vi" has the VISA sequence configured around the loop according to the advice of OR.  He suggested that the VISA OPEN and CLOSE while loop and wiring outside the VISA two WRITE such as shown.  However, in this configuration, only the command of the CHANNEL 3 runs.  The CHAIN 1 command does not run.  The string ' / 1V...» "engine controls 1, and" / 3V... " "engine controls 3.  So, by changing the 1 and 3, I order two this vi engines, but only, the chain is the first VISA WRITE running effectively, regardless of the engine is selected in the order of the string.  There is no malfunction of the motor or wiring, and I order the two motors separately using the software provided with the manufacturer of the motor controller, therefore, the hardware has been confirmed to work properly.  I use NI USB-RS232 to send the string on the motors controllers.  Motor controllers are connected in Garland, and each has a switch address so 1 engine knows how to respond to ' / 1V...» «and the engine with the value '3' address switch responds to ' / 3V...» "etc.

    The other code attached here, "simple VISA speed controller 2 motors.vi" sends the two commands at the same time.

    So, why the second VISA WRITE does not work the '... rev1.vi '?

    Thank you

    Dave

    Hello Dave,

    In accordance with our telephone conversation, that give a try.

    Joel C

    National Instruments

    Engineering applications

  • Table 1 d in the while loop problem

    Hello world

    I searched this problem in the forum, but seems only some positions quite didn't answer.

    I'm stuck by saving the data in a while loop.

    I have a while loop, within which there are two exits in each iteration, I want to add to a table, and then after the while loop is completed, I want to combine these two tables in a 2D array (since the release of them must be a pair in my case).

    I tried 'Build array' and 'transpose array' and 'write in spreadsheet' element set, which maintains concerns me is how simply to add the result in a 1 d table during each iteration, these 2 outputs are in digital format, which prevent to directly create a table for it.

    Any idea is appreciated,

    Thank you

    Chen Kunsheng

    Here are some other ways to insert.

    It may be useful

  • store the value obtained in the while loop

    Hello

    I'm data acquisition (1,000 points every 0.1 s) in a while loop. I would like to calculate the average y of the first sample of 1000 points when I click on a Boolean 'calibrate', store that value somewhere (outside the while loop?) so that it can subtract from each new amplitude y. In the vi below, a new average value is calculated in each loop, although I would only use the first.

    You don't need to store the value outside the while loop. Keep the offset of the value when calibrate button is pressed and subtract the value with earned value. I modified your find VI the VI attached.

  • delete 2d array in the while loop

    I have a table 2D being initialized outside of the loop executing a state machine, how would a clear table 2d in the while loop? I guess I'm not sure what to wire a constant matrix empty 2D too =)

    When you want to erase (regardless of this Boolean condition), wire just a constant matrix 2D of your shift register.  See attachment.

  • For results outside the while loop

    Dear friends,

    I have a while loop vi, which is attached to this mail. I want to update Boolean Boolean results, while the while loop runs. In fact this is not the case?

    Do I need to use it as a global variable or another simple method to do? Could you please guide me, or please alter the VI of the sample which is attached to this mail.

    Thank you

    Best regards

    Tom

    The Boolean value outside of the loop only will be updated, as wiring system, when the loop ends, it's how the LabVIEW data flow. The simplest method for updating the Boolean value outside of the loop is to unplug the wire, create a local variable (right click on the device, select 'create', 'Local Variable'), move the room inside the loop and hook it up to your function "equal." This is not necessarily the best method, just the easiest for this example.

  • To break out of the while loop (1)

    Hi all

    I have a simple question that if a callback to a command button function, I use a (bLoop) While
    loop, where bLoop is a boolean variable has the value TRUE, then how can I break up or out of this while loop by using a control on the façade, which released the while loop by setting bLoop = FALSE.

    I tried, but it didn't come out

    The problem here is that the CVI normally only runs a reminder at a time. While you are in snooze control, no treatment of GUI and subsequent calls to other reminders usually occurs.

    You can try the following approach-, but it's not really the best method:

    While (b_loop) {/ / within a reminder}

    ... / / Do your tight loop

    ProcessSystemEvents ();   Force the CVI to see if all the GUI needs maintenance controls

    }

    If you have a reminder of different control to erase the global b_loop, this packing approach might work for you.

    You must use this technique for very simple programs - it can quickly escape out of control and in the end upward in a mess if you're not careful. OR recommend that you use not ProcessSystemEvents() within a point of order.

    JR

  • Force the While loop to exit when the delay is running

    Hello guys,.

    I have a While loop containing some jobs. One of them is delay for 10 seconds. When I push the stop button, the loop does not stop immediately. Instead, it stops after a few seconds (can be, pending other jobs is done).

    What can I do if I want to stop the loop immediately after I press the stop button?

    Thank you for sharing...

    Hello Yoppy,

    I don't know if I understand your problem completely, but here's the method I use to stop the while loop immediately (some ms delay will be there for you).

    I would like to know if the attachment helps.

    There are several ways to do it and you can get better solutions than this one on this community.

  • How to add items to a table 1 d with each iteration?

    Hello

    I have a 3 loop iteration For which gives a table of 5 elements after his execution. At each iteration of the loop, how can I add each item to its previous value to form a final picture of the cumulative sum of the parts? For example:

    Array of values for 1st iteration: [A, B, C, D, E]

    Array of values for 2nd iteration: [F, G, H, I, J]

    Array of values for the 3rd iteration: [K, L, M, N, O]

    How can I make the Final table being a cumulative amount of IE: [(A + F + K), (L + B + G), (C + H + M) (D + I + N) (E + J + O)]?

    Your help will be apreciated, thanks!

    The Add function is polymorphic. So, if you give 1 2 tables you will get a table that corresponds to the sum of each item. With a loop, you must use a node registry or feedback shift to keep track of the sum of the currents.

    For example:

  • How can I clear the shift registers of sub for loop for each iteration of a larger loop?

    Hello

    I write a program to concatenate multiple text files.  However, I need to treat each column individually before they are concatenated.  I use one for a loop at normalze 6 columns choice the largest loop of concatenation.  However, the shift registers store data from previous iterations of the larger loop.  How can I clear the shift registers of the void loop based on the iteration of the larger loop?

    Thanks in advance!

    OK, that's fine. are there headers?

    In all cases, all you need to do is to place all of the 2D array in the shift register of the inner loop, iterate over the columns relevant to be normaized (use 'index array' to get the column it normalize, put it to help to "replace the subset of table".) You probably want to initialize the outer loop shift register. Use then "building the table" added to the beginning or the data of each file sets.

  • Graph waveform repeats with each iteration of the loop

    Hi guys,.

    I got some great responses from you many already, so I hope you can help me once more!

    I try now to simply take a voltage that is measured by a sensor, I tied to AI1, and I built a graph of very simple waveform using a DAQ assistant. I have the setup terminal to CSR, the acquisition value continuous sample mode and read samples and rate game to a control on the Panel before which I can control myself. All this is a while loop that is needed to collect data over time.

    However, the problem I have is that for each loop of the loop, it seems, to reset the graph, so my x-axis never increases over time, ideally I want it to do is to show results through from 0 to 100 on the x-axis to say, and then, when it comes to 101, he will start again on the extreme left of the graphic to the right to a crossing another 100 points given) (there's a term for this, but I forgot, sorry!). To be honest, this kind of logic like everything in the loop will be restarted, but after trying to chart the loop it does not work, so I'm fresh out of ideas.

    I think I might have to do is to manually build segments of data acquisition (DAQ mx) and have only certain parts of them in the loop, although I can't be sure. I tried various examples and online on the database of NOR (including tension-int acq & graphic clk which works well in the examples, but not at my request) but no luck for now

    If anyone can think of what could be the problem, then please let me know. FYI the sensor is optical fiber if it makes a difference. I have attached the file VI that I did does not really...

    See you soon!

    Ritchie

    Since you use a chart there is no way to fix it. If you choose to go to a XY chart you could solve this problem. See the example below.

Maybe you are looking for