Cálculo de LCR "Longitudinal Redundancy Check" ASCII

como estan miren estoy teniendo problemas con esta detectar el LRC de esta trama:

:1104080200020002000200DB


los pasos para calcularlo son:

To calculate the LRC:
1. Add up all the data bytes in the message (before converting to ASCII and without the initial colon and final CR/LF).
2. Throw away any bits that carry over 8 bits.
3. Make the result negative (by twos compliment) to get the LRC byte.

The sum of the resulting byte stream with the LRC will then be 0 since adding the negative subtotal will make the final total zero.

For example, this command shows the data bytes required to request the content of analog output holding registers 40108 to 40110 from the slave device with address 17.

la trama que les mostré esta bien por que es la que sale de un simulador ModBUs Slave

según mis cálculos el resultado del LRC debería ser E3

nota: los datos 0200 son enteros de 16bits y son cuatro datos
 
la duda era que tenia que dar DB, intente tomando de dos caracteres y no tomando 0x0200 completo si no 0x02 y 0x00 y a si si me resulto, gracias

0x11+0x04+0x08+0x02+0x00+0x02+0x00+0x02+0x00+0x02+0x00
 
Atrás
Arriba