One question that may be basic knowledge but here goes - we have points that go out of range (in this case, under range). This causes issues with the calculations in the analytics. Is there a way to mask the under range to be zero for the calculations I need. It is essentially zero at that point, but has gone beyond the range value. Thanks for your help.
2 of 2 people found this helpful
This is a good question! Are the under/over range values hard coded (e.g., to a digital state), or is it an analog value that happen to be too high or too low (e.g., random spikes in data)? If the value is is hard coded, please check to see if you're using Float16 tags. These automatically get reported as under range or over range. We discourage users from using Float16 these days, as it's a legacy feature to accommodate storage space at the time. If you make a simple switch to Float32 on the PI Data Archive, it would then report the actual analog value.
However, if the actual analog values are NOT hard coded to a digital state when under/over range, here are two options you can explore that works:
1) Clamp the values with a formula. Create a formula and map it to the Tag in question. Set Min/Max for its settings.
Here's a picture of a Formula called 'Hot-Spot Temperature (Filtered)' that references a tag called 'Hot-Spot Temperature'. I can set the minimum and maximum values in the properties shown here. As you can see from behind the configuration, the green box shows the actual tag values in comparison to the filtered one. The reported value is 80 (because that's what the maximum value I set), even though the actual tag value is 88.6.
And here's how it looks like when I raise the maximum to 200. It would report the normal value of the tag, as expected:
2) Another option is to create multiple IF-Then statements in your calculation, where each is a variable that you can use in a calculation elsewhere (each line listed below is a variable). You would need at least two variables in your Analysis, and then you can use these variables as INPUTS for your actual calculation.
- IF 'Tag' < 0 THEN 0, else 'Tag'
- IF 'Tag' > 100 THEN 100, else 'Tag'
Either options are good, depending on how you want to see the data. Hope this helps.
Dararith, this is exactly the issue. We have a legacy system and most points are float16. This will fix the problem, thank you!