M10K Format

From AutomationWiki
Jump to: navigation, search

Introduction[edit]

The Modulo-10000 (M10K) format breaks a 32-bit value into two 16-bit registers, according to the following relationship:

High-Order Register = value 10000

Low-Order Register = value modulus 10000

The 32-bit value can be retrieved by the following calculation:

value = registerhigh x 10000 + registerlow

Example[edit]

Value 12345678 is passed in unsigned 32-bit Modulus-10000 format.

Registerhigh: 1234 = 04D2 Hex

Registerlow: 5678 = 162E Hex

value = 1234 * 10000 + 5678 = 12345678

Another Example[edit]

Value -12345678 is passed in signed 32-bit Modulus-10000 format.

Registerhigh: -1234 = FB2E Hex

Registerlow: -5678 = E9D2 Hex

value = -1234 * 10000 + -5678 = -12345678