LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write data into 2D array

Solved!
Go to solution

Hi mechen,

there is a "Replace ArraySubset" function wired with a "1" constant - so it will replace row one each iteration...

That's why I said: you need another shiftregister for the counter index!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 26
(1,352 Views)

Hi Mechen,

 

I am not sure what you want in the Y value of your array exactly. But just check the vi which i have attached. even if its not what you are looking for you can at least make use of the shift register concept for your vi in such a manner.

 

let me know whether this helps or not..

 

Regards,

 

Nitz...

 

Download All
0 Kudos
Message 12 of 26
(1,349 Views)

Hi Nitz,

Thank you again. It is ok but there is an unintended consequence. This is that the previous y data slip down at each loop iteration and the new value is always written in the first row of the secon column. What y data is that:

I traverse my probe to 0.977 m in the pipe cross-section and fix probe at this point . and then run and pause immediately the vi and it counts 10000. then the average value is calculated by means of "Amplitude and Level Measurements.vi". This value must be written near to 0.977 in 2d array. I change the probe location to 0.955 m and then again I click the pause button twice and it runs couting 10000 and then the vi waits and the average value is now written near to 0.955 and so on. So I will obtain y values (which are average velocities at each cross-sectional point) corresponding to each related probe position and find the y=f(x). So, could you please help me with this respect? thanks again.

 

0 Kudos
Message 13 of 26
(1,342 Views)

Hi Mechen,

 

I guess I understood your problem this time. I am attaching your vi with a few changes. Have a look. I think this is what you needed.

 

Regards,

Nitz...

( i hope at least this will earn me a kudo:) )

0 Kudos
Message 14 of 26
(1,322 Views)

Hi Nitz,

thank you very much for your reply. Unfortunately, I could not open the vi you submitted. It is newer version. I have 2009 version. Could you please send it again? I have forgotten to say that the second row of the first column must be always constant zero. Because, the velocity on the wall denoted as "1 m" is zero. So the 2D array must be like this;

 

1               0

0.977        average value of the first loop iteration

0.955        average value of the second loop iteration

0.917        average value of the third loop iteration

0.88          average value of the fourth loop iteration

........         .......................................................   and so on......

 

Regards,

mechen

0 Kudos
Message 15 of 26
(1,316 Views)

Hi Nitz,

I'm sorry that I have a mistake. Previously, I have said that the second row of the first column must be always constant zero. This is wrong. The second column of the first row will be always constant zero.

Regards,

0 Kudos
Message 16 of 26
(1,324 Views)

Hi mechen,

 

after looking at your VI again I saw you already used a counter for your measurements... Why not use it for replacing values in the data array?

I also made a "true" 2D array constant from your initial array constant by adding an empty 2nd column. See attachment in LV2009.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 26
(1,319 Views)

Hi ,

 

I am attaching the vi in older version. Check it. The part in which the first row 1 and 0 is not done in this vi. Just check the rest of the things if its what you need or not.. if not, then threre's no point in my breaking head in bring the first row 1 and 0 🙂

 

Regards,

 

Nitz

0 Kudos
Message 18 of 26
(1,314 Views)
Solution
Accepted by topic author mechen

Hey hi,

 

I think i got what you are looking for... Its here...

 

Regards,

 

Nitz

0 Kudos
Message 19 of 26
(1,307 Views)

Hi Nitz and GerdW,

Thanks a lot for your replies and solutions. It is now ok!!! Thanks a lot...

0 Kudos
Message 20 of 26
(1,300 Views)