From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with making average of three different levels

Hello

          

            I Freshly Started to Use Labview and im doing some project, I have problem with making average of Three levels(water), for example 3 different levels should be added only when There level is 20-80%, and should not be added to average if any level is not within the limit. which Function should I use? Please any one suggest.

0 Kudos
Message 1 of 3
(2,073 Views)

Hi MMM,

 

whenever you have terms like "if x then y" you should use a case structure...

For checking a range you could use the InRangeAndCoerce function.

Best regards,
GerdW


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

MMM@13 wrote:

 

I have problem with making average of Three levels(water), for example 3 different levels should be added only when There level is 20-80%, and should not be added to average if any level is not within the limit. 


You need to explain in more details, because your problem description is ambiguous.

 

So you get three values in the range of 0-100% and you only want values in the range 20-80%. If only one of the three values is out of range, do you still want to average the other two or take no average at all? When you say the average should be "added" we typically talk about this function, but then you need to explain what other value it should be added to. Could it be that you mean "appended", e.g. to an array of history data? Could it mean sent to a chart or not??

 

Please explain. Maybe you could attach a simplified copy of your VI.

 

 

0 Kudos
Message 3 of 3
(2,022 Views)