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 SDM-SIO4 has two error detection filters ‘gn’ and ‘Gn’. The first, ‘gn’, is used to set the signature type you want to use and ‘Gn’ is used to set the data type of the signature expected from the sensor/device. A full description of how these filters operate is shown below.

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 0-255. The signature types supported are below:

0No Signature type used.

1CRC16 standard. Polynomial x16+x15+x2+1.

2CRC16-CCITT standard. Polynomial x16+x12+x5 +1.

6-1

Page 57
Image 57
Campbell Hausfeld manual Data Error Detection, Error Detection with the SDM-SIO4, Received Data