LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

move data by row in a 2D array

Solved!
Go to solution

HI, i have a question about moving data in a 2D array by row i have not been able to do it so if anyone has an answer please let me know 

a picture of what im doing is attached like i said 

i want to move the "1 and run" by row not by column, if i change the index to row it will work but the issue is that the "run" stays under the "1" and i dont want that, if i change the index to column labview puts the data just like the picture attached but when i changed the index labview moves the data by column when want it by row

 

Download All
0 Kudos
Message 1 of 15
(4,322 Views)
Solution
Accepted by topic author Tokyghy

Hi, I think changing your code like this will give you the  behaviour that you are looking for.

2012-01-31_105531.png

That being said, your original code is a bit confusing. Why do you have a for loop? If you remove the for loop the code will do exactly the same thing.

 

Regards,

 

0 Kudos
Message 2 of 15
(4,301 Views)

@Tokyghy wrote:

i want to move the "1 and run" by row not by column, if i change the index to row it will work but the issue is that the "run" stays under the "1" and i dont want that, if i change the index to column labview puts the data just like the picture attached but when i changed the index labview moves the data by column when want it by row


This description is way too complicated and I cannot really tell what you want or don't want. Why don't you attach a picture showing us exactly the result you expect?

 

I any case, you seem to have a pre-formed empty array, so "insert into array" is probably the wrong tool, because it grows the array with each insert operation. Most likely, you want "replace array subset", replacing empty elements with new elements, keeping the array at a constant size.

 

Here are a couple of code fragments that might give you some ideas. Most likely you need to make changes to get the desired result (which I cannot guess from your description!) 😉

 

 

 

Message 3 of 15
(4,284 Views)

jeff, thanks bro, this is what i need

0 Kudos
Message 4 of 15
(4,264 Views)

@Tokyghy wrote:

jeff, thanks bro, this is what i need



Don't forget to remove the FOR loop. I just pumps hot air. 😄

0 Kudos
Message 5 of 15
(4,260 Views)

I have another question, how do you keep the values in the array? for example 

let's say i already have two values in the first row and i want to add more values in the array but without moving the first row, i dont know if i explain myself, but i need to do something like this 

0 Kudos
Message 6 of 15
(4,257 Views)

Look at my example with the shift register. Keep the shift register in the outermost loop of your code.

0 Kudos
Message 7 of 15
(4,246 Views)

hey thanks for the info, i'll try it

0 Kudos
Message 8 of 15
(4,229 Views)

how do you insert data into the second column without modifying the data from a previous row ?

i want to put different numbers in the first column  with different status in the second  column

like this:

0 Kudos
Message 9 of 15
(4,207 Views)

You would make it much easier for all of us if you could attach your code (vi) instead of pictures.

 

We already gave you all the needed information, but the specific implementation depends on how it is integrated in the rest of the code.

0 Kudos
Message 10 of 15
(4,201 Views)