LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to (add an array dimension) to a spreadsheet column at a specific timing.

Currently

I'm using FFT to store the distance value according to the scanner timing.

 

For data storage, I'm creating an array initialization and inserting the distance values into an empty array by inserting the index one by one into the shift register.

After that, I remove the elements created by the array initialization by truncating the distance values.

 

What I want to do is

I want the distance values to be stored in a different column every time the loop finishes scanning (say every 1000th loop).

 

My current idea is to use an array truncation to truncate every nth time, but is there any other easy idea?

 

 

yeers_0-1727506411842.png

 

0 Kudos
Message 1 of 2
(239 Views)

Nobody in his right mind would even try to fix your code because it is not manageable.  The diagram fills many screens, overlapping wires flowing in all directions, blatant race conditions (e.g. you write to a local variable and read from the terminal of that local in parallel, see picture), convoluted constructs (e.g. using a case structure to negate a boolean).

 

 

altenbach_0-1727535031420.png

 

 


@yeers wrote:

I want the distance values to be stored in a different column every time the loop finishes scanning (say every 1000th loop).


 

Appending columns to an array or file is very expensive, because virtually all elements need to be moved in memory. If you would start with a new row instead, most existing elements can remain in memory order. You currently do a transpose-reshape-transpose-dance, which seems very convoluted.

 

Overall, there is a lot of code smell here, but if you want help with the specific problem of segmenting data, create a very small VI that simulates typical data and only contains the relevant parts. Make the data smaller, e.g. every 20 points instead of 1000.

 

Message 2 of 2
(203 Views)