LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Replace Array Subset" 3D-Array

Hi,
 
In a project context developed in LabVIEW 7.1.1, I'm using the function "Replace Array Subset" to uddate the content of a 3D-Array. I have made some tests and I was pleasantly surprised to have very good performances to replace (in place) a part of my 3D-Array with the content of another 3D array with the single LabVIEW function"Replace Array Subset" and one parameter : the index of the 2nd dimension.
Now, I'm upgrading the project in LabVIEW 8.5.0 and I have a broken arrow because the "Replace Array Subset" does not accept anymore to replace a 3D-Array part in my initial 3D-Array. So to manage the same array manipulation, I need to make the replacement row by row in 2 nested For Loops. This take a lot of time ! In my project environment this takes 145ms and nows with the new code in LabVIEW 8.5.0, this takes 3825ms !!!!
Does anybody have an explanation of LabVIEW changes ?
Does anybody have an optimized structure to manage 3D-Array in place modifications ?
Is it the same in LabVIEW 8.5.1 and future versions ?
 
I join 2 simple LabVIEW examples to show the changes:
- Replace3DArray-LV711.vi
- Replace3DArray-LV850.vi + xxx_Array_Replace3DArray-LV850.vi
 
Thanks for your help,
 
Emmanuel


Message Edité par E.Boivin le 05-05-2008 04:25 AM
0 Kudos
Message 1 of 9
(4,780 Views)
Your Replace3DArray-LV711.vi opens fine in LabVIEW 8.0 and 8.5.1, so everything should continue to work as before. You don't need to do any workarounds.
 
 
There is a possibly related fixed bug in 8.5.1:
 
4CFADPDX Replace array subset broken for 4D (or higher) arrays
 
But since you have only 3D arrays, you should be fine anyway. I no longer have access to 8.5.0. What is the exact error message if you click on the broken run button?
0 Kudos
Message 2 of 9
(4,750 Views)

Hi,

I have upgraded my LabVIEW to version 8.5.1 and I can see that I don't have the broken arrow anymore. So I can't return you the wiring failure message.

The "Replace Array Subset" function seems to work as before but in my project environment, it takes 2095ms to treat all my 3D-Array ; its really bigger than 145ms in LabVIEW 7.1.1 so I need to find a way to optimize this module.

Thanks for your help.

Emmanuel

0 Kudos
Message 3 of 9
(4,738 Views)


E.Boivin wrote:

The "Replace Array Subset" function seems to work as before but in my project environment, it takes 2095ms to treat all my 3D-Array ; its really bigger than 145ms in LabVIEW 7.1.1 so I need to find a way to optimize this module.


Ouch! If the same code takes 15x longer in 8.5.1, you should report that to NI. First make sure you are testing this correctly. Did you save the entire hierarchy of 7.1.1 VIs after opening them in 8.5.1. You should do a "save all" before benchmarking (but make sure you keep a backup of the 7.1.1 VIs elsewhere).
 
Also make sure you don't have any debugging tools active (probes, retain wire values, etc) and close the FP of subVIs that you don't need to see.
 
Anyway, your 8.5.0 workaround is too "loopy". You should be able to do this in one loop, e.g. as in the attached image. See if it is any faster. 😉
 
 
(btw: terminals should always be outside structures as in the image. This has been discussed elsehwere and has to do with compiler optimizations).


Message Edited by altenbach on 05-05-2008 09:24 AM
Download All
Message 4 of 9
(4,725 Views)
I think this is the thread altenbach is referring to. Quite interesting to read it entirely !

Smiley Wink

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 5 of 9
(4,702 Views)

Hi,

I'm back with my performance problem.

Have a look to the attached picture : if I disable the yellow part in my code, the total execution duration decrease from 2095ms to 165ms (145ms in LV7.1.1) ; this part is called 200 times and there is no other parallel task.

So it seems that the "Replace Array Subset" function consume the extra time !!!!

What do you think about this ?

Emmanuel

0 Kudos
Message 6 of 9
(4,672 Views)
If you are moving it to LV 8.5, then the disabled yellow part could be replaced by the new In Place element structure.
0 Kudos
Message 7 of 9
(4,663 Views)


E.Boivin wrote:
So it seems that the "Replace Array Subset" function consume the extra time !!!!
No, it probably is  the unbundling/bundling operations. We don't know! It could be that it creates extra data copies and thrashes the memory. Do a "show buffer allocations" and look for black dots.
 
Can you attach a simplified version of your VI?
 
What happens in the other cases? Why can't you keep the 3D array in its own shift register for the duration of the loop?
 
(Your index shift register should also be initialized and I32 type).
0 Kudos
Message 8 of 9
(4,647 Views)

Hi,

I have tried to reduce my LabVIEW 8.5.1 code in order to show the part of code wich consume resources ... and, finally, I have localized the area where the array manipulation can take more time than necessary.

The attached code is not representative of my need but it shows that, depending of the unbundle place of a "Boolean" data used for a following case selector (see enable / disable structure diagram) , we have a 3x coefficient applied to the duration "dT" ; remember that in my project context, the same code executed with LabVIEW 7.1.1 and then with LabVIEW 8.5.1 is 14.5x longer !

With my attached code, I can confirm that there are changes between LabVIEW 7.1.1 and LabVIEW 8.5.1. Is there an explanation of this phenomena ?

Emmanuel

0 Kudos
Message 9 of 9
(4,587 Views)