LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get one sample every 5th second

Solved!
Go to solution

Hi,


I am trying to save every 5th continuous rms value in an array. I tried some loop method, but it shows me the value and afterwards it shows zero then next value. Is there any gate that will give me data, only if the condition is true?

 

Thanks

0 Kudos
Message 1 of 4
(173 Views)

Hi mub,

 


@mub.re wrote:

I am trying to save every 5th continuous rms value in an array.


Use a conditional output tunnel on your loop: set to TRUE each 5th iteration…

When the data already come in an array: use the DecimateArray function…

 

Generic advice: Always provide an example VI to explain your problem! Which kind of data are you working with? What is the expected result? Why are there "zero" values in your array?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 2 of 4
(166 Views)

Didn't upload, because my program looks stupid. The condition was inside the loop, so when true I was getting the values, but when negative it was sending zero. I put the loop now inside the condition. It still looks weird, but working. I couldn't exactly get your suggestion. Could you elaborate please?

0 Kudos
Message 3 of 4
(155 Views)
Solution
Accepted by topic author mub.re

Hi mub,

 


@mub.re wrote:

I couldn't exactly get your suggestion. Could you elaborate please?


Please read the LabVIEW help on loop tunnels and their different operation modes/options. One of them is called "conditional tunnel"…

 


@mub.re wrote:

The condition was inside the loop, so when true I was getting the values, but when negative it was sending zero.


Which is perfectly ok once you "THINK DATAFLOW!"

When there is an output on a case structure then there has to be an output value for each case…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 4 of 4
(143 Views)