LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building 1D array using for loop, taking too long to complete!!

I have a delta time value, and wan to convert it to a 1D array with given array size, every point increment will be the delta time value,
I trying to use for loop with build array and intiate array function in it...
result is i got what i wanted to have, but it is taking very long to complete the for loop, although the array size i making is large..

The purpose of getting the 1D array is for the Export Waveform To Spreadsheet File.vi
I wanted to have 3rd dimension which is delta time,
instead of only time stamp and Y value
0 Kudos
Message 1 of 4
(3,140 Views)
Using build array and intinate array function will increase the running time,
so just take out the functions and use shift register
and loop tunnel to throw the next point into the array indicator and the array will start to build up
0 Kudos
Message 2 of 4
(3,140 Views)
If you know the final size of an array it's generally much faster to
replace elements than to build it on the indexing boundary of a for or
while loop. You can initialize an array of the correct size and use
the "i" loop counter as an index and pass the array through shift
registers. The problem with dynamically increasing the array size is
that it needs to get memory for the array and this can take time
unpredictably during execution.
Yours Sincerely
John
0 Kudos
Message 3 of 4
(3,140 Views)
If you want to create a waveform data type and already have the Y array, there is no need to use any type of loop. The waveform data type is a cluster that consists of the Y array, and scalar values for start time and delta time. You use Build Waveform to add delta time to your Y array.
0 Kudos
Message 4 of 4
(3,140 Views)