View Single Post
Old April 9th, 2021   #1
Junior Member
Join Date: Jul 2019
Posts: 6
Default E1-20: Sensor Values With Base 2

Hello all you great girls and guys,

please help me out again.

Recently my colleague and I discussed one interesting bit of the E1-20 standard. Beneath Table A-14 is the following annotation:
"When a prefix is used with MEMORY, the multiplier refers to binary multiple. i.e. KILO means multiply by 1024."

We had a great argument about this note.
From our understanding this refers to the interpretation of the sensor value received by SENSOR_VALUE, not the representation of this value.
For example, a sensor reporting a present value of 1 with the sensor's prefix being PREFIX_KILO, the sensor reports a true value of 1024 bytes.
It is not reporting 1000 (true) bytes, which should be represented as ~0.98 kibibyte.

However, we did not figured out whether the multiple of 1024 is only valid if and only if the Sensor Type is SENS_MEMORY.
SENS_MEMORY seems to be the closest match to the mentioned MEMORY, but we are unsure whether the standard does mean any memory related types or indeed solely SENS_MEMORY.

For example manufacturer specific parameters using UNITS_BYTE is a big question here. Should the prefix there also be based on the binary multiple?
Or should a device using manufacturer specific parameters report 1024 UNITS_BYTE to mean 1 kibibyte?

If the binary base refers only to SENS_MEMORY:
Does this mean, that any SENSOR_DEFINITION with its sensor type being different from SENS_MEMORY but its unit being UNITS_BYTE, should NOT use 2 as its base?

Also, there is the special case of exponents being less than 1. What would you expect, if any device reports the following values:
SENSOR_VALUE: PresentValue: 0x00000120
Obviously the device reports some sort of undefined partially byte. But would you expect a value of 0.288 millibyte or something different?
We do not know any defined prefix for base 2 with the exponent being less than 1 (like kibi for the exponent being 3). Are there any?

What is the correct interpretation of the mentioned note, what are you recommendation?

Best regards,
FishAI is offline   Reply With Quote