Section 6. Data Error Detection
Error detection by checksum, CRC or signatures is a way of detecting errors in data, either transmitted or received. This section gives details on how to use filter strings together with datalogger program examples to implement error detection methods.
6.1 Error Detection with the SDM-SIO4
Error detection is carried out to provide confidence that critical data is received/transmitted correctly.
For example, some data may be transmitted through a noisy environment, which could introduce errors into the data. Thus the received data could be corrupted in some way – for instance a number might possibly be changed from ‘1000’ to ‘2000’. This change would not be detected if the numbers were both in the valid number range unless some error detection system was used.
Error detection usually takes the form of the transmitting device calculating a Checksum, CRC (cyclic redundancy checksum) or Signature for the data it is transmitting. This Checksum, CRC or Signature result is transmitted at the end of the data in some form. The receiving device is configured to calculate exactly the same Checksum, CRC or Signature on the data it receives (except for the checksum bytes). The two separate Checksums, CRCs or Signatures are then compared, and if the two match exactly then the data received should be error free.
6.2 Received Data
NOTE | No checksum will detect 100% of all errors. The more sophisticated |
| the algorithm the better the error detection. |
|
|
The signature that the sensor returns can be in many different data types – for example ASCII decimal, binary or hexadecimal. Additionally, each of the data types can have differences; for example with binary you can have 8 bit, 16 bit, and 32 bit and also the most significant byte could be transmitted first or the least significant byte could be transmitted first. Because of the above the
gn
This filter type can be put into the filter string to mark the start of a signature generation. When this happens the signature type determined by ‘n’ will be initialised ready to start signature calculation for all characters until filter Gn is encountered, which marks the end of the string (see below). The value of ‘n’ for filter gn can be in the range of
0No Signature type used.
1CRC16 standard. Polynomial x16+x15+x2+1.
2