User Manual

Compact IO™ Isolated HART Analog Input Module
U ser 's M a n u a l 0 300 21 5- 03 R ev. A
8-4
The algorithm ca n be implemented in ladder by masking and shifting four 6-bit
characters into a double wo rd register then moving the three bytes into the packed ASCII
string.
Reconstruction of ASCII characters:
Unpacking packed ASCII str ings requires flipping some bits in addition to
uncompressing the string itself. To unpack a packed ASCII string:
1.
Unpack the four, 6-bit ASCII characters.
2.
For each character, place the complement of bit 5 into bit 6.
3.
For each character, reset bit Bit 7 to zero.
4.
Repeat until the entire string i s processed.
This algorithm can be implemented by loading three bytes into a 24-bit register and
shifting the four 6-bit c haracters into the string. Parse the resulting character to flip bit 6
as needed.
The ladder sample starting on the next page demonstrates how to pack 4 unpacked ASCII
characters into 3 bytes.
Figure 8-4a (Packed ASCII)