LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, how can i break the value for a row and column once i have converted the image to the array???????

Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
 
At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
 
Please help me!
 
For your information, I'm using LABView 7.0.
 
 
 
0 Kudos
Message 1 of 7
(3,112 Views)
Soory, here is the attachment.
0 Kudos
Message 2 of 7
(3,105 Views)

I must confess that I could not quite understand your problem

are you telling that you are not able to modify a particular entry/element in an array using replace subset array function??

Also in the pic attached, why are you passing the array through the 2 nested for loops????

did you want to modify the array elements inside for Lop using the 'i' value of the for loop as the row/column index value??

If yes, pass the 2D array through a shift register and modify the array on each iteration of your 'for' loop

 

Message 3 of 7
(3,091 Views)

Hi,

Thanks for your reply.Sorry for the confusion.

I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.

Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.

I hope that I have made the problem clear. Sorry if it is still confusing.

Hope you can help me. Thank you!!!!

0 Kudos
Message 4 of 7
(3,080 Views)
Hi aaz,

do as devchander told you: use a shift register in the for loops and replace the array elements inside the inner for loop!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(3,077 Views)
Hi aaz,

here comes the example:

Message Edited by GerdW on 05-15-2007 11:46 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,073 Views)
Hi,
 
Thanks a lot to both of you for the answer.. It helps me to understand the array concept...I've rated the answer 🙂
 
I'm still having some problems..how can i use the i value more than once, for example i wanted to have an if else case, where in the first case, only the row will increase to1, and in the second case only the column will increase to 1(and the row remain the same)... How can i do it? should i use more than 1 loop?
 
Thanks!!
0 Kudos
Message 7 of 7
(3,059 Views)