Gentec-EO M-LINK User Manual

Page 40

Advertising
background image

M-

LINK User’s Manual Revision 3.0

34

Bit7 set, the ADC returned 4095 Counts, ambiguous data

Mask off the upper 12 bits, shift them right by 44 bits. The value is 0xA71, or 2673 counts.

Mask of the next 8 bits and shift the 36 bits to the right. The value is 0x1F, or range index 31.

Mask of the next 20 bits and shift the 16 bits to the right. The value is x01EC2, or 7874 period counts.

Mask off the next 8 bits and shift 8 bits to the right. The value is 0x00, so there are no errors or
corrections.

Range 31 is 3, a full scale reading in any range is 3000 counts, so the value is 2673 / 3000 x 3 =2.673
Units.

The period full scale is 1E6, so the frequency of the data is 1e6 / 7874 = 127 Hz.

Example with byte corrections:

The data is 0x0C11F0FED2200D

0x0C byte 6

0x11 byte 5

0xF0 byte 4

0xFE byte 3

0xD2 byte 2

0x20 byte 1, the correction byte

0x0D byte 0, carriage return.

All the following is done in the host application

Byte 1 is the correction byte and is interpreted as follows:

Bit0 is not used

Bit1 set, increment byte 2 by 1, not set, byte 2 is ok

Bit2 set, increment byte 3 by 1, not set, byte 3 is ok

Bit3 set, increment byte 4 by 1, not set, byte 4 is ok

Bit4 set, increment byte 5 by 1, not set, byte 5 is ok

Bit5 set, increment byte 6 by 1, not set, byte 6 is ok

Bit6 set, the ADC returned 0 Counts, ambiguous data

Bit7 set, the ADC returned 4095 Counts, ambiguous data

Mask off the upper 12 bits, shift them right by 44 bits. The value is 0x0C1, or 193 counts.

Advertising