S.A Merhaba Arkadaşlar bir cihaz ile haberleşmek istiyorum bu cihaz bilgilerin doğru gelip gelmedigini anlamak için checksum yerine LRC ile hesaplanmış veri istiyor.Bunu hesaplayan fonksiyonu nasıl yazabilirim bir fikri olan var mı ?
Şimdiden Teşekkürler
LRC (Longitudinal Redundancy Check ) Fonksiyonu
Forum kuralları
Forum kurallarını okuyup, uyunuz!
Forum kurallarını okuyup, uyunuz!
- Bilgim yok ama Google araması yapınca aşağıdaki linki buldum. Güzel de anlatmış.
- Ref : http://www.mit.jyu.fi/vesal/kurssit/win ... crc7~1.htm
- Kod Delphi'ye dönüştürülmüş hali.
Ref: http://groups.google.com.tr/group/borla ... 66ad200c6d
- PDF olarak Modbus Protocol için hazırlanmış orjinal hali.
Ref : http://www.noworry.com.br/Download/Novus/Modbus-doc.pdf
- Kolay gelsin..
- Ref : http://www.mit.jyu.fi/vesal/kurssit/win ... crc7~1.htm
- Kod Delphi'ye dönüştürülmüş hali.
Ref: http://groups.google.com.tr/group/borla ... 66ad200c6d
Kod: Tümünü seç
function CalcLRC(szMsg: PUCHAR; usDataLen: SHORT):UCHAR;
begin
Result := 0;
while(usDataLen <> 0) do
begin
Result := Result + szMsg^;
inc(szMsg);
Dec(usDataLen);
end;
Result := UCHAR( CHAR(-(Result)));
end;
Ref : http://www.noworry.com.br/Download/Novus/Modbus-doc.pdf
- Kolay gelsin..