LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array subset output malfunction

I have no error, but my array subset is not outputting anything in the loop.  Is there a reason why?  Attached .vi

 

Thanks,

Chris

0 Kudos
Message 1 of 37
(3,515 Views)

You're only generating 100 samples, but trying to start at index 5000 on the second iteration of the loop. My math tells me that's not going to work.

0 Kudos
Message 2 of 37
(3,510 Views)

There is no problem with the array subset function. The reason why it is not giving any data is probably it not getting any data as input. Just check the input of the array subset whether the expected data is coming or not.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 37
(3,509 Views)

Expected data is going in.  Nothing is coming out.  I changed the 5000 to 5 and 10, I still get nothing.  My phase plot starts a graph but is not correct.  Wow, I am new to this program.  So confused.

0 Kudos
Message 4 of 37
(3,502 Views)

Even if you change the 5000 to 5 you're still going to run out of samples. It's basic math. Your loop is hard-coded to run 25 times. In the first iteration you start at index 0, and extract 5 samples. In the second iteration you start at index 5 and extract 5 samples. In the third iteration you start at index 10 and extract 5 samples. You're going to go past the array before you reach the last iteration. Thus, the Array Subset will return an empty array, by definition. Since the output tunnel is only looking at the last iteration's value (not sure if this is intended), you are, by definition, going to get an empty array.

 

What did you intend to do?

Message 5 of 37
(3,487 Views)

I agree with smercurio.

 

I do not know what waveform you are expecting, but I do get values.

 

This is what I get with the length set at 36.

 

 

0 Kudos
Message 6 of 37
(3,482 Views)

I guess I don't fully understand how this loop and sub array work together.  I am trying to ensemble average the data.  I think since I am stepping at 0.001s interval for 100s then I have 100,000 data points, no?

 

So, if I iterate the loop 10 times with the length set at 1000, and iteration multiplied by 1000, then I should have 10 rows of 1000 data points, right? 

 

 

Granted this is my 4th program I have made with Lab View, so I am learning A LOT.  Trying to shake the Matlab cobwebs and rethread them in different ways.

0 Kudos
Message 7 of 37
(3,481 Views)

Thanks Ray.R, I don't get that even!  The magnitude and phase graphs should be giving me something similar to what my bode mag and phase are doing. 

0 Kudos
Message 8 of 37
(3,478 Views)

How do you average your data?

 

0 Kudos
Message 9 of 37
(3,477 Views)

Using the FRF function, set to RMS Averaging using Linear averaging and with the number of averages set by the FRF function, I think I have set at 21 right now.

0 Kudos
Message 10 of 37
(3,469 Views)