06-14-2018 11:07 AM
Hello,
Applying 8 digital waveforms, I'm trying to create 8 arrays of index where bit = '1'.
For simplicity in the code below I process only 7-th (last waveform).
The lenght of array should be less than waveform length , because the number of '1' is less than waveform length.
The output is a little bit strange.
If i-th bit is '1', its index is added to array ... it's OK.
But what is wrong - if i-th bit is '0', nothing must be added to array, but in my case 0 value is added.
Thanks in advance.
Pavel.
Solved! Go to Solution.
06-14-2018 11:12 AM - edited 06-14-2018 11:16 AM
Firstly, you can use conditional tunnels.
Secondly, LabVIEW does not allow ragged 2D arrays where different rows have different lengths, so things will get padded at the outer loop again.
If you want ragged arrays, insert a "bundle" before the outer indexing output. You'll get a 1D array where each element is a cluster containing a 1D array of variable length.
If you would present the digital waveform as integers, all you need is a simple masking operation to see if a certain bit is set.
06-15-2018 03:49 AM
Works nice with conditional tunnels.
Thanks.