The correct way to escape a command is: Example 1) escape the command 2) apply the hdlc checksum 3) escape the checksum Your rotine does only the first one But it will give error if the checksum contains 7e,7d or 5d. Regards. Zibri