LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

prevent meter from going to zero

Hi all,
 
I have a vi that takes a set of input values and calculates the number of peaks that occur. It then calculates the time that has passed between the occurence of two peaks. I have set a scale for the time period.i.e. if the time period is between 1 and 1000ms the scale is 1, if the time period is between 1001 and 2000ms scale is 2 and so on. I have set these conditions in a formula node and connected the output to a meter. My problem is that, if the first time scale is 1, and the second time scale is 2, the meter goes down to 0 from 1 and then moves back to 2. I would like to know, how I can prevent the scale from moving down to zero each time and only move from 1 to 2.Hope I was clear.
 
Kindly help me out.
 
Thanks and regards.
0 Kudos
Message 1 of 7
(2,410 Views)

Probably, the formula node is calculating and passing a '0' value during the transition from 1 to 2.

But, it is difficult to suggest anything without looking at your vi.

Can you attach the concerned vi??

0 Kudos
Message 2 of 7
(2,403 Views)

Hi,

Thank you for the quick reply devchander. Attached is a screenshot of the VI. I cannot attach the VI since many VIs in the main VI are hardware dependant and will not work.  There is some amount of time that passes between the appearance of one peak and another peak. At this point the meter goes down to zero. Hope you can help me find a solution to my problem.

Thanks and regards.

0 Kudos
Message 3 of 7
(2,392 Views)
The simplest way is to assign the output from the formula node to Meter only if it's > 0, using a case structure.
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 7
(2,383 Views)
Thank you pincpanter for the very simple solutionSmiley Very HappyWas a great help!
0 Kudos
Message 5 of 7
(2,376 Views)
Hi pakruthi,

maybe not as simple, but also versatile...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(2,369 Views)

Thanks GerdW. Wonderful solution too!! Thanks again.

Regards.

0 Kudos
Message 7 of 7
(2,364 Views)