beautypg.com

Xylem System 5000 User Manual User Manual

Page 69

background image

Outputs

67

A GOES pseudo-binary byte is represented by a single ASCII printable character. All data values

(except battery voltage, time, and date) are made up using between one and four pseudo-binary

bytes. To decode a binary data value, the number of bytes used by the data value as well as the

sign mode (Signed-Magnitude, 2’s Complement, or Only Positive) must be known.
For Signed-Magnitude values, the weight of each pseudo-binary character can be determined by

using the look-up table below and identifying the column of the related character. To obtain the

original value, add the weights of all the characters.
For 4-byte signed values, if the value is greater than 8388607, subtract 8388608 from the value

and change the sign to negative.
For 3-byte signed values, if the value is greater than 131071, subtract 131072 from the value and

change the sign to negative.
For 2-byte signed values, if the value is greater than 2047, subtract 2048 from the value and change

the sign to negative.
For 1-byte signed values, if the value is greater than 31, subtract 32 from the value and change

the sign to negative.
Finally, divide the number by 10^Precision. Thus if 2 was chosen as the Precision, divide the

number by 100 (10^2), 3 would be 1000 (10^3), etc.
The following are 3-byte, 2 Precision Signed-Magnitude examples:
H^g = (32768 + 1920 + 39) = 34727

H in the left position = 32768

^

in

the

middle

position

=

1920

g

in

the

right

position

=

39

---------

Total

=

34727

This is less than 131071 so just divide by 100.

Divide by 100. 34727 / 100 = 347.27 = final value.

rSx=(204800 + 1216 + 56) = 206072

r in the left position = 204800

S

in

the

middle

position

=

1216

x

in

the

right

position

=

56

------------

Total

=

206072

This is greater than 131071 so subtract it from 131072.

206072 - 131072 = 75000
Then divide by 100 and change the sign. (-1) * 75000 / 100 = -750.00 = final value.

Appended battery values are encoded using a single byte. To decode the appended battery

voltage use the weighted value for the character from the right hand column and multiply it by

0.3124, then add 0.311.