10-25-2019 04:29 AM
I am receiving voltage values from a sensor and I want to create an array through formula node that can only fill the positions of the array when there is a change in voltage value read, I have the cycle to send to the array but fills the positions of the array with the same value.
10-25-2019 04:45 AM
Hi smalhao,
did you take the "Training resources", offered in the header of the LabVIEW board, to actually learn LabVIEW?
Don't use FromDDT to create an array from a scalar value!
Don't use ToDDT, followed by FromDDT, just to index an element from an array!
Don't use a FormulaNode to create an array from a scalar value! (Your current formula can be replaced by a simple InitArray!)
All you need is a shift register, a case structure and BuildArray…
10-25-2019 05:27 AM
I made the suggested change, but how can I make the 10-value FFT just for example?
I didn't understand what I meant by the
Don't use FromDDT to create an array from a scalar value!
Don't use ToDDT, followed by FromDDT, just to index an element from an array!
attached the new configuration on my vi
10-25-2019 05:43 AM
Hi smalhao,
@smalhao wrote:
I made the suggested change, but how can I make the 10-value FFT just for example?
What's the point of a case structure when you wire a TRUE constant to its selector?
I implemented one way to create an array of (exactly) 10 elements and keep it at 10 elements.
@smalhao wrote:
I didn't understand what I meant by the
Don't use FromDDT to create an array from a scalar value!
Don't use ToDDT, followed by FromDDT, just to index an element from an array!
Don't use those ExpressVI functions when you don't need them!
(See the other changes in the image.)
That image is just to show the proposed changes, it's not meant to be functional or even senseful…
10-25-2019 08:24 AM - edited 10-25-2019 08:27 AM
I implemented the suggestion but only guarantees me the 10 on one side I tried to replicate to AI4 and only put 5 values in the array. The idea is to read 10 values in each iteration and put them in an array after the Mean.vi blocks, and read every 10 values you get in the array and put the FFT block e Power Spectrum to see the magnitude and frequency spectrum.
10-25-2019 09:51 AM
I tested your suggestion but only inserts 10 values on one side of the AI, but thanks for the help, explaining better what I need to do is after the Mean.vi block to read 10 values and put them in a 10 position array this being always reading the values that in this case is voltage, then apply the FFT and show the frequency spectrum, to test on a motor and detect vibrations
10-25-2019 10:28 AM
10-25-2019 11:21 AM
I forgot to upload the file.
I tried to do the FFT, but I think it's wrong the way I did it.
like 10 impressions is just for testing, because then it's up to 4000 or 5000.