How to output data outtside a for loop every 10 iterations​?

Hi friends,
does any body help me to sort out this problem?
please check the attchement for my vi.
all i want is output data from inside for loop to outside for loop every 10 iterations. please do not use local variable.
Many thanks
dan
Attachments:
output.vi ‏16 KB

Hi Dan,
I am not sure what you want to do every 10 iterations with the value outside, but If you want to update your graph every 10 iterations use the following way:
If you want to handle the specific value every x iterations outside the loop you could either use queues or notifieres.
BR,
ThSa
Message Edited by ThSa on 08-23-2006 09:05 PM
http://www.newgistics.com
Attachments:
1.png ‏6 KB

Similar Messages

  • How to output data to a file in SCC-SG04?

    I am using SCC-2345 with SCC-SG04 connected to NI-6221 in Windows 2000 in VC6.
    How to output data to a file like data1.dat in VC6 or in Labwindows/CVI?

    Hello mwibm,
    If you just want to do file input/output in LabWindows/CVI, I would take a look at the Formatting and I/O CVI library or the ANSI File I/O functions. For example, if you just want to write an array of data to a file, I would look at the ArrayToFile function or the fwrite/fputs/fprintf ANSI C functions included in stdio.h. The ANSI C functions will also work in Visual Studio. More information on the LabWindows/CVI File I/O functions can be found in CVI help, and more information on ANSI C functions can be found in CVI Help and online at various websites.
    Maybe you could further clarify what problems you are having and what kind of data you want to write to a file.
    Thanks.
    Wendy L
    LabWindows/CVI Developer Newsletter - ni.com/cvinews

  • Indexing data on a for loop to overlay data on a xy graph

    I am using express VI's to measure both voltage and current data in a For Loop. I want to plot a current vs voltage graph but have each iteration of the loop overlay the others as if it were its own independent data set. I have been unable to bundle the data and convert it into a xy graph because of the number of elements, 3 for the bundle and 2 for the graph. I need a method to index the dynamic data wires so that I can overlay them.

    Hello,
    After reading the thread, it sounds like you're looking for a chart-like graph - I have attached an example with illustrates this.  Keep in mind that "graphs" in LabVIEW generally plot arrays of data (in the case of an XY graph, you pass a cluster which contains an X and Y array).  The example behaves like a chart by building an array one data point at a time (in this case both an X and Y array of course) on each iteration of a loop, and displaying the data at each loop iteration - this gives the look and feel of a chart which accumulates data.  It is attached in version 7.1 - hopefully you have that version or later to open it.  I have also attached a program which shows how to plot multiple data sets on an XY graph, in all 3 current formats accepted by the XY graph - it's attached in version 8.0 because the ability to plot complex data to an XY graph was added to version 8.0, and it illustrates this as well.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear
    Attachments:
    XY Chart-like Example.vi ‏24 KB
    XYGraphWithArbitrarilyManyPlots.vi ‏32 KB

  • How to let " i " of a for loop to start from a "X"

    Hi,
    how to let " i " of a for loop to start from a value "x" where x is a variable?
    Thx
    Message Edited by starfish on 10-19-2007 06:00 AM

    Hi starfish,
    use it like this:
    If this doesn't fit your needs you should attach an example of what you really need!
    Message Edited by GerdW on 10-19-2007 01:15 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    I.png ‏2 KB

  • How to defined data carrier valued for Linux?

    Hi,
    I am Defining Data Carrier. But I don't understand "Data carrier type" value. Is this PC value data carrier type  for window? So If I want to define value data carrier for Linux. How to defined data carrier valued for Linux?
    Please advise,
    Duypm

    Hi Nikita,
    Refer the below mentioned links for your requirement.
    http://forums.sdn.sap.com/thread.jspa?threadID=412923
    http://forums.sdn.sap.com/thread.jspa?threadID=1639500
    Both have good guidelines on coding as well as configuration part.
    Regards,
    Deepak Kori

  • Please help me.. how to rewrite the following java- for loop code in ada

    int i, j, n = 100;
    for (i = 0, j = 17; i < n; i++, j-- )
    sum += i * j + 3;

    how to rewrite the following java- for loop code in ada
    You should have a programming manual for Ada first. If you mean it the other way round, I think you subject line confused me.

  • How to stop and start a for loop

    I've got code and a for loop running in a while loop.  What I need to do is simply pause the operation of the for loop until an requirement is met, and but maintain its iteration position throughout each pause interval (not necessarily timed, just paused until the next requirement is met).  I've tried wiring a boolean to the "continue if true" terminal of the for loop, but the iteration count restarts to 0 when the loop is started again.  Is there a way to stop the for loop, and continue at the particular iteration it is at?
    Solved!
    Go to Solution.

    Breakpoints, whether normal or conditional, are just meant for debugging of your code.  I had the sense from your question that the pausing you want to do is a part of normal operation of your code.  I would NOT recommend using a breakpoint for that situation.  It would bring up the block diagram showing the breakpoint when it occurs.  A user besides the programmer would not know what to do in that case.
     Yes, both the inner and outer loops would have shift registers.
    Putting a case structure with a small while loop inside the "Pausing Case" is doable.  It just depends on what you are doing or waiting for while the program operation is "paused".

  • How to output data when converting labview vi into matlab mex functions

    Hi,
    I am a fairly new user to labview and am currently working on labview
    7.1. I have created a labview vi which can extract data from ni daq
    6070e in real time. The problem is that this code has to be converted
    so that it can be used with matlab.in order to do that i am using math
    interactive tool kit which converts the labview code into mex files
    which can then be used in matlab. Unfortunately i have not been able to
    figure out how to output this data so that it can be processed in
    matlab easily. i cannot afford any loss of information and all the
    output must happen in real time. the o/p must take place after the fft
    has been done. i am attaching the vi for convenience.There are 10
    broken wires ,and this is the place where i want the o/p to be
    generated.
    Also do let me know if this vi can be further improved.
    Regards
    Attachments:
    RT_loop2ver4_working.zip ‏642 KB

    Manuj,
    You seem to have misunderstood the way in which LabVIEW processes data.  The code that you have produced will run in exactly the same way without the need for the case structure.
    The code does not actually run the data from the previous case. It is merely processing data from the previous loop iteration, regardless of the case. If you were to remove the case structure, leaving only one copy of the code intact, and remove the toggle switch you have produced, or used the shift register which, I assure you would have worked, then you will have exactly the same functionality.
    I have attached an example that uses the shift register to toggle cases, but also iterates that the case structure is not needed by using the same feedback node (and code) without a toggle switch or case structure.
    Hope this helps you optimize your code
    Regards
    AdamB
    Applications Engineer
    National Instruments UK
    Applications Engineering Team Leader | National Instruments | UK & Ireland
    Attachments:
    CASE_NO-CASE_Example.vi ‏24 KB

  • I'm having problems manipulating array data within a for loop, and extracting the required sub-arrays generated.

    Hi,
    I'm using labVIEW V5.1
    I'm trying to generate 10 1D arrays, the first array is initialized to all zeroes, then I have set up a for loop which shifts the first element by 1, then a random number is placed into the first element position. I am using a shift register to feed back in the newly generated array into the start of the loop.
    By the end of the each loop I want to be able to use the array generated in an algorithm outside the loop. However I only want the Nx1 array that has just been generated.
    Unfortunately, I cannot figure out how to resize, reshape or index the output array to do this.
    I would like the loop to
    give me out a 1D array after each iteration.
    Any help would be greatly appreciated.

    I hope I've understood your problem.
    First your vi was lacking of the sub-vi working as shift register, I've replaced it with the rotate function.
    The indexing of your arrays create a 2D array whose rows are your 1D array.To pick only one of them you have to use the index array function and select which one you want.
    To use your temporary data in another part of your application you should use a local variable of array2.
    I did it in a separated while loop That I syncronized with the for loop using occurrence, in this way the while loop runs each time a new value is inserted in array2 (each loop of the for loop structure).
    If you don't need this syncronization just get rid of occurrence functions.
    I place a delay in the for loop to show what happens when running.
    Hope it was helpful.
    Alberto Locatelli
    Attachments:
    array_test_v3.vi ‏35 KB

  • How to avoid data selection inside the loop?

    Hello Experts,
    I am working on one performance item and I have already applied some changes to the original version.
    Now, If I compare my new program with old program, I have good improvement in performance. I am checking if I can do anything on statements that are top on the below list. I think 40% for Modify statement is acceptable after my research (Below run is updating around 20M records which is real time volume for this application).
    As we can see 34% of run time to going for one SELECT query on custom table. Take a look at below high level flow of my program to understand above select query.
    1. Select data from ZABC
    2. Select data from Variant Table (Var1, Var2, Var3 etc.., 12 in real time)
    3. Loop Variant Table
    4. Select data from X, Y, Z table for Var<n>.
    5. Populate final internal table from ZABC, X, Y and Z table
    6. Modify ZTABLE with Final Internal table data
    7. End Loop on Variant Table
    As described in the flow of the program, ZABC table data is common for all the variants and need not to fetch multiple times. Hence I am doing it only once in my program. Below is that select query:
    select rrcty ryear rbukrs racct rcntr sum( amt1) as amt1  "Like I have 32 amount fields in original query
               from zabc
                into table i_zabc
                where ryear in r_year    " Two records in ranges with I and EQ
                and rvers = '001'
                and rrcty in r_rrcty        "Three records in ranges with I and EQ
                and rldnr = 'DT'
                group by rrcty ryear rbukrs racct rcntr
                order by rrcty ryear rbukrs racct rcntr.
    ZABC table is again having huge volume of data and we are fetching millions of records with above query. That is primary reason to take long time. May be that is okay as I am already using Indexes of this table. But, I am not comfortable with it as it can reach max. memory point and through run time error. Fetch Cursor is one reliable option that I can see here, but with that, I should move ZABC selection inside the variant loop which can cause fetching ZABC data 12 times (Let me know If I am missing anything here).
    Now, third statement in my trace results, with 10% of overall time is this:
    loop at i_abc assigning <fs_abc>. 
    loop at i_table assigning <fs_table> where low <= <fs_abc>-racct and high >= <fs_abc>-racct. 
    endloop. 
    endloop. 
    6 million executions with this complex WHERE condition is causing this statement to get 3rd position in trace results. I tried below two options which are, I think, taking even more time - (I am still monitoring these options)
    1) Removed WHERE condition on LOW, HIGH and applied filter inside the loop.
    2) Removed WHERE condition on HIGH only and applied filter inside the loop.
    Any suggestions on how to proceed with ZABC selection and I_TABLE loop.
    Let me know if you have any questions on above compose.

    Since I looked at this case before, let me try some quick suggestions:
    Is table ZABC related to table X, Y and/or Z and can the selection be limited by applying those 12 selection variants?
    If yes, try a join select involving these tables that could make your step 1 obsolete and replace steps 4 and 5.
    This might also get rid of the "loop inside loop" problem. Generally, make sure that the inner table is declared as a sorted table with a key that consists of the fields as used in the WHERE-condition of the inner loop. Use secondary keys for internal tables if your ABAP release permits and the task at hand warrants it.
    Finally, look at PACKAGE SIZE option for the (join) select to reduce memory consumption.
    Thomas

  • How to check two contitions in for loop

    Hello all
    Here I am having a for loop where I am reading from a cursor and I want to run this loop
    till the number in :P102_NO
    FOR emp_rec in emp_cur and i in 1 to :P102_NO loop
    insert into EMP(EMP_ID,DEATH_DATE) values(emp_rec.emp_id,:P102_DATE)
    end loop;
    but it is showing a error:
    ORA-06550: line 5, column 24: PLS-00103: Encountered the symbol "AND" when expecting one of the following: . ( * @ % & - + / at loop mod remainder rem .. || multiset
    do anybody have any idea about it?
    Thanks
    Tauceef

    Tauceef wrote:
    Hello all
    Here I am having a for loop where I am reading from a cursor and I want to run this loop
    till the number in :P102_NO
    FOR emp_rec in emp_cur and i in 1 to :P102_NO loop
    insert into EMP(EMP_ID,DEATH_DATE) values(emp_rec.emp_id,:P102_DATE)
    end loop;
    but it is showing a error:
    ORA-06550: line 5, column 24: PLS-00103: Encountered the symbol "AND" when expecting one of the following: . ( * @ % & - + / at loop mod remainder rem .. || multiset
    do anybody have any idea about it?
    Thanks
    TauceefYou would need 2 loops, but the ideal way to do this would be in a single SQL statement... no loops, no cursors.
    FOR emp_rec in emp_cur
    LOOP
       FOR i in 1 to :P102_NO
       LOOP
          <stuff and or things>
       END LOOP;
    END LOOP;However you aren't making reference to your variable (i) anywhere ... so what exactly are you trying to do?
    How about you show us your cursor, the data you have ... and the data you want when whatever the heck you're trying to do 'works'. We'll be in a much better-er position to help you in that case.

  • Hi, I would like to ask about how to capture data from real time loop.

    Hi,
    Here is some overvier of my project:
    I have done real time control using labview 9.0. I used PID controller.
    In order to optimise this controller, I need to capture data from my sensor(input) and actuator (output).
    1. For example while real time control is running. I need to capture 1000 sample data (sensor(input) and actuator (output)).
    Then I will used these data for PID optimisation on the other loop without intefere my real time loop.
    2. When PID optimisation is completed, I will sent its PID parameter to real time control loop.
    3. These operation is done in parallel.
    Anybody can help me to solve these. Your idea may solve my problem.
    TQ

    Typically you will have to use RT FIFO or Queue communication to avoid any impact to your time critical loop.
    Best regards
    Christian

  • How do I use an enhanced for loop / for each on my ViewObjectImpl ?

    Guys and Gals,
    With all of my newly acquired Java knowledge in tow, I spent this weekend cleaning up all of my code, dealing mainly with for loops. I converted them from a huge mess to a for each type loop using language such as ...
        RowSet priceUpdateRows = (RowSet)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
        for (Row priceUpdateRow: priceUpdateRows)
        { // do operations on row... which makes perfect sense to me. For each Row in the RowSet, do something. It doesn't, however, makes sense to the compiler. It pouts and gives me a "foreach not applicable to expression type" error. So I read up on iterators and such, messed with code examples, and still can't get the RowSet to iterate with the above code. Could I make RowSet implement Iterable? How would I do that? I tried to create a class called RowSetExt which extended RowSet and implemented Iterable, but then I got a class cast exception.
    I know I could implement something like the following or a while(hasNext()) but they're really not what I'm looking for.
    ViewObject vo = … < Get ViewObject > …
    RowSetIterator rsi = vo.createRowSetIterator("rowsRSI");
    while (rsi.hasNext())
         Row row = rsi.next();
         row.setAttribute("YourAttribute",your_value);
         rsi.closeRowSetIterator();How do I make the for(Row row : <RowSet>) example work? Or could someone point me in a direction?
    Will

    One thing I tried was to make a framework extension class for my ViewObjectImpls
    public class PcsViewObjectImpl
      extends ViewObjectImpl
      implements Iterable<Row>
      Set<Row> set = new HashSet<Row>();
      public Iterator<Row> getRows()
        return set.iterator();
      public Iterator<Row> iterator()
        return getRows();
    }AppModuleImpl
        PriceUpdateRowsViewRowImpl priceUpdateRows = (PriceUpdateRowsViewRowImpl)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
        for (Row priceUpdateRow: priceUpdateRows)
        {However, this gives me a class cast exception at runtime. But I would think some kind of extension class would be the way to go ... ?

  • How to pass parameter into cursor for loop ?

    Hi Experts,
    I want to pass parameter l_bom_header_tbl(i).assembly_item_name into the for statement below How to achieve this?
    for j in 1 .. l_bom_components_tbl.COUNT LOOP
    Thanks

    Maybe i failed to describe in detail,so here i go:
    I have two for loops:
    for i in 1 .. l_bom_header_tbl.COUNT LOOP --1st For Loop
    V_bom_header_tbl.organization_code :='DSC';
    V_bom_header_tbl.assembly_item_name:= l_bom_header_tbl(i).assembly_item_name ;
    k:=1;
    I want to pass parameter l_bom_header_tbl(i).assembly_item_name into the for statement below: How to achieve this?
    for j in 1 .. l_bom_components_tbl.COUNT LOOP *2nd For Loop*
    v_bom_components_tbl(k).Assembly_Item_name := l_bom_header_tbl(i).assembly_item_name ;
    k := k + 1;
    end LOOP;
    end loop;
    end;
    I want to pass a paramter into second for loop in such a way that it accepts from the first for loop
    for j in 1 .. l_bom_components_tbl.COUNT LOOP -2nd loop
    Edited by: ILovePlSql on Mar 22, 2010 12:25 PM

  • How to maintain counter in a for loop

    Hi, 
      How do we track counter in a loop?Isn't it the way I implemented.? Please suggest.
    Regards.
    Solved!
    Go to Solution.
    Attachments:
    for loop counter.jpg ‏219 KB

    Both loops have errors, if you try to do for(i=60;i<120;i++) you're only running 60 loops, not 120.
    You should also disable the autoindexing on incoming arrays as you want some split array indexes (actually you can optimize it by extracting the constant a[30] before the 1st loop and the opposite on the 2nd. Now you're extracting 2 numbers from a 1D array instead of 1 from a 2D array ...
    The number on the select/sum function should be integers, no need to calculate doubles.
    The small array to sum it up is only max 170 numbers, it's ok although a sum in a shift register would be better.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

Maybe you are looking for

  • Air has sound but no picture

    I have a new iMac and apple tv. When trying to use airplay to mirror video using safari on my iMac to apple tv, alI get is sound but no picture. Can I get the picture??

  • How do you add repetitive event a few days per week

    I want to add a weekly event from monday to friday except on wedneday. How can I do that? thanks in advance

  • Aperture 3.1.3 and iPhoto sync problems

        Upgraded to Aperture 3.1.3. Then upgraded to Lion. Tried to sync my iPhone and it got as far as photo's and got a -50 Sync error. Went to iTunes and turned off photo sync and the phone syn'd perfectly. Went back to iTunes turned photo sync back o

  • Is it possible to use AAMEE for Lightroom 4?

    I'm trying to find a better solution to installing Lightroom 4 in a computer lab (30 stations). Right now I need to manually enter the serial number and Adobe ID on each station to activate. Then I have to move that license file to the main library (

  • Delete Access Issue for a Provisioned Resource in OIM..

    Thank you for the help provided for revoking the resource.I am able to revoke the resource from the User profile details. But I have to revoke the resource from the delete access in the same way as I have done for add access for provisioning a resour