Truncating an array within a for loop

I'm currently working with a program that builds an array of 3000*N real numbers, where N is a control that I specify. I want to pass this array into a for loop that runs N times, each time splitting the first 3000 numbers of the array. So, in other words I want the for loop to execute enough times such that the initial array will be completely divided into groups of 3000 when I'm finished. Later I'll be finding the maximum value of all of these subarrays and taking the average of those. What I tried first is to pass the array into the for loop, then truncate it at index = 3000, but the problem is that I can't hard code the loop to do this N times. Any advice or other methods you'd recommend for doing this?
Thanks.
Message Edited by Robtn on 03-05-2010 03:17 PM

Mark--I don't think I can use that approach. Let me be more specific on what the problem is:
Our "big program" is a giant while loop that constantly reads in voltage values from a DAQ assistant.
It has two modes, the first of which I'm having a lot of trouble with. This mode uses a for loop (N = 3000) nested within the giant while loop.
When the for loop activates, the DAQ assistant takes reads 300 samples for every iteration and takes the maximum of those 300 values. It then builds an array composed of all the maxima. After the for loop has executed 3000 times, a case structure activates, which then finds the maximum of the array of maxima.
I want this (N=3000) for loop to execute an arbitrary number of times, a number that I will specify. Each of those times it should generate a completely seperate array of maxima. So, if I want the for loop to run 5 times, I want 5 different arrays.
My approach for doing this was to change N=3000 to say N = 15000, then split up the resulting array 5 times. So, I need an entirely separate for loop that reads in this array of 15000 maxima on its own and splits it 5 ways. I think what you're suggesting is to use a for loop outside of the N=3000 loop, which is a good idea in theory, but experience has shown that this will not generate 5 separate arrays. It will actually concatenate each array into one, hence the problem we currently have.
Yik--I won't have access to Labview over the weekend. Is it possible to take a screenshot and post it, or maybe a short description?
Thank you for the responses.

Similar Messages

  • How do I set a variable within a 'for' loop grid array

    I'm afraid I'm stuck again!
    The next stage in the animation that I'm working on,  is to set up a boolean, 'drilled = false', so that all instances of the attachMovie ('openCircle') have a boolean 'drilled = false' associated with them. Then when someone clicks on one of the instances of the attachMovie ('openCircle'), the boolean becomes 'drilled = true', but only for that instance that has been clicked.
    What I've done is to set the variable (boolean)(highlighted in bold below) within both 'for' loops within the grid array, but it just returns an undefined value. Do I need to setup a separate array? (see code below):-
    //set up grid for solid array
    var spacing:Number = 5.75;
    var cols:Number = 20; // number of columns in grid
    var rows:Number = 20; // number of rows in grid
    var leftMargin:Number = 154;
    var topMargin:Number = 169;
    var depth:Number = 100; // starting point for depth
    var drilled:Boolean;
    for (i=1; i<=rows; i++) {                                                                                                         
    for (j=1; j<=cols; j++) {                                                                                                                              
              drilled[rows,cols]=false;
                        trace(drilled);
              current = attachMovie("openCircle_mc", "openCircle_mc"+i+"_"+j, depth++);
              current._x = leftMargin + ((i-1) * (spacing + current._width));
              current._y = topMargin + ((j-1) * (spacing + current._height));
              current.row=i;
              current.col=j;
    //          current.oil = Math.floor(Math.random()*1.1);  // about 1/10 objects have oil=1, 9/10 oil=0
              //open circle initially invisible, visible on rollOver
              current._alpha = 0;
              current.onRelease=function(){
                        trace(this.row+" "+this.col);
       current.drilled = true;
              current.onRollOver = function() {
                                     this._alpha = 100;
              current.onRollOut = function() {
                                     this._alpha = 0;
    I'd be grateful for any help. Thanks.

    I'm sorry for asking this question again, but I really need to have the 'drilled' variable to be available at all times outside the openCircle_mc, so if I can set up the 'drilled' variable as an array that would be good. Below is the code that isn't working:
    /*  set all values of 'drilled' to false  */
    var col:Number = 20; // number of columns in grid
    var row:Number = 20; // number of rows in grid
    for (g=1; g<=row; g++) {
              for (h=1; h<=col; h++){
                          drilled[g,h] = false;
    Very many thanks

  • Reading a csv file within a for loop

    Hi guys,
    Im trying to read a csv file within a for loop and the while loop only seems to be getting executed once rather than the number of times that is specified.
    for(int i=0; i<paramValues.length;i++)
    String StudentNo = paramValues4;
    out.println("StudentNo="+StudentNo);
    BufferedReader in = new BufferedReader( new InputStreamReader( conn2.getInputStream()));
    String readLine;     // stores a line from the file as a string//used to get rid of the first line which has course name
                                                      readLine = in.readLine();
                                                                     int NumberOfElementsInArray=16;
                                                           String[] data;
                                                                     data = new String[NumberOfElementsInArray];
                                                                     data[0]=> StudentNo
                                                                     data[1]=> Surname
                                                                     data[2]=> Firstname
                                                                     data[3]=> ExamNo
                                                                     data[4]=> YrOfStdy
                                                                     data[5]=> ProgOfStdy
                                                                     data[6]=> Fld1
                                                                     data[7]=> Fld2
                                                                     data[8]=> DegType
                                                                     data[9]=> EnrolStatus
                                                                     data[10]=> StaffAdvNo
                                                                     data[11]=> Tutor
                                                                     data[12]=> Fld3
                                                                     data[13]=> Fld4
                                                                     data[14]=> Fld5
                                                                     data[15]=> Pegged
                                                                     data[16]                                                            
                                                                     //out.println("<table border=\"1\">");
                                                                     int datanumber=0;
                                                                     while( (readLine = in.readLine()) != null )     
                                                                          out.println("ive entered the loop");                                                       
                                                                          StringTokenizer tokens = new StringTokenizer( readLine, ",", true);                    
                                                                          boolean prevTokenComma = true;
                                                                          boolean emptyValue = false;
                                                                          String aValue = null;
                                                                          datanumber=0;                                                                      
                                                                          while( tokens.hasMoreTokens() )          
                                                                               aValue = null;
                                                                               String token = tokens.nextToken();
                                                                               token=token.trim();
                                                                               //if the token does not equal to a comma
                                                                               if( !token.equals(",") )               
                                                                                    aValue = token;                    
                                                                                    prevTokenComma = false;                    
                                                                                    emptyValue = false;     
                                                                               else if( token.equals(",") && prevTokenComma )               
                                                                                    prevTokenComma = true;                    
                                                                                    emptyValue = true;               
                                                                               else //( token.equals(",") && !prevTokenComma )               
                                                                                    prevTokenComma = true;                    
                                                                                    emptyValue = false;
                                                                               if(emptyValue)
                                                                                    aValue = "";
                                                                               // Printing values
                                                                               if( aValue == null)
                                                                                    //do nothing
                                                                               else if (aValue.equals("") )
                                                                                    aValue="&nbsp";
                                                                                    data[datanumber]=aValue;
                                                                                    //out.println("datanumber="+datanumber);
                                                                                    //out.println("<td> aValue: "+aValue+"</td>");
                                                                                    datanumber++;
                                                                               else
                                                                                    data[datanumber]=aValue;
                                                                                    //out.println("<td> aValue: "+aValue+"</td>");
                                                                                    //out.println(datanumber);
                                                                                    datanumber++;                                                                                
                                                                          out.println("data[0]="+data[0]);
                                                                          //out.println("data[3]="+data[3]);
                                                                          //out.println("ExamNo="+ExamNo);
                                                                     }//end while
                                                                     in.close();
    }//end for loop
    When I print the variable student no at the beginning of the for loop it prints the different studentno's so the for loop is fine, but the while loop gets executed once. Does anyone know why????????/
    Thanks
    Tzaf

    PROBLEM SOLVED....
    Basically the following declarations have been done within the for loop....
    URL url2 = new URL ("http://localhost:8080/FYP/CSVFILES"+Year+"/"+WebCourse2+".csv");
                                                                     URLConnection conn2 = url2.openConnection();
                                                                     HttpURLConnection uc = (HttpURLConnection)conn2;
                                                                     uc.connect();
                                                                     try
                                                                          responseCode = uc.getResponseCode();
                                                                          out.println("Response code1: " + responseCode+"\n");
                                                                     catch(IOException e)
                                                                          responseCode = uc.getResponseCode();
                                                                          //out.println("Response code2: " + responseCode+"\n");
    thanks
    anyway
    tzaf

  • Transposing data in an array using a For Loop

    I am trying to transpose some data in an array using a  for loop starting from the size of the array then decrement down to 0. Can someone please help if you have an example?
    Solved!
    Go to Solution.

    I feel as if reverse 1D array may help
    Edit: misunderstood what your second post meant.
    CLA, LabVIEW Versions 2010-2013

  • 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

  • Passing an array in a for loop to a procedure

    I am trying to pass an array in a cursor for loop to a procedure which performs a table insert using the array's contents. Somehow I am missing something, or it is not possible. The compile error states: PLS-00306: wrong number or types in call to 'insert_address' I checked to be sure I am creating the arrays in both cases from similar data objects. Both address and work_address_table contain the same 4 columns with the same data types.
    create or replace package work_address as
    FUNCTION populate_address return boolean;
    procedure insert_address(in_address IN work_address_table%ROWTYPE);
    end work_address;
    create or replace package body work_address as
    function populate_address return boolean is
    cursor c1 is
    select 'H' as header,
    street1 as street
    city as city,
    NULL as state
    from address
    where city = 'HANOVER';
    TYPE addressT IS TABLE OF c1%ROWTYPE INDEX BY BINARY_INTEGER;
    rec1 addressT;
    BEGIN
    OPEN c1;
    FETCH c1 BULK COLLECT INTO rec1 LIMIT 500;
    FOR i IN 1..rec1.count LOOP
    rec1(i).state := 'US'
    insert_address(rec1(i));
    exit when c1%notfound;
    END LOOP;
    CLOSE c1;
    return TRUE;
    END populate_address;
    PROCEDURE insert_address(in_address IN work_address_table%ROWTYPE) IS
    BEGIN
    INSERT INTO work_address_table
    VALUES (in_address.header,
    in_address.street,
    in_address.city,
    in_address.state);
    COMMIT;
    END insert_address;
    END work address;
    /

    Both address and work_address_table contain the same 4 columns with the same data types.Are you 100% sure about this?
    SQL> declare
      cursor c1
      is
        select 1 deptno, dummy dname, 'Loc' location from dual;
      type addresst is table of c1%rowtype
        index by binary_integer;
      rec1   addresst;
      procedure p (d dept%rowtype)
      as
      begin
        dbms_output.put_line(d.dname);
      end p;
    begin
      rec1 (1).dname := 'z';
      p (rec1 (1));
    end;
    z
    PL/SQL procedure successfully completed.but changing just the first column of the cursor:
    SQL> declare
      cursor c1
      is
        select 'xy' deptno, dummy dname, 'Loc' location from dual;
      type addresst is table of c1%rowtype
        index by binary_integer;
      rec1   addresst;
      procedure p (d dept%rowtype)
      as
      begin
        dbms_output.put_line(d.dname);
      end p;
    begin
      rec1 (1).dname := 'z';
      p (rec1 (1));
    end;
    Error at line 3
    ORA-06550: line 20, column 3:
    PLS-00306: wrong number or types of arguments in call to 'P'
    ORA-06550: line 20, column 3:
    PL/SQL: Statement ignored

  • Problem cycling through elements of an array using a for loop ~ error 200609?

    Hi,
    I'm outputting a 194-element array from a MATLAB script node into a for loop where the array is indexed then converted into a 8-bit boolean pattern which I'm trying to output using DAQ Assistant. I'm using LabVIEW 8.2 and a PCI 6133 DAQ using a counter(Ctr0InternalOutput) to time the output. The first element of the array goes through the loop perfectly however never makes it's way back through and throws error 200609: Generation cannot be started because the slescted buffer size is too small. Increase the buffer size. After probing the line before DAQ Assistant I confirmed only one element makes it through the loop and then throws this error? I've trying doing the same things with lower lowel DAQmx vi's using a DAQmx configure output buffer vi to override this buffer size problem, but still get the same result(not the error but same data flow problem)? Anybody know what's going on? I've included the vi's I've been working with. Thanks!
    Millie
    Attachments:
    Untitled 22.vi ‏228 KB
    Untitled 34.vi ‏180 KB

    Hi,
    I'm outputting a 194-element array from a MATLAB script node into a for loop where the array is indexed then converted into a 8-bit boolean pattern which I'm trying to output using DAQ Assistant. I'm using LabVIEW 8.2 and a PCI 6133 DAQ using a counter(Ctr0InternalOutput) to time the output. The first element of the array goes through the loop perfectly however never makes it's way back through and throws error 200609: Generation cannot be started because the slescted buffer size is too small. Increase the buffer size. After probing the line before DAQ Assistant I confirmed only one element makes it through the loop and then throws this error? I've trying doing the same things with lower lowel DAQmx vi's using a DAQmx configure output buffer vi to override this buffer size problem, but still get the same result(not the error but same data flow problem)? Anybody know what's going on? I've included the vi's I've been working with. Thanks!
    Millie
    Attachments:
    Untitled 22.vi ‏228 KB
    Untitled 34.vi ‏180 KB

  • How to traverse an array with a for-loop in this certain way...

    so I need to traverse an array starting from the first element, then from the last element, then the second element, then the second last element, then third element and so on... in a for loop
    how would that look in code?
    Any help would be appreciated, thanks!
    Edited by: inspiredone on Apr 4, 2008 6:34 AM

    Wow, that's a really clever and elegant way to do it promethuzz. I actually came up with something already before I read your post so yeah don't worry about me copying or anything. Mine is not as elegant/efficient and I definitely like yours a lot more but I will just share it anyway...it looks pretty similar to the second algorithm The_Matrix has provided. I figured this out from thinking how quicksort compares its pivot with the two indexes...
        int front=0;
        int back = a.length - 1;
        int counter =0;
        boolean switchflag = true;
        while(front<=back)
          System.out.println(a[counter]);
          if(switchflag)
            counter = back;
            front++;
            switchflag = false;
          else
            counter = front;
            back--;
            switchflag = true;
        } Anyways, thanks a lot for you guys help, promethuzz, The_Matrix, and newark.
    Edited by: inspiredone on Apr 4, 2008 11:25 AM
    Edited by: inspiredone on Apr 4, 2008 11:27 AM

  • Is there any point in having an ORDER BY clause within a FOR LOOPs counter?

    DB Version:10.2.0.1.0
    I need to loop through empno's using a FOR loop. But is there any point in having an Order by clause within SQL as shown below. This only degrades the performance because of the unnecessary sorting by the ORDER BY clause. Right?
    begin
    FOR i IN (select empno from emp ORDER BY sal ASC) LOOP 
        curr_stat_id := i.empno +p_gennum;
    .

    First question you should ask to your self is
    "Do i need a FOR LOOP. Cant i do it in a straight SQL"
    If the answer is NO (Which is not in several cases) then the next question is.
    "What is my requirement"
    Having an order by in the Select is totally pertained to your requirement. If your requirement
    says you should loop through the employee based on there salary for lowest to highest then yes you
    need an order by.
    So more than performance point of view its requirement point of you. But if you are more concern about
    performance you will first ask to your self
    "Do i need a FOR LOOP. Cant i do it in a straight SQL"
    Thanks,
    Karthick.

  • Writting exception within cursor for loop

    I have two cursor for loop as
    for rec1 in () loop --loop 1
    for rec2 in () loop --loop2
    <statements>
    end loop;
    end loop
    Now I want to handle exception within my second for loop so that after terminating the loop it will again go to the first loop...
    How to do it ? Please help......

    you may
    BEGIN
       FOR rec1 IN your_select1
       LOOP                                                              --loop 1
          BEGIN
             FOR rec2 IN your_select2
             LOOP                                                         --loop2
                statements;
             END LOOP;
          EXCEPTION
             WHEN OTHERS
             THEN
                log_error;
          END;
       END LOOP;
    END;or ...depending on your exact needs:
    BEGIN
       FOR rec1 IN your_select1
       LOOP                                                              --loop 1
          FOR rec2 IN your_select2
          LOOP
             BEGIN                                                        --loop2
                statements;
             EXCEPTION
                WHEN OTHERS
                THEN
                   log_error;
             END;
          END LOOP;
       END LOOP;
    END;

  • How to output last 4 arrays from a For Loop?

    Hi People,
    I am almost at the end of my tether. I really hope someone could please help me.
    Any input would be welcome. VI attached.
    VI explanation:
    I initialize an array.
    The random number generator simulates my camera input.
    Depending on which iteration it is, the data is added into one of four output arrays.
    'x-y*floor(x/y)' gives a remainder value of 0, 1, 2 or 3.
    'Case Selector' just adds 1 to 'x-y*floor(x/y)' to get case 1, 2, 3 or 4.
    Shots 1, 5, 9 etc are added to Array 1 (Case 1).
    Shots 2, 6, 10 etc are added to Array 2 (Case 2).
    Shots 3, 7, 11 etc are added to Array 3 (Case 3).
    Shots 4, 8, 12 etc are added to Array 4 (Case 4).
    Averaged Output displays the averaged value i.e. the total value divided by the number of shots saved in that array ('Set (IQ+1)').
    My problems are:
    1) I would like to output only the last 4 sets of data from the Averaged Output 1, 2, 3 and 4 to 4 different files (i.e. save as .csv what is displayed onscreen in indicators 'Averaged Output 1', 2, 3 and 4 at the end of all iterations.
    Where should I place my file save diagram disable so that it does this?
    Putting it outside the main For Loop with auto-indexing on gives me one file with all previous data. (This is not feasible as my number of shots should number in the thousands)
    Putting it outside the main For Loop with auto-indexing off gives me only the last set of data. (I need the output for 4 Arrays, not just the last run)
    Putting it inside the main For Loop (as shown) gives me the same number of files as number of iterations. (Again not feasible due to large number of files that will be generated and slow camera capture)
    For the sake of fast camera capture, I would like these 4 files to only output once all the image captures are complete.
    2) Would preferably like to name the file once and for the programme to append '(1)', '(2)', '(3)' and '(4)' to filename of the appropriate 'Averaged Output' Arrays but file path controls are another big headache for me.
    3) P.s. is initializing one array enough to avoid using Memory Manager? Or should I initialize 4 arrays?
    I am using Labview 2010.
    Thanks so much,
    Jaslyn
    Solved!
    Go to Solution.
    Attachments:
    Help Understanding Arrays and file paths (10).vi ‏26 KB

    Thanks so much Lennard!!
    Hi JKSH,
    I've been busy trying to complete the dang code, but for completeness so that other users can learn too, I shall answer your queries. Thanks for looking in.
    First, what do you mean by "add"? Your code in your case strcuture sums your input values, so your array size doesn't change. However, you also said "Putting it outside the main For Loop with auto-indexing on gives me one file with all previous data. (This is not feasible as my number of shots should number in the thousands)" -- it sounds like you are expecting an array with thousands of elements. So, what should "Output Array N" look like?
    Ans: Output Array N should be a 4x4 array of the summation of all the numbers generated during every 4th iteration.
    i.e. if random number 1=1, random number 2=2, etc, And 'No of iterations' is 12,
    Output Array 1 should be 1+5+9:
    15 15 15 15
    15 15 15 15
    15 15 15 15
    15 15 15 15
    (Note: Most of your arrays are 4x4, but in Case #2 you created 128x128. I prersume this is a typo?)
    Ans: Kind of, I'm using a 4x4 array of randomly generated numbers as an example but my actual data will be the 128x128 pixel output of a camera. And during actual experimentation, 'No of Iterations' will number in the thousands.
    Second, why do you add your "simulated camera input" to the "Initialized Array"? You can add it direcly to the previous output inside your case structure.
    Ans: See answer to question 3
    Third, have a look at shift registers: http://www.ni.com/gettingstarted/labviewbasics/shiftregisters.htm. Use them instead of Feedback Nodes to make your code tidier.
    Ans: I did try.. But I can't seem to add shift registers to the case structure, only the for loops outside. Are you sure it can be done..?
    jaslyn wrote:
    1) I would like to output only the last 4 sets of data from the Averaged Output 1, 2, 3 and 4 to 4 different files (i.e. save as .csv what is displayed onscreen in indicators 'Averaged Output 1', 2, 3 and 4 at the end of all iterations.
    Where should I place my file save diagram disable so that it does this?
    For the sake of fast camera capture, I would like these 4 files to only output once all the image captures are complete.
    You will need to call "Write to Text File.vi" 4 times to write 4 files. So, you should finish your loop, then call this VI 4 times.
    Ans: How do I get it to extract the data from each of the 4 cases in my case structure?
    jaslyn wrote:
    2) Would preferably like to name the file once and for the programme to append '(1)', '(2)', '(3)' and '(4)' to filename of the appropriate 'Averaged Output' Arrays but file path controls are another big headache for me.
    You can create strings first, then convert them into paths: http://zone.ni.com/reference/en-XX/help/371361G-01/glang/string_to_path/
    Thanks
    jaslyn wrote:
    3) P.s. is initializing one array enough to avoid using Memory Manager? Or should I initialize 4 arrays?
    I'm not sure what you're asking; can you please clarify what you mean by "avoid using Memory Manager"? But anyway, you've actually initialized FIVE arrays: 1 outside the loop, and 1 inside each case.
    I've read that to avoid fluctuations in memory usage, it is a good idea to initialize arrays to their expected size before the start of data collection. That was just what I was trying to do.

  • Help on changing array elements with For loop

    Hi,
    I'm wondering if anyone can help me with this problem.  I'd like to be able to modify elements of an array with For loop.  In the attached VI, my goal is to have an array of [0 1 2 3 4 5], but instead what I've got is [2 2 2 2 4 5].  I initialized the array with a value of 2 to help me identify which elements are changing.  Can anyone help me pointing where my mistake is?  Thanks.
    Peter
    Attachments:
    Array test.vi ‏19 KB

    It's a classic issue for LV newbies. In this case you HAVE to use a
    shift register otherwise the modifications of previous cicles are lost.
    It's all easier than it's seems, see attached vi.
    bye,
    manga
    Attachments:
    Array test 2.vi ‏19 KB

  • Building an array from a for loop.

    Hi all
    I have a vi which reads from a file and manipulates the data using for loop. I am taking each element and multiplying it with a constant and converting it to I32. I would like to build back to a new array with the new values. I have attached the vi and a sample data file to read from.
    Please suggest if there are any better ways to do this.
    Thank you. 
    Solved!
    Go to Solution.
    Attachments:
    file_read.vi ‏11 KB
    file_read.txt ‏1 KB

    You can multiply the array with the constant and use the array instead of multiplying it with each element.
    The best solution is the one you find it by yourself

  • Creating an array in a 'for' loop (resetting loop count)

    Hi,
    I am trying to integrate an acceleration signal coming from a CRIO analogue input to obtain the speed and then further integrate to get the displacement of a vibration system.
    I understand that in order to perform the integration, an array has to be fed in. My problem is that I could not buffer the signal in a buffer block as I couldn't find any buffer blocks. so I decided to create my an array of data using a 'for' loop. The 'for' loop nests inside a timed loop. The problem that I got stuck at is how to reset the 'for' loop in order to refill the buffer again at every iteration of the outer timed loop.
    I have attached the code if that helps. Note that I am using labview 2013.
    I would be gratefull if someone who had encountered a similar issue before can help me.
    Regards
    Ali
    Solved!
    Go to Solution.
    Attachments:
    acc_test.vi ‏42 KB

    Dear Altenbach,
    Many thanks for your reply.
    I need to make it clear that I have not had enough hands-on with labview, I have only used it for sometime in the past and now I have to in order to perform some active damping on a 50Hz running machine. I must stress the fact that what i find more intuitive to do in a different programming language (matlab or C) is not as straightforward in labview. so please bear with me if my code has basic mistakes .
    All what i am trying to do is obtain the speed and position from an acclerometer signal. unfortunately i dont have a position sensor so i have to measure acceleration then perform time integrations in order to obtain the speed and position respectively. I am using a compact Rio (later in FPGA mode) to take physical measurements of acceleration from the vibratory machine and where i managed to do this bit successfully. when it came to performing the integration, i had to create an array inside my timed loop since i couldn't find a buffer block. I implemented a 'for' loop inside a timed loop in order to build the array. however i got stuck at resetting the count of the 'for' loop in order to refill the array with new values at every new iteration of the outer timed loop. unfortunately, even a sensible answer has been suggested before, i dont seem to have been capable of doing it yet. I really spent all my day trying to figure a way out but not achieved it yet, nevertheless I have learnt many many things by playing around.
    I would be gratefull if you could comment on a possible way of doing what i am trying to do.
    Kind Regards
    Ali

  • Why are date and time strings lost when indexing an array in a for loop

    Hi, 
    I have an application where i'm reformatting data from a spreadsheet for graphical display on a LabVIEW dashboard.
    the original spreadsheet has date and time values in separate columns, and i'm merging them and converting to a timestamp value.  But something's not working.  Does anyone know why the string value is lost when the array indexes into this for loop?
    Attachments:
    failed array index.png ‏142 KB

    Can you attach your VI with some typical values? (e.g. create in indicator on the 2D array, run your VI, then turn the indicator (now containing data) into a diagram constant). Place the FOR loop related code and that diagram constant into a new VI and attach it here.
    How many times does the FOR loop run? Could it be that the last element of each 1D array is an empty string? (unless you put a wait inside the FOR loop, you'll never see the other elements in the probe)
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • Unable to stream videos on macbook pro

        im unable to stream videos on macbook pro. need help

  • My macbook pro keeps crashing, especially when I am using adobe creative suit 6, can anyone help me?

    Anonymous UUID:       E5058B14-03DC-CDC1-5390-8E9CC9AF2934 Thu Jan 23 22:27:23 2014 panic(cpu 0 caller 0xffffff7f87143fac): "GPU Panic: [<None>] 5 3 7f 0 0 0 0 3 : NVRM[0/1:0:0]: Read Error 0x00000100: CFG 0xffffffff 0xffffffff 0xffffffff, BAR0 0xd20

  • Help With Tags

    I have a TagLib which is working perfectly with JSPs,The Tag is <c:chart id="chart1" datasource="#{name.Graph}" type="xyline" is3d="false" background="green" height="50" width="150" legend="false" border="true"> </c:chart>. What i am trying to do is

  • Error message appear when I close my application

    I create an exit button which close my application but alot of error message show after click all these message is can't access selected table x.x the code inside button is  CLEAR EVENTS  thisform.Release() quit

  • Clear-form(no_validate)

    I am using Forms 6i. In my form, I have one button called 'Clear'. In when-button-pressed trigger I have written the code as Clear-form(no_validate). Also I have one more field in which i have written some code in the 'when validate item' trigger(I a