11-08-2010 02:27 AM
hello, I'm trying to write my flowing data into 2D array. I have attached a sample vi. What the problem is that:
As can be seen from the block diagram, there is a 2D array whose the first column has constant data. These are 1,0.977,0.955..etc. These are my constant X values. The problem is on writing Y values into the second column.
Firstly, I run the program, it executes and I pause it, so it calculates a mean value due to "Amplitude and Level Measurements.vi". So I want to write this mean value to 2.row in 2.column. Then, I push the pause button twice and the program continues again and stops. Then I want the program to write the mean data of this step to 3.row in 2. column and so on. I also want to the value of 1.row in 2. column constant zero. However, after each loop run, the mean value is always overwritten into 1. row of 2. column. The other rows of 2. column are always zero. So I want like this;
1 0
0.977 mean value of first execution
0.955 mean value of second execution
0.917 mean value of third execution
0.88 .....and so on .
0.842 .
0.767 .
0.692 .
0.617 .
0.504 .
0.391 .
0.278 .
0.165 .
0 .
after obtaining of this-liked 2D array, I will plot XY graph, and then do curve fitting. My original vi can not be opened fully so I have attached a sample vi. Could you please help me as soon as possible?
Solved! Go to Solution.
11-08-2010 02:35 AM
hi ,
Not being able to open your VI 😞
Regards,
Nitz
11-08-2010 02:35 AM
11-08-2010 03:08 AM
Hi GerdW,
Thank you for your reply. I have used shift registers for the array and the index counter. However, it overwrites the previous value into the second column of first row. Could you please try it? thanks ...
11-08-2010 03:14 AM - edited 11-08-2010 03:17 AM
Hi mechen,
in your last attached version there is NO shiftregister for the array nor the counter... So please attach the current version! And, please, use only chars from the English alphabet as others might have problems with your (turkish?) filenames ("File not found"...)!
11-08-2010 03:35 AM
Hi GerdW,
I have uploaded the last vi in English name. I have attached the shift register to tha array. However, it does not work. Or I could not understand you. Now, I think you are able to open the file.
Best regards
11-08-2010 03:43 AM
Hi mechen,
here is a changed version. To call a FOR loop ZERO times is just senseless...
Do you understand the rest of the VI anyway? There are already Shiftregisters, so why didn't you just copy their behaviour? You still have to change this VI for your counter, this one needs a shift register too!
11-08-2010 03:52 AM
Hi GerdW,
I could not open the vi that you submitted. Could you please save as in 2009 version.
Best regards
11-08-2010 03:53 AM
11-08-2010 04:52 AM
Hi GerdW,
thank you for the last vi. I can open it.However, it still overwrites in the first row of the second column. I couldn't understnad where I put in the shift register.