LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

for loop performance

Hello,

 

In the attached picture there are 3 sets of two for loops. I think the third set is not good because memory must be allocated every time the array is built with the auto index tunnels. Are either of the the first 2 sets of loops an improvement?

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

Is there any particular reason you have an array of error clusters? Change that to a scalar error cluster, and change the auto-indexing terminals into shift registers on the bottom two for-loops.

0 Kudos
Message 2 of 4
(2,413 Views)

This code is for activating an array of valves. I need the array of error clustors so if a valve fails I know which one failed. The numeric array is an array of channel IDs which will have a unique number for each valve, if change the auto index terimnal to a shift register in the bottom pair of loops only one valve will activate. I should have made the intended functionality clear in the original post.

0 Kudos
Message 3 of 4
(2,403 Views)

I think after compilation, they will reduce to the same thing (disregarding the locking done in the IPE). As long as you initialize the error array to have the same number of elements as the valve array.

0 Kudos
Message 4 of 4
(2,377 Views)