LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Request: Make these VIs faster for large arrays

Solved!
Go to solution

OK, here's the second half of the problem. Also around 3ms, same result. 🙂

 

Download All
Message 11 of 59
(1,954 Views)

dthor,

 

Out of interest, how fast is mine using the same data set. I would remove your copy of the loop out of my vi as this would grind it to a halt.

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 12 of 59
(1,951 Views)

 


 

OK, here's the second half of the problem. Also around 3ms, same result. :smileyhappy:

 

 

 


 

 

Thats very nice, and obvious when you look back at the problem. Smiley Happy

 

Lucither

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 13 of 59
(1,942 Views)

Unlike the "scan list" input of the second VI, the output of the first VI scans all rows in the same direction and thus has a large "flyback".

 

Basically, we need to rewrite the scan list so all section with a even number in the first row are reversed. This should be quite trivial and could be implemented directly with a bit more code.

 

In any case, we don't even need to generate the "scan list" at all, the entire task could be done in a singe FOR loop.

Message 14 of 59
(1,936 Views)

 


 

 

Unlike the "scan list" input of the second VI, the output of the first VI scans all rows in the same direction and thus has a large "flyback".

 

Basically, we need to rewrite the scan list so all section with a even number in the first row are reversed. This should be quite trivial and could be implemented directly with a bit more code.

 

In any case, we don't even need to generate the "scan list" at all, the entire task could be done in a singe FOR loop.

 

 


 

 

You lost me at 'Hello'. Can you repeat that as though your talking to a child please. Im not that stupid but i cant make out what you are saying Smiley Tongue

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
0 Kudos
Message 15 of 59
(1,928 Views)

Have a look at the output of the first VI, scroll e.g. to where we jump to the second row.

 

  • We go from [1;70] to [2;4] for a jump of 66 pixels and then start scanning back up to [2;70]

If we look at the same spot of scan list input of the second VI:

 

  • We go from [1;70] to [2;70] for a jump of 1 pixels and then start scanning down to [2;4]
The second method is much more efficient. Basically we scan up, jump to the closest position on the next row, scan down, jump
to the next row, scan up, etc.
.

 

Message 16 of 59
(1,922 Views)
Solution
Accepted by dthor

... and here is my attempt to do the work of both VIs in basically one step, eliminating the intermediary "scan list".

 

It goes from the "probe array" to the "relative list" in about 4ms and also reverses the scan direction of every other row to limit unecessary movements.

 

(There are probably small bugs, so verify correct operation. I am sure it could be optimized further).

 

The code is not well documented, so let me know if anything is unclear.

 

Download All
Message 17 of 59
(1,915 Views)

Altenbach,

 

Sorry to be a pain but could you do me a favour. Could you post what you have done and the original op's vi's in 2009. Im really interested in what you have done to make it so efficient. Unfortunately it is hard to follow as i cannot see what the op's original data is like.

 

If its not too much bother i would appreciate it, am always looking to improve on things like this.

 

Rgs,

 

Lucither.

------------------------------------------------------------------------------------------------------
"Everything should be made as simple as possible but no simpler"
Message 18 of 59
(1,907 Views)

 


@dthor wrote:

EDIT: Yes, for now I can sum "Probe Array" and that will tell me the length of "Die to Test Array", but I plan on changing Probe array to be more than just 1 or 0.


 

That would probably not require much modifications (of course depending on what the other numbers mean to you).

 

for example:

 

 

  • If you don't care about the actual number, do a "not equal 0" on the input array followed by "boolean to 0,1" followed by "to I32", followed by "sum" and adapt the rest of the code accordingly (mostly leave it "as is").
  • If you want to scan all positions with a specific value, do a "equal desired value" on the 2D array, then again as the above.
  • ...

 

Message 19 of 59
(1,904 Views)

Here are all three in LabVIEW 8.0. You should be able to open them in 2009.

 

They contain the same default data as the original posts. Check for bugs.... 😉

 

 

0 Kudos
Message 20 of 59
(1,899 Views)