Table 1.4: Function Code 10 Example

 

Master Packet

 

Slave Packet

 

Slave Address

01H

Slave Address

01H

Function Code

10H

Function Code

10H

Data Starting Address-Hi

E0H

Data Starting Address-Hi

E0H

Data Starting Address-Lo

01H

Data Starting Address-Lo

01H

Number of Setpoints-Hi

00H

Number of Setpoints-Hi

00H

Number of Setpoints-Lo

03H

Number of Setpoints-Lo

03H

Byte Count

06H

CRC-Lo

E6H

Data #1-Hi

00H

CRC-Hi

08H

Data #1-Lo

01H

 

 

Data #2-Lo

00H

 

 

Data #2-Hi

01H

 

 

Data #3-Lo

00H

 

 

Data #3-Hi

01H

 

 

CRC-Lo

4DH

 

 

CRC-Hi

46H

 

 

1.5: CRC (Error Checksum) Algorithm

The Cyclic Redundancy Check (CRC) field is an error checksum calculation that enables a Slave device to determine if a request packet has been corrupted during transmission.

Every request packet transmitted from Master to Slave includes a special 16-bit value derived from a CRC-16 algorithm performed on the packet’s contents. When an EPM Slave receives a packet, it performs a CRC-16 calculation and compares the value with the one included in the request packet. If the two values do not match, the Slave will ignore the packet.

The following is the pseudocode for calculating the 16-bit CRC:

Initialize a 16-bit register to FFFFH.

Initialize the generator polynomial to A001H.

1-4

Page 20
Image 20
GE EPM 9650/9800 manual CRC Error Checksum Algorithm, Function Code 10 Example Master Packet Slave Packet