Communication Guide, ©ComAp – March 2014 118
IGS-NT Communication Guide 03-2014.pdf
Check field calculation
The check field allows the receiver to check the validity of the message. The check field value is the
Cyclical Redundancy Check (CRC) based on the polynomial x
16
+x
15
+x
2
+1. CRC is counted from all
message bytes preceding the check field. The algorithm of CRC calculation is introduced below on an
example of a C language function.
unsigned short count_CRC(unsigned char *addr, int num)
{
unsigned short CRC = 0xFFFF;
int i;
while (num--)
{
CRC ^= *addr++;
for (i = 0; i < 8; i++)
{
if (CRC & 1)
{
CRC >>= 1;
CRC ^= 0xA001;
}
else
{
CRC >>= 1;
}
}
}
return CRC;
}
Online CRC calculator: http://www.lammertbies.nl/comm/info/crc-
calculation.html
Controllers use the CRC-16 (Modbus). Data in examples in this manual are in
HEX format.
How get numbers of ModBus communication
objects
Communication objects can be
spitted into two groups:
1. Communication objects
dependent on the application
type (SSB, SPM, SPtM, MEXT,
MINT, …).
2. Communication objects
independent on the application
type.
Use GenConfig menu command
File –> Generate Cfg Image –>