packed ASCII



  • Hallo,
    ich empfange über RS232 24 Bytes die 32 Zeichen darstellen, ist also mit Packed ASCII codiert.
    Kennt denn jemand eine gute Seite über Packed ASCII?
    Oder möchte mir jemand erkären wie das funktioniert?

    Danke



  • schau mal nach BASE64, ist eventuell das selbe format, von packet ascii hab ich leider noch nie was gehoert.



  • rapso schrieb:

    schau mal nach BASE64, ist eventuell das selbe format...

    nee, base64 macht ja mehr statt weniger.
    packed ascii ist so'n kompressionsformat, das 4 zeichen in 3 bytes packt.
    guck mal bei google, das ist irgendwo beschrieben...
    🙂



  • HART makes limited use of data compression in the form of Packed ASCII. Normally, there are 256 possible ASCII characters, so that a full byte is needed to represent a character. Packed ASCII is a subset of full ASCII and uses only 64 of the 256 possible characters. These 64 characters are the capitalized alphabet, numbers 0 through 9, and a few punctuation marks. Many HART parameters need only this limited ASCII set, which means that data can be compressed to 3/4 of normal. This improves transmission speed, especially if the textual parameter being communicated is a large one.

    Since only full bytes can be transmitted, the 3/4 compression is fully realized only when the number of uncompressed bytes is a multiple of 4. Any fractional part requires a whole byte. Thus, if U is the number of uncompressed bytes, and T the number of transmitted bytes; find T = (3*U)/4 and increase any fractional part to 1. As examples, U = 3, 7, 8, and 9 result in T = 3, 6, 6, and 7.

    The rule for converting from ASCII to Packed ASCII is just to remove bits 6 and 7 (two most significant). An example is the character "M". The full binary code to represent this is 0100,1101. The packed binary code is 00,1101. The rules for conversion from packed ASCII back to ASCII are (1) set bit 7 = 0 and (2) set bit 6 = complement of packed ASCII bit 5.

    Note that, with some exceptions, HART Slaves don't need to do the compression or know anything about the compression. They simply store and re-transmit the already compressed data. Again, this is an instance where the more difficult software is placed in the device (Master) that is more capable of dealing with it.

    Vielleicht hilft dir ja das weiter.
    Quelle: http://www.analogservices.com/about_part2.htm



  • Vielen Dank für eure Antworten.
    Bin mal wieder ein Stück schlauer geworden. 😉


Anmelden zum Antworten