Forum: PC-Programmierung CRC4 Berechnung in Visual Basic?


von Patrick (Gast)


Lesenswert?

Hallo,

ich möchte in VB 2010 Express ein Programm erstellen um mit einem Sensor 
zu kommunizieren.

Der String sieht so aus:

<A1><A0><D3><D2><D1><D0><CRC>

<A> address as 2-digit hex No.
<D> data as 4-digit hex No.
<CRC> checksum as 1-digit hex No

Nun muss die CRC als CRC4 berechnet werden. Das Handbuch beschreibt:

The data bits are always followed by 4 CRC bits. For all commands but 
read the CRC result is calculated of all protocol bits, including 
command, address, parity and data bits.

For read command, the CRC result is calculated of data bits only (16).
The polynomial for the CRC calculation is always X4+X+1

Wie kann ich das in VB umsetzen?

Gruss Patrick

von foo (Gast)


Lesenswert?

http://www.ross.net/crc/crcpaper.html
Ist eine gute Referenz.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.