output to the loop iteration

Hi people!

I am trying to use a very simple "loop For" with "16" iterations and Shift Registers starting at '0' and adding '4' on each iteration.

But I am not successful to display each value in the iteration. Only the final value of '64 "!

Is it possible to generate the value of each iteration in each loop?

If this is the case, then could you give an example?

See you soon!


Tags: NI Software

Similar Questions

  • OR USB-6009 daq sample following loss, while the loop iteration

    Hello

    I am trying to acquire and display data measured from a DAQ NI USB-6009 material using Labview 2015. I am using the wizard daq defined for the differential mode and n samples with the sample rate and the total number of samples registration by the user. My problem is that when the specified amount of samples is acquired and the while loop continues to the next iteration, some samples are removed (I know because I tested it acquire a wave of fishing and there is a noticeable artifact in the signal at times where the while loops - I downloaded a file showing this artifact in a wave of fishing that was recorded with a sample rate of 1000 Hz 500 samples of recording each) iteration which means that the artifact occurs every half second).

    I think that this can be corrected by simply taking off the while loop daq assistant and specifying the number of samples you want the entire test to acquire. However, I would like to see the signal in a graph as its achievements and the daq can acquire data indefinitely until the user presses the stop which, to my knowledge, it would take a while looping. I downloaded my vi for reference, and any help would be greatly appreciated!

    Set your Acqisition Mode on "samples continues."

    N samples: reads the desired number of samples and stops.  Will read once again what DAQ Assistant is represented.  In other words, that there is a gap of time between readings.

    Continuous samples: data acquisition just constantly reads the data.  The DAQ Assistant just gets the number of requested samples and data acquisition keeps just read and store it in the buffer.

  • Cannot read every value of the loop iteration for

    Hiiii...

    I developed a front-end which reads the values of serial port and display on the front panel.

    16 channels, which is a string data value. I've separated this string to read the data of each channel, but at the end of the loop for, I can read data only one channel for an iteration, and also I have to store each value iteration in a text file.

    I'm new to labview. Help, please. I have LabVIEW 8.0.

    Attached is my application code.

    This seems quite inefficient. Why don't you use a business structure? Why don't post it your code.

    In regards to the original code, you try to run by using the run continuously? I ask because I do not see a global loop, so it was not clear whether this was intended to present itself as a simple Subvi or "on-demand". If it's supposed to run continuously until you stop, DO NOT USE CONTINUOUSLY RUN it BUTTON. Use a while loop in your VI. Do not forget to place the initialization and close outside of the loop - you don't need to initialize and close the serial port whenever you loop around.

  • The loop iteration count

    Hi all

    I have the problem to create a simple counter that will count from 0 to 10000, then repeat the sequence without using the while loop for iteration. Can anyone help please?

    Best regards

    Maiz

    Like this.

  • Producing a XY chart in a While loop that adds a new point XY to the curve from each while the loop iteration

    I would like to plot data by using the XY graph as a Visual display. I have a While loop that creates a new point X and Y during each iteration. I need the XY graph to be in the While loop, because once the order to stop has been pressed the sis loop finished and the final graph to be displayed. The problem is that after each iteration, the XY graph display clears and watch point, compared to add the new point to the previous by a line connecting the two points. It works perfectly if I move the XY graph out of the While loop, but it only shows the XY graph at the end of the While loop. I would like to visually see the XY graph updated during the execution of the While loop. Any help would be much appreciated.

    Thank you

    You can add a data both point to a chart to a chart, you must pass the entire data group.  I would use a couple of shift registers in your loop.

  • How to view FND_FILE. OUTPUT in the loop message

    Hello

    I have a package created and I would like to display error message on each loop. If it's 5 records then error message 5 times. My validation is data existing in the table csv if customers. My package below.



    PACKAGE body to CREATE or REPLACE APPS.omOrderLoader AS
    PROCEDURE SPKO1 (errbuf OUT VARCHAR2,
    RETCODE ON NUMBER,
    vfile IN VARCHAR2,
    v_source_id in NUMBER) IS

    FH UTL_FILE. TYPE_DE_FICHIER;
    v_line VARCHAR2 (32767).
    v_created_by NUMBER (10);
    v_creation_date DATE;
    v_org_id NUMBER (10);
    v_orig_sys_docref VARCHAR2 (50);
    V_Customer VARCHAR2 (360);
    v_customer_prev VARCHAR2 (360);
    v_sold_to_org NUMBER (10);
    v_orig_line_ref NUMBER (10);
    v_item_code VARCHAR2 (2000);
    v_ordered_qty NUMBER (10);
    v_selling_price NUMBER (10);
    v_hcount NUMBER (10);
    v_lcount NUMBER (10);
    v_stat NUMBER;

    BEGIN
    -v_source_id: = 6;
    v_created_by: = - 1;
    v_org_id: = 204;
    v_customer_prev: = null;
    v_orig_line_ref: = 0;
    v_stat: = 0;
    errbuf: = NULL;
    RETCODE: = 0;
    v_sold_to_org: = 0;

    SELECT header_id in (DE) v_orig_sys_docref
    Select header_id
    of OE_ORDER_HEADERS_ALL
    creation_date desc order
    ) WHERE ROWNUM = 1;

    FH: = UTL_FILE. FOPEN ('XXANDDIR2', 'R', 32767, vfile);
    < < file_read_lines > >
    LOOP
    BEGIN
    UTL_FILE. GET_LINE (fh, v_line);

    V_Customer: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 1") ',' "') ','" ');
    v_creation_date: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 2") ',' "') ','" ');
    v_item_code: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 3") ',' "') ','" ');
    v_ordered_qty: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 4") ',' "') ','" ');
    v_selling_price: = LTRIM (RTRIM (REGEXP_SUBSTR (v_line, "[^,] +' 1, 5") ',' "') ','" ');
    v_orig_line_ref: = (v_orig_line_ref + 1);

    If v_stat = 0 then
    v_orig_sys_docref: = (v_orig_sys_docref + 1);
    end if;

    SELECT hca.cust_account_id from v_sold_to_org
    OF hz_cust_accounts AOB.
    HP hz_parties
    WHERE hca.party_id = hp.party_id
    AND hca.warehouse_id IS NOT NULL
    AND hp.party_name = v_customer;

    -If non-existent then display message for every row of the csv.

    If v_stat = 0 then
    INSERT INTO OE_HEADERS_IFACE_ALL...
    commit;
    end if;

    INSERT INTO OE_LINES_IFACE_ALL...
    commit;

    v_customer_prev: = v_customer;
    If v_customer_prev = v_customer then
    v_stat: = 1;
    on the other
    v_stat: = 0;
    end if;

    fnd_file.put_line (FND_FILE. OUT, ' LINE: ' | V_Customer);

    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    OUTPUT file_read_lines;
    fnd_file.put_line (FND_FILE. OUT, «no records found...» ») ;
    END;
    END LOOP;
    SELECT count (*) in the v_hcount OF OE_HEADERS_IFACE_ALL;
    SELECT count (*) in the v_lcount OF OE_LINES_IFACE_ALL;
    fnd_file.put_line (FND_FILE. OUT, ' header: Total Record inserted successfully: ' | v_hcount);
    fnd_file.put_line (FND_FILE. OUT, ' LINES: Total Record inserted successfully: ' | v_lcount);
    UTL_FILE. FCLOSE (FH);
    END SPKO1;
    END omOrderLoader;
    /


    Help, please.

    Thank you.

    Kind regards
    Diane

    sth - something :)

    >
    So when I applied it, error display "PLS-00103: encountered the symbol EXCEPTION when expecting one of the following values (begin case declare and if the exit for goto loop mod null).
    >
    Add start before choosing
    >
    BEGIN - home
    ...
    start - it!
    SELECT hca.cust_account_id from v_sold_to_org
    OF hz_cust_accounts AOB.
    HP hz_parties
    WHERE hca.party_id = hp.party_id
    AND hca.warehouse_id IS NOT NULL
    AND hp.party_name = v_customer;

    exception when no_data_found then
    v_sold_to_org: = null;
    end;
    ...

  • changing the values of loop iteration

    Happy new year everyone!

    I have a question about changing the loop iteration number set to a loop for. I made a simple example of what I had imagined in my mind, but I knew that it wouldn't work, however, it shows what I want to accomplish. I would use a switch or something to control the loop, so you can start running to essentially infinity, which is the constant from 1000000 and then go on a number of controlled if the loop ends in fact and the code can move. Each iteration is a second.

    Thanks for any ideas you may have

    A While loop is a loop For which has no fixed number of iterations (if you allow me, he 's going to try to go to infinity).  It has a Stop indicator that stops the loop if True is wired for it.  Note that if True is wired to the stop indicator when the loop begins, the loop will always be executed (once).  In this sense, it is slightly different from a loop For 0 cable to the input of N (which does nothing).

    So some time, use a loop to do this.

    Bob Schor

    PS - you should know...

    PPS: I just looked at your VI.  I'm sure you realize that the way to data flow rules you need to set the Boolean and order digital before start the programme - once it starts and gets into the while loop, changes you make outside the loop will have no influence on the code inside the loop.

    Have you taken the LabVIEW tutorials?  If so, and if not, go look again, attention to the program flow, loops, etc..

  • Improving the performance of the loop

    Morning all,

    I have a loop For, execution of 5,000 times nested within a structure of the event. I parallelization allowed that each iteration is completely indepentant of all other iterations. I am performing an optimization to each iteration. I have several multidimensional arrays as inputs I at the start of the index outside the loop For and then auto-index on the loop. I then accumulate several tables with the results of each iteration as outputs on the loop for run time is between 40-60 minutes, where, as the same code by one of my colleagues using Python takes 10 minutes. Is that what I can do to improve performance? I'm running a quad core, computer laptop i7 with lots of RAM, so not a hamster in a wheel, the code of conduct.

    Thank you

    Paul

    I agree to say that (a) you should zip code (the easiest way is to attach your VI, not a photo, certainly not PowerPoint), and (b) you should not use form nodes if you want speed.  I bet a dime that your code is going to fight many times more.

    [, Or by the way, here is a code snippet LabVIEW, one.] PNG 'image' which will be transformed into executable of LabVIEW, 'Magic' or due to some code, if you deposit a LabVIEW (version displayed in the upper right) 2016 block.]

    Bob Schor

  • A generated within a loop in a subvi output data can be transferred to the main program for each iteration of the loop?

    Hi LV users,.

    I have a very basic question, I have not succeeded to asnwer using basic considerations.

    I made a sub - vi that performs a scan of current-voltage using a unit of measurement-source Keithley and a loop FOR.

    The subvi outputs 2 tables with my data (essentially an array of voltage and the corresponding current table). I also defined a Terminal at the exit of a group of these 2 tables in order to plot a graph XY - output. Specifically, I indexed this cluster to update after each iteration of the loop FOR, in my sub - vi (the indicator is placed outside the loop, of course).

    My problem is that I want my main program to display the XY-graph in real time, with an update after each iteration of the loop FOR which is in my sub - vi.

    I have a problem because my sub - vi output terminals are available for the main program concluded as soon as the sub - vi has completed its own execution (which is what we expect of sub - vi to do).

    How can I use a sub - vi (because it's handy) and get in the main program in the course of its performance data that are generated from the loops of sub - vi?

    Thanks in advance for your help,

    Yoyo87

    Elements of the queue in the Subvi them put your main VI where you want to display the data and the.

    It is similar to the architecture of producer/consumer. There are examples of it in LabVIEW. The examples work with 2 parallel loops, in your case a loop (the producer) will be in the Subvi.

  • calculations between two values of the sequential loop iterations

    Hi all

    I have a code that came out our power (DSP) of a FFT spectral density. An input frequency and then intervened at a value of input from the user. I would like to know the difference of the PSD between each stage of the frequency. Attached, that's what I would get. To avoid confusion, I don't want to produce a file that looks like this. I want just the column 'delta' as an indicator on the front panel, so I can control my change in PSD. I don't need the entire table, just the delta between the current iteration and the previous iteration. I tried to use a loop with shift registers, but I'm not sure where to go to from there. I thought that, since the shift registers sends the data of loop to loop, that I could output the value before it went into the next iteration, but I don't have a chance. Any help is appreciated. Unfortunately, I am unable to put the code due to the policy of the company. I know it makes things much more difficult.

    Thank you.

    Suggestions do not seem quite right, but I found a way to do it. Attached, is the way that I did.

  • The rehabilitation of the iterations of the loop to 0

    I need help resetting my iterations of the loop back to 0.  Most of the time it works very well but has a bug.  Some background on what I'm trying to do.  Basically, I'm ordering a motor with a brake on the subject.  On the brake, there is a manual replacement option that I follow with a proximity sensor.  If the magnetic field is broken, it will stop the VI with the iteration, that he stopped.  When I press the Start button, the iteration continues. The VI stops when equal iterations # Set value witness of Cycles.  I tried the reset of the iteration option to 0 if I wanted at any time, so I put a reset button in the VI.  It works very well with the one bug. This bug is that if for some reason, the number of iterations is higher than the Set # the number of Cycles, the VI will continue to operate.  This is where I need help, because I don't know how to go about it other that pretend by setting the threshold min by a large number, forcing the operator to reset the counter.  Is attached to a peg of the area of the code.  Any help or suggestions are greatly appreciated.  Thank you!

    swins wrote:

    The LabView run VI put the button in a State of "rest" and does not run until I press the Start button.  Thanks for the reply.

    Many people write their programs as they come out of the main loop when the program is finished. Then they on the LabVIEW run button to run the application again. Worse still, they have no main loop and push the button of continuous running. Both are wrong and the latter much more.

    Sorry, I assumed you were doing that, but without seeing more code, I could only guess.

    Changing the equals or is more than one stage of debugging. What is the loop that you want continue to run or just the rest of your application? If the loop continues to run then the output of the speaker or is always false, which means that the output of equal to is never true.

    You put sensors on the exit of the tunnel connected to the Terminal to stop loop and register iterations to offset? Also to put sensors on the three terminals of equal to and activate execution of climax.

  • Update of unique value in the loop voltage output?

    Hello

    I'm trying to use the DAQmxWriteAnalogScalarF64 function to produce a voltage constant and regular say 3V.  The program will be in a loop, and after each iteration, I would that the output voltage be increased to say 0.1V.

    So, a shortened version of my program looks like this

    float64 value = 3;

    DAQmxCreateTask

    DAQmxCreateVoltageChan

    DAQmxWriteAnalogScalarF64 (TaskHandle taskHandle, bool32 autoStart, float64, float64 value, timeout, bool32 * reserved);

    Loop

    {

    DAQmxStartTask

    DAQmxStopTask

    }

    Now of course who does not help me update the output voltage after each loop.  So I tried something like this:

    Loop

    {

    DAQmxWriteAnalogScalarF64 (TaskHandle taskHandle, bool32 autoStart, float64, float64 value, timeout, bool32 * reserved);

    DAQmxStartTask

    DAQmxStopTask

    value = value + 0.1;

    }

    My computer would crash when I try to run the program.   I have to erase and create the task in each iteration too?

    I try to avoid using the DAQmxWriteAnalogF64 function, because I need to use a sample clock in time, he and my sample clock is used for the other channel of analog output.

    Thanks for any input.

    Howard

    aNItaB,

    I tried to call the DAQmxWriteAnalogScalarF64 in a loop and freeze my computer completely and I have to restart it by pressing the Start button.

    Then, I tried to use the DAQmxWriteAnalogF64 in a loop, specifying the output as an array of one element array, and then to update an element at the beginning of each loop.  This seemed to have solved my problem for now without any computer breaks down.

    A strange thing happened was when I took your suggestion and took the StartTask and StopTask out of the loop, the computer crash problem appeared again.

    in any case, I think that my problem has been resolved, thank you very much for your responses timely and sincere help.

    Howard

  • 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 can I get my Teststand report to display only the data of the latest iteration of a loop DoWhile ONLY stage?

    Good so I a DoWhile loop with a numeric value to test.  The loop will run 10 times.  I want only the status of success/failure of the test of the numerical value of the last iteration of the loop is displayed in the report.  I don't like on the other iterations.  Help, please!  Thanks in advance I think that this can be accomplished with the recall of ModifyReportEntry and fancy logic...

    Thanks for your comments everyone.  I ended up changing the reportgen_txt.seq to identify during my test was in a loop (by setting an additional result in the different stages of my comment loop-step to say "Record last loop.".)  Once this indicator lies in the ResultList I turn to reportgen_txt, I have to loop through all the ResultList entries and if the current entry has the same name and the "record last of loop." as a previous entry, I delete the previous entry and store the current.  All this way, I have to do is to set a flag in my test sequence, and if when debugging, I want to see all the data for all the iterations, I just remove the flag.

    The reportgen_txt.seq include:

    C:\Program NIUninstaller Instruments\TestStand 2010\Components\Models\TestStandModels

    I'm not worried about the time constants on my generation of report and I am not limited to stress strict memory so this seemed like the best way for me to do what I had accomplished.  I'm sure there are better ways, but it seemed simpler than the generation of report definition to be disabled and then enabled...

  • Output of MatlabScript in the matter of the loop

    Hello everyone, but long time reader first time poster, and I was wondering if I could get help to a little problem here, or... Well, more like a question and not a problem.

    I don't download the .vi because I don't think it will be necessary, in addition, ignore the rest of the image (I just play with image processing like I taught him) and go to the location of the matlab script.

    My goal is to represent the image (taken from image data) bit and in the end, it must look like to... a table of 8 columns and all the lines she might need (can't see all of the lines of course) so it will look like a matrix.

    For example, it should look a bit like this on the user Panel
    | 1. 0 | 1. 1. 0 | 1. 0 | 1. (first 8 bit value)

    | 1. 0 | 1. 1. 1. 0 | 1. 0 | (8-bit second value)

    etc...

    So for that, I use the matlab de2bi function and the release of this part is where my problem is, im putting out 8 columns representing each number comes from the image and well, im confused as to what is going out of the matlab function and the loop, as you can see in the picture I have uploaded, I put a flag in the output of 'bin '. , was automatically called Real, inside the loop and the other digital, outdoors, also, I disabled the index of the tunnel in this output. (if I activate the index, it comes out as a table)

    I thought that Real and Numeric to be showing the same thing, but when I run it, which doesn't seem to be the case, you Real shows the 1 and 0 (I guess it shows the 8 bits because it shows figures but I saw in the matlab command window and there are 8 bits stored in 'bin') and digital remains just at 0 its almost as if nothing were happening out of the loop, and because I'm not sure what it is falling I can't really find a way to show the bits as in the example, I said before.

    Read the help of de2bi, it is said that his exit is a matrix if the input is a vector, but I don't think it's a vector since due to the loop, it takes value by value, then it must go to the default (in binary) value too...

    Thanks for the help in advance, in addition, whether something else to better understand my problem please say so and I will do my best to make it easier to understand.

    I don't know why you're so obsessed on matlab, LabVIEW can do all this much simpler directly. Here's a possible solution. (LabVIEW 8.5. For other possible outputs you could reverse the Boolean array, so modify them.).

    (Your main mistake under matlab is that your output of matlab is defined as a scalar value, then it should be a vector. Your tunnel to exit of the matlab node has the wrong data type.)

Maybe you are looking for