LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array output only when detects change tension value

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.

0 Kudos
Message 1 of 8
(5,671 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(5,657 Views)

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

 

0 Kudos
Message 3 of 8
(5,635 Views)

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?

check.png

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(5,628 Views)

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.

0 Kudos
Message 5 of 8
(5,584 Views)

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

0 Kudos
Message 6 of 8
(5,578 Views)

Hi smalhao,

 

so you edited your VI, but again don't want to attach it?

 

What results do you expect from a FFT of just 10 input samples???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 8
(5,565 Views)

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.

0 Kudos
Message 8 of 8
(5,549 Views)