Honeywell CD3200 User Manual page 41

Thyristor unit, up to 110a
Table of Contents

Advertisement

User's Manual ver. 2.0
10.2.3 C Language CRC 16 Example
static short CRC16 (unsigned char *p_first,unsigned char *p_last)
{
unsigned int crc=0xffff;
short j;
for (;p_first<=p_last;p_first++)
{
crc ^= *p_first;
for(j=8;j>0;j--)
{
if(crc & 0x0001)
else
}
}
return (crc);
}
10.2.4 Read Holding Registers (Read n Words) – Function 03
The message sent to the Controller to obtain the value of one or more registers comprises the
following eight bytes:
Addr. unit
Func.
3
3Hex
The normal reply will echo the first two characters of the message received followed by a single-
byte data byte count (which will not include itself or the CRC).
For this message, the count value equals the number of parameter values read multiplied by two.
Following the byte count, the specified number of parameter values are transmitted, followed by
the CRC16 bytes:
Addr. unit
Func.
3
3Hex
CD3200 up to110A
{
crc = crc >> 1;
crc ^= 0xA001;
}
{
crc = crc >> 1;
}
Address
1° word
HI
LO
Cont.
1° Value
HI
N° of Word
HI
LO
Last Value
LO
HI
39
Honeywell
CRC 16
HI
LO
CRC 16
LO
HI
LO
www.honeywell.com/imc

Advertisement

Table of Contents
loading

Table of Contents