What is the best way to define exponential values in a protocol?
For example a value that can range between 1E-3 and 1E-10
Goals:
- readable in a data page
- able to trend
- able to add alarm thresholds
At this moment you're going to have to parse the incoming value and choose a fixed unit (e.g. E-6), this way you'll be able to trend and put alarm thresholds.
It will not be ideally readable as you could have E-3 up to E-10 values that will be a very large or small number being displayed in the E-6 unit.
In the future we're having the dynamic unit which will allow the user to select an appropriate unit, I don't know if we will be able to dynamically change it from inside the driver. That will have to be checked once that feature is available.
This is correct. Just some more info about the dynamic units:
Support for dynamic units will be added in 10.0.9 (RN26330) in Visio. However, exponential notation is currently not a part of that feature. So you will be able to display a value in the best fitting unit (for example Hz for small numbers, Ghz for big numbers), but it’s currently not possible yet to automatically convert 1000 E-6 to 1 E-3.
It would certainly be interesting to have that functionality (with and without units). Feel free to create a task to request this feature.
Thank you for the answer.
Ideally the Exx is added automatically when a number is very small / large and is displayed next to the unit.
Example: the speed of light displayed value = 2.998 E08 m/s. internal value = 299792458 m/s