Re-using the same array on the same page later

i am using an array to write values to a text file, is there a way to re-use that same array on the same page... after the values has been writen to a file, clear the values and use it again(no need to re-size it), just use it again....

Thanks. I have a text box that takes a project id and calls a method that gets the data from db and stores it in a vector than i am looping throught the vector and assiging the values to an array and writing each value to a text file. i want to add another text field on there and see if the user wants to pass another project id (passing two) so i have to re-use the arrays again if the text box is not null. don't i need to re-define the arrays again to use them?

Similar Messages

  • How do I store the values in the @D array in the below mentioned VI? Only the last row in the Array is populated with values from the image.

    Hello Guys,
    I am trying to build a sinogram from 180 projection images and I am not able to store the summed values into the array as it is moving the values and then populating all the rows except for the last with ZERO.
    Thanks in advance.
    Attachments:
    sinogram.vi ‏53 KB

    Your loop runs only three times, so all you can possibly populate is 3 rows.
    Typically, you would initialize a shift register with the initialized array, then use replace array subset, feeding the modified array back into the shift register. However, in this case you could just autoindex the 1D array at the output tunnel to build the resulting 2D array.
    Sorry, I am not familiar with sinograms. Do you have a link describing the algorithm?
    LabVIEW Champion . Do more with less code and in less time .

  • How can i save the output array of the invoke node "commands values" into a specific file

    I must save the setup of vi commands'. I use an invoke node called "command value" wich give me an array with the name of the specific command and his value. How can i save this array into a specific file to load it later if o need. Must i change the array format?
    Thank you

    Hi,
    I have attached two VIs.
    The first one "Ecriture fichier tableau" (writer) permits to collect all control's values in an array (dbl) and to save it as .bin file. You had to convert variant type into dbl type. (You can do the same with string type if you wish. You will save datas as .txt file for example)
    The second VI "Lecture tableau fichier" (reader) permits to retrieve all the datas you saved in the file.
    I think this responds to your question.
    Regards,
    Attachments:
    Control values.zip ‏26 KB

  • How can I keep all the previous datas in the same array?

    I have a problem with keeping the previous datas in my array. The problem is when the iteration loop is executed, I have one or two value(s) stored in the array. The second iteration I have either one or two values (depending on the condition) coming out, but it overwrites my previous value. I want to keep all my data in the same array as the loop is executed.PS. I have attached a simple vi along this message. If anyone can help me out with this, I really appreciate for the help.
    Regards,
    Sonny

    If you iterate several times (N > 100) then I would suggest using the Initialize Array outside of the For Loop and then use the Replace Array Subset inside the Loop to populate the array. The reason for this is because the Build Array utility has to locate a new space in memory for the newly concatenated array -- the Replace Array Element utility uses the same memory space.
    If you iterate just a few times with a small array then using the Build Array should be okay.
    Chris_Mitchell
    Product Development Engineer
    Certified LabVIEW Architect

  • Extract arrays according the number of consecutive values

    Hello I would need some help on one problem to search the
    number of consecutive values in an array. I am using Labview 8.1
    First I have a 2D array with 3 columns: Col (A)  Col (B) 
    Col (C). I would like to plot points from Col( B)=f(ColC) at Constant
    value in Column A. The problem is that in Column A the values changes. My
    problem is to extract arrays when the values in column A are the same and when
    the number of values is higher than a number that I can choose. In my case I
    chosse this number by the threshold function on the peak detector.
    Let ‘s take an exemple:
    Col (A)            Col(B)              Col(
    C)
    12                    343                  45
    654                  65                    33                               
    121                  65                    65                   
    18                    31                    45                   
    12                    456                  98       
    787                  361                  787
    121                  156                  123     
    12                    32                    545
    Let ‘s say I want to plot Col(B)=f( Col(C)) at constant value in
    Column A when I have more than 2 constant values in Column A
    The aim would be to have different arrays to plot 2
    different graphs for different constant value in Col( A).
    Col (A)            Col
    (B) Col( C)                        Col (A)            Col(B)              Col(C)
    12                    343                  45                       121                  65                    65       
    12                    456                  98           &          121                  156                  123
    12                    32                    545
     What I do with the VI is:
    1)      sort
     the 2D arrays accordind the values in
    the Col (A) and extract Col(A)
    2)      Search
    the index of elements in Column A when they I do not have consecutive values
    3)      Subtract
    each new indexes indexes 2 by 2: this gives me the number of consecutive values
    in a new array.
    4)      Detect
    the indexes of the peak (number of consecutive values) that I want (in the
    exemple= 2)
    My problem is now to come back in
    the initial array and extract the arrays that has more than n  consecutive values
    (n=2 in the exemple) according to the index found by the peak values.
     I am sure that there is a simpler
    and better way to do this (maybe by a for loop or by using an histogram);
    Thank in advance for the help
    Olivier
    Attachments:
    extract values.vi ‏33 KB

    First, I wanted to thank you, Kumar for the quick answer: 5
    stars for the answer, this is exactly what I was looking for. I would not have
    found it by myself.
    I have an other problem to plot now Col( B)=f (Col( C))
    What I would like to do is plot Col (B)=Col (C) with
    different plots (colour) on a same graph when the value in column A changes.
    I managed to have 2 arrays (thanks to the forum with some
    modifications):
    -One to tell me each first indexes when the value changes
    -One to tell me each last indexes when the values changes
    My idea would be to use theses indexes to split the initial
    array by  a loop when the value in Column
    A changes and then in an other loop  (or
    in the same) connect the XY graph to the build arrays.
    The only problem is that before running Labview I do not
    know how many different values in column A I have so I do not know how many
    arrays will be created when I will try to split the initial array.
    Is someone know if this solution is possible?
    Thank you in advance for the help.
    Olivier

  • Why i get different value when subtractin​g two elements of different arrays then the actual value in a timed loop

    Hi Everyone
    I have a probem in substracting the two elements of two different  1-D arrays. The problem is, I am taking out data from a CCD camera which gives me data in form of 2-D array. So i select 1-D array out of it. Now this CCD output is in a timed loop, hence i am getting data in each loop. I select a perticular array output of the CCD and this is then passed to shift register and in all the loops later on, one of the element of the output array of the CCD is substracted from the same indexed element of the selected array. For reference i have pasted the snap shot of the block diagram. In this snap shot you see three probes. The value at the prob 1 is 232, at probe 2 is 255 and at 3 is 4294967273, where as actually i sould have a value of -23 since i am substacting prob 1 and probe 2 values. Since the value of probe 2 will always remain at 255 as i have fixed it by choosing an array form CCD and i checked the value of probe 1 which never goes above 255 so why do i get this false value here.
    Can you please help me in problem.
    Regards
    Chauhan
    Attachments:
    clip_image0011.gif ‏15 KB

    Your data is U32 (unsigned integer) which does not have negative values. According to unsigned integer math, "negative" results will wrap.
    You need to work in a datatype that is appropriate for what you want to do. How many significant bits do you have in the raw data?
    Message Edited by altenbach on 03-17-2008 11:15 AM
    LabVIEW Champion . Do more with less code and in less time .

  • Replace an array into the array of cluster!! Possible?

    Hello,
    I got a problem with inserting an array I acquired from another vi into the existing array of cluster. My big array contains a cluster of 5 elements (name, value, save, active and position. I want to connect my sub vi ,whose output is an array of number, to the main vi by replacing only the values in the main array. So all values in the main array are acquired from the sub vi but the remaining data stays the same. I also want my main array to look the same too, except the values have changed. I know it sounds quite simple but I don't really know it.
    Thanks in advance
    Solved!
    Go to Solution.
    Attachments:
    vi connection.vi ‏12 KB
    Data_Read (adapted).vi ‏32 KB

    I guess you need something like this. This will replace the values present in the main array with the values obtained from the sub vi.
    Good luck
    The best solution is the one you find it by yourself
    Attachments:
    vi connection.vi ‏8 KB
    Data_Read (adapted).vi ‏26 KB

  • I need to take elements from within 2 nested for loops and place them in an array at the specific row and column that I need.

    I have tried intializing an array and replacing elements by specifying a particular row, and column, but in the end I get an array with only one element replaced, and I suspect that it is because as the for loops are running through their iterations each time the array is re-initializing. I have a simple vi that I will post below, it is not the exact situation that I have but is a good place for me to get some understanding. I have the row and column indexes being driven by the inner and outer loop iterations, which gives me the pattern I need. I am using the inner iterations as array elements. How do I set this up so that it works and d
    oes keep re-initializing my array.
    Attachments:
    Untitled.vi ‏26 KB

    I have fixed a number of things in your vi.
    You were right in thinking that the array was continuously re-initialized. To avoid this, use a shift register (right-click the loop border), which will pass the updated array into the next iteration.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    your_vi.vi.zip ‏13 KB

  • Select X# of variables from array at the furthest possible intervals.

    Ok, I've been working on this one for a while and I'm thinking I'm either missing something really stupidly simply because of it, or I've got my equation wrong still. 
    Basically, what I'm trying to do is select X number of items out of an array.  The only catch is, these items need to be as far apart from each other as possible.  So for example, one time I might have an array with 93 items in it which I need to grab 36 of them, evenly spaced through the array (so the first one would be the first one in the array, and the last one would be the last in the array.
    How would I go about telling the script to grab the correct array values (the most evenly spaced ones), ending up with only the X amount of output values?
    Thanks!
    dgolberg

    Hmm, this is kind of a different perspective than what I was originally thinking, but it might work.  I'll have to test it out, though it would require me running the array twice; the first time picking out the specific ones and splicing them out of the array, the second simply grabbing the remainder.
    To put it a little differently, what I was originally thinking is cycling through an array (this array's length and content varries depending on the input), and would grab the the "masters" out of the array at the set intervals (these intervals are where I'm having the most trouble), and anything it finds matching a set range for the current loop cycle that isn't considered a "master" is placed under the master as a "slave" (or essentially, a duplicate).  Below is an example of one of the loops I'm using (I have 3 nested loops in order to cycle through 3 "dimensions" of values) with my last attempt at this issue (which is only correct in certain ranges rather than all ranges like I need).
    var DF = tA.length / mNum;  //tA.length is the array length, mNum is the number of masters desired from that array.  For example, array length of 100, mNum of 75; DF = 1.333333....
    var master = 0;
    for(var z=range[1];z<range[2]+2;z=z+5) { //Cycles through the array 5 units at a time (to speed up the script)... There are 2 other loops above this using the y and z variables seen in the if statements below.
         for(var i=0;i<tA.length;i++) { //Cycles through the tempArray to find matches to the current cycle of the above loops, +/- 2
               if(tA[i][0] <= x + 2 && tA[i][0] >= x - 2 && tA[i][1] <= y + 2 && tA[i][1] >= y - 2 &&tA[i][2] <= z + 2 && tA[i][2] >= z - 2 && master < 1) { //Checks for a match, and if the master is less than 1, it sets the match as a master.
                   master = master + DF; //Adds the DF (short for Dupe Frequency) to the current master number.
                   outArray.push(tA[i]); //Set the match as a master
              } else if(tA[i][0] <= x + 2 && tA[i][0] >= x - 2 && tA[i][1] <= y + 2 && tA[i][1] >= y - 2 &&tA[i][2] <= z + 2 && tA[i][2] >= z - 2 && master >= 1) { //Checks for a match, and if the master is greater than 1, it sets a duplicate.
                   master = master - 1;
                   outArray[outArray.length-1].push(tA[i][3]); //Set the match's name as a slave under the last master
    Basically, using the code above; I need it to somehow (while cycling through the tA.length loop), figure out how often it should grab either a slave or a master (depending on which there are more of), and then the next X number of matches are either a master or a slave (again, depending on which there are more of).  So, for example, if there are 25 masters, out of 100 total items in the array, it would pick one master, the next 3 matches would be slaves, and then it would pick another master, 3 more slaves, etc. etc.  Where things start getting out of whack is when the intervals start ending up in fractions (say every 1.5 is a slave).  Obviously, you can't grab half of one, so you'd need to do a pattern more like: 1 master, 1 slave, 1 master, 2 slaves, 1 master, 1 slave; etc.
    The part I'm having trouble with is getting a working equation that knows how often to pick the (in the example above) slaves based on this varying pattern, and do so accurately regardless of the array length to master/slave ratio (the above method seems to get further off as the mNum gets closer to the tA.length).
    I guess, more than anything really, I'm just having trouble getting the math to work out right as I'm apparently using the wrong equation in my code.  If anyone has any ideas though, let me know.

  • How to delete the whole array programmatically

    Hello,
    Is it possible to destroy/kill an array programmatically (not delete subset)?  If yes, please tell me how.  THanks in advance.
    Sugento

    Hi Devchander,
    Thank you for your reply.  I'm really surprised.  Are you always working?   By emptying an array, it means LabVIEW still has that particular array in memory, doesn't it? what if I want to completely destroy the array to prevent memory issue?
    I have a PXI-6515, an industrial 24V DIO card, that I used to monitor optical sensors.  I just found out after I hooked it up that the output from DAQmx for DIO is a 1-D boolean array.  I like to be able to plot the digital signals on the Digital Waveform Graph, and to do that I have to use shift register and concactenate the previous array with the newly read digital signal.  I only want to keep the array when a certain criteria is met.  When it's no longer met, I want to "destroy" the array.  Attach is a sample VI.  Is this an efficient way to plot a Digital signal?  also, since i'm using 24V, i can't use the TTL counter.  Is there a VI readily available to count signal highs and lows? I have made a VI that specifically does this but I'm just wondering if there is LabVIEW function that does it.  Thanks.
    Peter
    Attachments:
    testing Digital signal array.vi ‏33 KB

  • Is it possible to create a 1 D array with the "build array VI"? when receiving random number

    Hello all,
    Is it possible to create a 1 D array with the "build array VI" when receiving random number?
    I am receiving random data and the build array VI always create a 2D array which might cause some problem if you want to compute certain type of operation after.
    Any example will be welcomed.
    Thank you,
    Israel 

    Hello Lynn and Yamaeda
    First I want to Thank you Lynn for your linguistic contribution indeed "Build Array" is a primitive and not VI, thank you for the education. In reality what I am doing is simple.
    I have two arrays of complex elements Array1 and Array2.
    Array1 conains the complex elements ""(a0+ib0) ; (a1+ib1) ;...(an+ibn) ;
    Array2 conains the complex elements ""(c0+id0) ; (c1+id1) ;...(cn+idn) 
    What I want to do is the multiplication of the first array by the  conjugate of the second array element.
    Array1*(Conjugate Array 2)" for the first element the results is "(a0.C0-b0.d0) + i(b0c0-a0d0)" and the etc...
    and then taking the square root ([(a0.C0-b0.d0) power of 2]) +  [(b0c0-a0d0) power of 2])
    I was wondering if there were some dedicate primitive that could solve the computation above which is the cross correlation in Frequency domain.
    Thank you very much.
    Israel

  • What I want to do is to get the co-ordinates of the elements of the third array which shows differences between 2 other arrays

    Hello,
    Ive have got a vi that compares two arrays by element and gives back the location of the elements that are not equal in a third array. What I want to do is to get the co-ordinates of the elements of the third array from the either the first or second array.
    Many Thanks
    (Labview 7.1)
    Please find the vi attached below
    Attachments:
    ArrayDiff701.vi ‏25 KB

    jihn wrote:
    What I want to do is to get the co-ordinates of the elements of the third array from the either the first or second array.
    Sorry, I don't understand what you mean. What are coordinates in this context?
    If you for example want to get an array of all elements from the first array corresponding to the list of indices in the "locations" array, just add another FOR loop as shown.
    Your VI has a major flaw! You need to reverse the order of "Add array elements" and "to I32". The "to I32" needs to come first! (see image). If you "add" first, you'll run into problems if you have more that 32k different elements because of overflow in the I16 integer.
    Message Edited by altenbach on 02-21-2008 05:22 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Different.png ‏9 KB

  • How can I, depending on the elemnts of an array, write into the same array

    Hi everyone, to make this a little clearer, consider a 2*2 I8 array, many y objective is the following:
    1) connect the array to the case structure, and depending on a specific case that's value of element of indeces (0,0), write over the same array in this way
    1 0
     2 3 
    for example, note that in (0,0) there's 1, so my decision is to make the array (same array) as:
    0 0
    2 3
    any ideas?
    Thanks.
    T. A.

    toniaz wrote:
    ... should I add the array itself inside the loop or should I add its local variable?
    The array data is in the shift register or wire!
    Any controls or indicators of the array just lets you interface to it via the front panel. Don't use controls or indicators as data storage via local variables, that's not the right way.
    Here's a very simple demo (LV 8.0) that shows one possibility how to do this. See if it makes sense.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    changeArrayElement.vi ‏18 KB

  • How to increment an element in an array and put it back in the same array?

    I have an array of values generated by another part of my program. My goal is to count the number of occurences for each integer value in the array and put these values in a new array. This new array will be a histogram of the input array. My approach is to do auto-indexing with a for loop. In the loop I use a "index array" to get the current value of the histogram array and a "replace array subset" to update the array element with "current+1". The problem is that when I wire the output of the "replace array subset" VI back to its input, I get a wire error. I guess I cannot wire it like that, but what should I do? Is there a completely different approach to do this that
    is more elegant?
    Thanks for your help!
    Benoit

    Hi Benoit,
    I believe the thing that's missing is a shift register.
    Right-click on the edge of your "For loop" and select add shift register.
    Wire an initialized array to the shift register left terminal before entering the "for loop". Wire from this same terminal (inside the loop) as the source of the info used in your "index array" and replace array. The results of these two operations (just the way you are doing it now) gets wired to the "right terminal" of the shift register (inside the loop).
    What ever you stuff into the right terminal, gets returned via the left terminal on the next iteration of the loop. When the loop is done, your final array of counts can be accessed by wiring from the "right terminal" (outside the loop).
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Compare 2 arrays,if same value add the value.If different value show 0

    hello to all! i am new to labview and i'am trying to solve a labview exercise
    ''compare 2 arrays 1d 1x10 (the values of them are lucky numbers from 1 to 10)  .compare them and create a new array [1,10] that saves the same values in the corresponding places ,while in the remainder places where the elements of 2 tables are different  show 0''
    One Example
    In this time of project i have stuck at the comparison of values of two array.and how i would achive creating the Array3! I have search the forum about founding any answer.Any ideas?
    Message Edited by sdadfsdfds on 06-05-2008 12:08 PM
    Message Edited by sdadfsdfds on 06-05-2008 12:09 PM

    I am guessing that since this is a labview exercise it is meant as a learning experience.  There are several ways to solve this problem, I have shown one way below.  I suggest that you try and come up with other ways on your own.  Feel free to ask any questions.
    Cheers
    Message Edited by jmcbee on 06-05-2008 11:25 AM
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    Compare Arrays.PNG ‏3 KB

Maybe you are looking for

  • FF_5 User-Exit

    Good Morning, I'm using the exit <b>EXIT_RFEKA400_001</b> (Include <b>ZXF01U06</b>) to validate Electronic Bank statements files before posting them. When i use the frontend to download the file (Windows -> Windows), there's no problem, but when i'm

  • Dell E176FP monitor won't work with os 9.2

    Hi I bought a dell 17 inch E176FP monitor but there is no display with my powermac g4 running os 9.2 It works fine when I plug it into my Dell inspiron laptop (awful product) and a smaller viewsonic model works fine with my G4. I've done a factory re

  • Concatenate fields of record  type

    Hi Is there some way to concatenate fields of the record type ?, example declare TYPE customer_sales_rectype IS RECORD       (campo1 char(3),       campo2  char(3),       campo3  char(3));   TYPE ZZZ IS RECORD (kkk customer_sales_rectype);       x cu

  • What DirectToFieldMapping.isMutable() means?

    What DirectToFieldMapping.isMutable() means? I see that it's false for Date and Calendar using converter to support timestamptz. Is this a problem if our application modify the Date or the Calendar in a UOW? // code sample how we get the value Relati

  • How to use citrix applications

    How to use citrix applications on macbook air? how to download ICA.