Modbus standard

N

Thread Starter

NSR Prasad

We understand that CRC is more powerful than LRC from error correction point of view. If so, why ASCII mode of Modbus standard adopts LRC and RTU mode adopts CRC. Can ASCII mode be used with CRC instead of LRC. Is there any specific reason for this.
 
M
ASCII adopted LRC because:
1. It can be shoehorned into one byte.

2. The parity bit on each byte of the message complements it in terms of error detection.
- note - there is no error correction in MODBUS - just detection.

3. You cannot swap LRC-CRC for ASCII-RTU.

Meir
 
D

Daniel Scott

Something to keep in mind with ASCII mode is that there are only 19 valid characters: the digits 0-9, A-F, ':', carriage return, and line feed. The
data portion, which the checksum is based on, has only 16 valid characters. So while LRC is not as robust as CRC, to accept a message as valid when it is not, two or more of these characters must be altered such that they remain one of the valid ASCII characters and the changes are such that the
LRC stays the same.

When dealing with a modem or radio network ASCII is much easier to troubleshoot and less sensitive to timing issues.

Danny Scott
Fredericton, N.B.
Canada
d.o.scott(AT)UNB.ca
 
C

Curt Wuollet

LRC is adequate with the limited set of ASCII values. If it's not, you probably have wiring issues. And you could use CRC if you wrote it in yourself, but it would no longer be "standard" Modbus. Not that standards have deterred anyone else in the biz.

Regards

cww
 
P

Paul Ashworth

Ana

If you still want CRC-16 implementation; I did it about a year ago for an 8051 micro-controller. Where should I send it.
 
Top