CT100 inverter Communication protocol
155
{
int i;
unsigned int crc_value=0xffff;
while(data_length--)
{
crc_value^=*data_value++;
for(i=0;i<8;i++)
{
if(crc_value&0x0001)
crc_value=(crc_value>>1)^0xa001;
else
crc_value=crc_value>>1;
}
}
return(crc_value);
}
Fault message response
The slave uses functional code fields and fault addresses to indicate it is a
normal response or some error occurs (named as objection response). For
normal responses, the slave shows corresponding function codes, digital
address or sub-function codes as the response. For objection responses, the
slave returns a code which equals the normal code, but the first byte is logic 1.
For example: when the master sends a message to the slave, requiring it to read
a group of address data of the inverter function codes, there will be following
function codes:
0 0 0 0 0 0 1 1 (hexadecimal 03H)
For normal responses, the slave responds the same function codes, while
for objection responses, it will return:
1 0 0 0 0 0 1 1 (hexadecimal 83H)
Besides the function codes modification for the objection fault, the slave will
respond a byte of abnormal code which defines the error reason.
When the master receives the response for the objection, in a typical processing,
it will send the message again or modify the corresponding order.