From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay an array

Solved!
Go to solution

Hi,

 

I have a 29x41 array that is the output of a datasocket. The datasocket collects data from a wavefront sensor and each number in the array is a measurement from one microlense (there are 29x41 microlenses). The problem is that when I change the settings of the wavefront sensor to only use part of the microlenses (ex. 29x29) the values that correspond to unused lenses continue to be the values of their last measurement and I need the values of unused lenses to be zero.

 

In other words I have a 29x41 array with some values that are constantly changing and some that are stable. I need to change all those that are stable to zero. 

 

I thought that I could subtract the array with that same array but 1 second later. Any ideas how to do that or other suggestions?

 

Thanks

Max

0 Kudos
Message 1 of 4
(2,390 Views)

Hello,

 

Now I'm not entirely sure of the context (as I have no reference to your design), but if you have a constantly changing control, how about trying to set the unused parts of the array to zero at the beginning of each iteration (im asumming you have a looping structure of sorts). You can get the array size that you are using by taking from the control, then performing array operations to obtain the blocks that you are not using, then setting those blocks to zero. Or you could instead, as you metnioned, subtract them out of you array, which might be easier. Duplicate you array, then set all the values that did change (again by using array operations) to zero, and subtract it from the original array.

 

Best of luck,

Miguel V
National Instruments
0 Kudos
Message 2 of 4
(2,383 Views)

I wasn't very clear when I said ''delaying the array''. I meant comparing the array with that same array but from the previous iteration, since my control array changes at every iteration. I also think it would be the simplest way exept I'm not sure how to do that. I tried writing the array to a spreadsheet and then reading that spreadsheat at the next iteration but it seams to me that there is probably a simpler way to do it. 

0 Kudos
Message 3 of 4
(2,348 Views)
Solution
Accepted by maxdes

You can use a shift register or a feedback node so that you will be holding the previous array values and can compare it.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 4
(2,343 Views)