Section 6. data error correction, 1 error detection with the sdm-sio4, 2 received data – Campbell Hausfeld Serial I/O Interface SDM-SIO4 User Manual

Page 57

Advertising
background image

6-1

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

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:

0

No Signature type used.

1

CRC16 standard. Polynomial x

16

+x

15

+x

2

+1.

2

CRC16-CCITT standard. Polynomial x

16

+x

12

+x

5

+1.

NOTE

Advertising