07-15-2013 05:43 PM - edited 07-15-2013 05:44 PM
Hello,
I have a problem with Insert into Array.
I have basically two loops, and data are generated each time. What I currently get, in case of, for example, 2 outer loops and 4 inner loops, is something like (see attached excel file) :
1.7 1.8 2.4 3.6
1.7 1.8 2.4 3.6 8.14 1.5 1.3 1.6
i.e. when the outer loop takes place for the second iteration, the data is being appended to the old one but in a new raw.
What I want is to have the second raw above as the first and only raw.
See:
The keithley buffer gives me a string of numbers of length 11 plus a comma and a space = 13, thus the numbers shown above, but please ignore these
since they work perfectly and my problem is only within "insert into array".
Thanks for your help,
ali8
07-15-2013 07:04 PM
Try using a shift register and build array.
Right-click on the array terminal at the edge of the for loop and select "Replace with Shift Register".
07-16-2013 11:11 AM
07-16-2013 11:38 AM
Show us the new code. Maybe you don't want to initialize the shift register?
07-16-2013 06:38 PM - edited 07-16-2013 06:40 PM
Do you mean that the data accumulates, appending to old data (not writing over it).
Try using a Waveform Graph instead of a Waveform Chart.
They are different, the chart accumulates data by design, the graph does not.
07-16-2013 09:18 PM
The idea is not only in the Chart/Graph, there's data written to Excel, so changing the chart/graph does not eliminate the problem.
I will check tomorrow and get back to you guys, and thanks in advance.
07-17-2013 06:03 PM
07-17-2013 06:22 PM
What exactly do you mean when you say "it is not working". Can you please be more specific.
What do you want it to do that it is not doing? What output are you expecting on the graph and the in the csv file? (They will be different.)
07-17-2013 08:08 PM - edited 07-17-2013 08:09 PM
I mean that if you do more than one for loop "iteration", then each new iteration add new raw.
Thus you end up having something like this in .csv file (assuming each iteration adds two values 'v') :
v1 v2 0 0 0 0 0 0
v1 v2 v3 v4 0 0 0
v1 v2 v3 v4 v5 v6
etc
I want to open the .csv file and have only the last "updated" or "final" raw. There is no need for the first few raws corresponding to first few iterations.
07-17-2013 08:22 PM